MOONS Pipeline Reference Manual 0.13.2
moo_rbn_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_RBN_SINGLE_H
21#define MOO_RBN_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_sky_lines_list.h"
32/*-----------------------------------------------------------------------------
33 Types
34 -----------------------------------------------------------------------------*/
35typedef struct
36{
37 const char *filename;
38 const char *extname;
39 cpl_propertylist *header;
40 hdrl_image *image;
41 cpl_image *qual;
42 unsigned int badpix_mask;
44} moo_rbn_single;
45
46#define MOO_RBN_SINGLE_BUNIT "counts"
47#define MOO_RBN_SINGLE_ERR "ERR"
48#define MOO_RBN_SINGLE_ERR_TYPE CPL_TYPE_FLOAT
49#define MOO_RBN_SINGLE_QUAL "QUAL"
50#define MOO_RBN_SINGLE_QUAL_TYPE CPL_TYPE_INT
51
52#define MOO_RBN_SINGLE_CRPIX2 1
53#define MOO_RBN_SINGLE_CRVAL2 1
54#define MOO_RBN_SINGLE_CDELT2 1.0
55#define MOO_RBN_SINGLE_CTYPE2 "INDEX"
56/*-----------------------------------------------------------------------------
57 Functions prototypes
58 -----------------------------------------------------------------------------*/
59moo_rbn_single *moo_rbn_single_new(moo_detector_type type);
60
61moo_rbn_single *
62moo_rbn_single_create(const char *filename, moo_detector_type type);
63void moo_rbn_single_delete(moo_rbn_single *self);
64void moo_rbn_single_save(const moo_rbn_single *self,
65 const char *filename,
67cpl_error_code moo_rbn_single_set_wcs1(moo_rbn_single *self,
68 double crpix1,
69 double crval1,
70 double cd1_1,
71 const char *ctype1,
72 const char *cunit1);
73hdrl_image *moo_rbn_single_get_image(moo_rbn_single *self);
74cpl_image *moo_rbn_single_get_data(moo_rbn_single *self);
75cpl_image *moo_rbn_single_get_errs(moo_rbn_single *self);
76cpl_image *moo_rbn_single_get_qual(moo_rbn_single *self);
77cpl_propertylist *moo_rbn_single_get_header(moo_rbn_single *self);
78cpl_error_code moo_rbn_single_load(moo_rbn_single *self, unsigned int level);
79double moo_rbn_single_compute_snr(moo_rbn_single *self,
80 int rbn_idx,
81 moo_sky_lines_list *skylines);
82cpl_error_code moo_rbn_single_dump(const moo_rbn_single *self, FILE *stream);
83cpl_error_code moo_rbn_single_free(moo_rbn_single *self);
84#endif
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
hdrl_image * moo_rbn_single_get_image(moo_rbn_single *self)
Get image of RBN_SINGLE.
moo_rbn_single * moo_rbn_single_create(const char *filename, moo_detector_type type)
Create a new moo_rbn_single with the given filename and type.
void moo_rbn_single_save(const moo_rbn_single *self, const char *filename, moo_detector_type type)
Save a moo_rbn_single to a FITS file.
cpl_propertylist * moo_rbn_single_get_header(moo_rbn_single *self)
Get header of rbn single.
moo_rbn_single * moo_rbn_single_new(moo_detector_type type)
Create a new moo_rbn_single.
void moo_rbn_single_delete(moo_rbn_single *self)
Delete a moo_rbn_single.
cpl_error_code moo_rbn_single_dump(const moo_rbn_single *self, FILE *stream)
Dump structural information of a Single DET.
cpl_error_code moo_rbn_single_load(moo_rbn_single *self, unsigned int level)
load the data of a moo_rbn_single
cpl_image * moo_rbn_single_get_data(moo_rbn_single *self)
Get image of data.
double moo_rbn_single_compute_snr(moo_rbn_single *self, int rbn_idx, moo_sky_lines_list *skylines)
Compute SNR for a given target.
cpl_error_code moo_rbn_single_free(moo_rbn_single *self)
Free memory associate to this single RBN.
cpl_error_code moo_rbn_single_set_wcs1(moo_rbn_single *self, double crpix1, double crval1, double cd1_1, const char *ctype1, const char *cunit1)
Set the WCS1 of the extension.
cpl_image * moo_rbn_single_get_qual(moo_rbn_single *self)
Get image of qual.
cpl_image * moo_rbn_single_get_errs(moo_rbn_single *self)
Get image of errs.