MOONS Pipeline Reference Manual 0.13.1
moo_sci_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_SCI_SINGLE_H
21#define MOO_SCI_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_target_table.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 cpl_image *sky;
46} moo_sci_single;
47
48#define MOO_SCI_SINGLE_BUNIT "counts"
49#define MOO_SCI_SINGLE_DATA_TYPE CPL_TYPE_FLOAT
50#define MOO_SCI_SINGLE_ERR "ERR"
51#define MOO_SCI_SINGLE_ERR_TYPE CPL_TYPE_FLOAT
52#define MOO_SCI_SINGLE_QUAL "QUAL"
53#define MOO_SCI_SINGLE_QUAL_TYPE CPL_TYPE_INT
54#define MOO_SCI_SINGLE_SKY "SKY"
55
56#define MOO_SCI_SINGLE_CRPIX2 1
57#define MOO_SCI_SINGLE_CRVAL2 1
58#define MOO_SCI_SINGLE_CDELT2 1.0
59#define MOO_SCI_SINGLE_CTYPE2 "INDEX"
60/*-----------------------------------------------------------------------------
61 Functions prototypes
62 -----------------------------------------------------------------------------*/
63moo_sci_single *moo_sci_single_new(moo_detector_type type);
64void moo_sci_single_delete(moo_sci_single *self);
65void moo_sci_single_save(moo_sci_single *self,
66 const char *filename,
68
69moo_sci_single *
70moo_sci_single_create(const char *filename, moo_detector_type type);
71
72cpl_error_code moo_sci_single_load(moo_sci_single *self, unsigned int level);
73cpl_propertylist *moo_sci_single_get_header(moo_sci_single *self);
74hdrl_image *moo_sci_single_get_image(moo_sci_single *self);
75cpl_image *moo_sci_single_get_sky(moo_sci_single *self);
76cpl_image *moo_sci_single_get_qual(moo_sci_single *self);
77double moo_sci_single_compute_snr(moo_sci_single *self,
78 int targ_idx,
79 moo_sky_lines_list *skylines);
80#endif
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
void moo_sci_single_save(moo_sci_single *self, const char *filename, moo_detector_type type)
Save a moo_sci_single to a FITS file.
moo_sci_single * moo_sci_single_new(moo_detector_type type)
Create a new moo_sci_single.
void moo_sci_single_delete(moo_sci_single *self)
Delete a moo_sci_single.
cpl_image * moo_sci_single_get_sky(moo_sci_single *self)
Get sky of sci single.
hdrl_image * moo_sci_single_get_image(moo_sci_single *self)
Get image of SCI_SINGLE.
cpl_image * moo_sci_single_get_qual(moo_sci_single *self)
Get image of qual.
cpl_error_code moo_sci_single_load(moo_sci_single *self, unsigned int level)
Load a moo_sci_single from the filename.
cpl_propertylist * moo_sci_single_get_header(moo_sci_single *self)
Get header of sci single.
double moo_sci_single_compute_snr(moo_sci_single *self, int targ_idx, moo_sky_lines_list *skylines)
Compute SNR for a given target.
moo_sci_single * moo_sci_single_create(const char *filename, moo_detector_type type)
Create a new moo_sci_single with the given filename and type.