MOONS Pipeline Reference Manual 0.13.2
moo_ext_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_EXT_SINGLE_H
21#define MOO_EXT_SINGLE_H
22
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <cpl.h>
29#include <hdrl.h>
30#include "moo_detector.h"
31#include "moo_spectral_format.h"
32#include "moo_sky_lines_list.h"
33/*-----------------------------------------------------------------------------
34 Types
35 -----------------------------------------------------------------------------*/
36typedef struct
37{
38 const char *filename;
39 const char *extname;
40 cpl_propertylist *header;
41 hdrl_image *image;
42 cpl_image *qual;
43 unsigned int badpix_mask;
45 int ntas;
46} moo_ext_single;
47
48#define MOO_EXT_SINGLE_ERR "ERR"
49#define MOO_EXT_SINGLE_ERR_TYPE CPL_TYPE_FLOAT
50#define MOO_EXT_SINGLE_QUAL "QUAL"
51#define MOO_EXT_SINGLE_QUAL_TYPE CPL_TYPE_INT
52
53#define MOO_EXT_SINGLE_CRPIX2 1
54#define MOO_EXT_SINGLE_CRVAL2 1
55#define MOO_EXT_SINGLE_CDELT2 1.0
56#define MOO_EXT_SINGLE_CTYPE2 "INDEX"
57/*-----------------------------------------------------------------------------
58 Functions prototypes
59 -----------------------------------------------------------------------------*/
60moo_ext_single *moo_ext_single_new(moo_detector_type type, int ntas);
61moo_ext_single *
62moo_ext_single_create(const char *filename, moo_detector_type type, int ntas);
63cpl_error_code moo_ext_single_load(moo_ext_single *self, unsigned int level);
64
65cpl_error_code moo_ext_single_free(moo_ext_single *self);
66void moo_ext_single_delete(moo_ext_single *self);
67
68hdrl_image *moo_ext_single_get_image(moo_ext_single *self);
69cpl_image *moo_ext_single_get_data(moo_ext_single *self);
70cpl_image *moo_ext_single_get_errs(moo_ext_single *self);
71cpl_image *moo_ext_single_get_qual(moo_ext_single *self);
72cpl_propertylist *moo_ext_single_get_header(moo_ext_single *self);
73cpl_error_code moo_ext_single_compute_qc(moo_ext_single *self,
74 const char *colname,
75 const char *dersnr_colname,
76 cpl_table *fibres_table);
77cpl_error_code moo_ext_single_set_wcs1(moo_ext_single *self,
78 double crpix1,
79 double crval1,
80 double cd1_1,
81 const char *ctype1,
82 const char *cunit1);
83void moo_ext_single_delete(moo_ext_single *self);
84
85void moo_ext_single_save(const moo_ext_single *self,
86 const char *filename,
88 int ntas);
89
90cpl_error_code moo_ext_single_dump(const moo_ext_single *self, FILE *stream);
91cpl_error_code moo_ext_single_sum(moo_ext_single *a, moo_ext_single *b);
92
93double moo_ext_single_compute_snr(moo_ext_single *self,
94 int ext_idx,
95 cpl_image *wmap,
96 moo_spectral_format_info *sinfo,
97 moo_sky_lines_list *skylines,
98 double *dersnr);
99#endif
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
double moo_ext_single_compute_snr(moo_ext_single *self, int ext_idx, cpl_image *wmap, moo_spectral_format_info *sinfo, moo_sky_lines_list *skylines, double *dersnr)
Compute SNR for a given target.
moo_ext_single * moo_ext_single_new(moo_detector_type type, int ntas)
Create a new moo_ext_single.
hdrl_image * moo_ext_single_get_image(moo_ext_single *self)
Get image of EXT_SINGLE.
cpl_error_code moo_ext_single_load(moo_ext_single *self, unsigned int level)
load a moo_ext_single using the level for badpixel
cpl_error_code moo_ext_single_free(moo_ext_single *self)
Free memory associate to this single EXT.
void moo_ext_single_delete(moo_ext_single *self)
Delete a moo_ext_single.
cpl_image * moo_ext_single_get_qual(moo_ext_single *self)
Get image of qual.
moo_ext_single * moo_ext_single_create(const char *filename, moo_detector_type type, int ntas)
Create a new moo_ext_single from the given EXT filename.
void moo_ext_single_save(const moo_ext_single *self, const char *filename, moo_detector_type type, int ntas)
Save a moo_ext_single to a FITS file.
cpl_error_code moo_ext_single_set_wcs1(moo_ext_single *self, double crpix1, double crval1, double cd1_1, const char *ctype1, const char *cunit1)
Set the WCS1 of the extension.
cpl_image * moo_ext_single_get_errs(moo_ext_single *self)
Get image of errs.
cpl_error_code moo_ext_single_dump(const moo_ext_single *self, FILE *stream)
Dump structural information of EXT_SINGLE.
cpl_error_code moo_ext_single_sum(moo_ext_single *a, moo_ext_single *b)
Add two single EXT.
cpl_propertylist * moo_ext_single_get_header(moo_ext_single *self)
Get header of ext single.
cpl_image * moo_ext_single_get_data(moo_ext_single *self)
Get image of data.