MOONS Pipeline Reference Manual 0.13.1
moo_loc_single.h
1/*
2 * This file is part of the MOONS Pipeline
3 * Copyright (C) 2002-2016 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef MOO_LOC_SINGLE_H
21#define MOO_LOC_SINGLE_H
22
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <cpl.h>
29#include <hdrl.h>
30
31
32#define MOO_LOC_SINGLE_FCENTROID "LOC_FIT"
33#define MOO_LOC_SINGLE_MCENTROID "LOC_PTS"
34#define MOO_LOC_SINGLE_WLO "WIDTH_LOW"
35#define MOO_LOC_SINGLE_WUP "WIDTH_UP"
36#define MOO_LOC_SINGLE_MWLO "PTS_WIDTH_LOW"
37#define MOO_LOC_SINGLE_MWUP "PTS_WIDTH_UP"
38#define MOO_LOC_SINGLE_FLAGS "FLAGS"
39
40#define MOONS_FLAG_GOOD 0
41#define MOONS_FLAG_YDIFF_OUTLIERS 1
42#define MOONS_FLAG_WDIFF_OUTLIERS 2
43#define MOONS_FLAG_BADPROFILE 3
44#define MOONS_FLAG_BADPIX 4
45#define MOONS_FLAG_NON_SIGNIFICANT_FLUX 5
46#define MOONS_FLAG_NOPROFILE 6
47#define MOONS_FLAG_NAN_IN_TRACE_GUESS 7
48#define MOONS_FLAG_NARROWPROFILE 8
49#define MOONS_FLAG_BROKEN_FIBRE 9
50#define MOONS_FLAG_XMAX_GAP 10
51/*-----------------------------------------------------------------------------
52 Types
53 -----------------------------------------------------------------------------*/
54typedef struct
55{
56 const char *filename;
57 const char *extname;
58 cpl_propertylist *header;
59 cpl_image *m_centroids;
60 cpl_image *f_centroids;
61 cpl_image *f_wlow;
62 cpl_image *f_wup;
63 cpl_image *m_wup;
64 cpl_image *m_wlow;
65 cpl_image *flags;
66} moo_loc_single;
67
68/*-----------------------------------------------------------------------------
69 Functions prototypes
70 -----------------------------------------------------------------------------*/
71moo_loc_single *moo_loc_single_new(void);
72moo_loc_single *
73moo_loc_single_create(const char *filename, const char *extname);
74
75cpl_propertylist *moo_loc_single_get_header(moo_loc_single *self);
76cpl_image *moo_loc_single_get_f_centroids(moo_loc_single *self);
77double moo_loc_single_eval_f_centroids(moo_loc_single *self,
78 double x,
79 int indexext,
80 int *rej);
81cpl_image *moo_loc_single_get_m_centroids(moo_loc_single *self);
82cpl_image *moo_loc_single_get_flags(moo_loc_single *self);
83cpl_image *moo_loc_single_get_f_wlo(moo_loc_single *self);
84cpl_image *moo_loc_single_get_f_wup(moo_loc_single *self);
85cpl_mask *moo_loc_single_get_ODR(moo_loc_single *self, int size_y);
86
87cpl_error_code
88moo_loc_single_compute_qc_guess(moo_loc_single *self, int deg_poly);
89cpl_error_code moo_loc_single_compute_qc_trace(moo_loc_single *self,
90 int deg_poly,
91 moo_loc_single *guess);
92
93void moo_loc_single_delete(moo_loc_single *self);
94void moo_loc_single_save(const moo_loc_single *self,
95 const char *filename,
96 int keep_points);
97cpl_error_code moo_loc_single_dump(const moo_loc_single *self, FILE *stream);
98
99#endif
void moo_loc_single_delete(moo_loc_single *self)
Delete a moo_loc_single.
double moo_loc_single_eval_f_centroids(moo_loc_single *self, double x, int indexext, int *rej)
Get the Y fit centroid for a x value.
void moo_loc_single_save(const moo_loc_single *self, const char *filename, int keep_points)
Save a moo_loc_single to a FITS file.
cpl_error_code moo_loc_single_dump(const moo_loc_single *self, FILE *stream)
Dump structural information of LOC_SINGLE.
moo_loc_single * moo_loc_single_new(void)
Create a new moo_loc_single.
cpl_image * moo_loc_single_get_f_wup(moo_loc_single *self)
Get image of width low.
cpl_image * moo_loc_single_get_f_centroids(moo_loc_single *self)
Get image of fit centroids.
cpl_image * moo_loc_single_get_flags(moo_loc_single *self)
Get image of flags.
cpl_image * moo_loc_single_get_m_centroids(moo_loc_single *self)
Get image of measured centroids.
cpl_propertylist * moo_loc_single_get_header(moo_loc_single *self)
Get header of loc single.
moo_loc_single * moo_loc_single_create(const char *filename, const char *extname)
Create a new moo_loc_single from the given LOC filename.
cpl_image * moo_loc_single_get_f_wlo(moo_loc_single *self)
Get image of width low.
cpl_mask * moo_loc_single_get_ODR(moo_loc_single *self, int size_y)
Get outside data range mask far a DET single.