MOONS Pipeline Reference Manual 0.13.2
moo_ext.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_H
21#define MOO_EXT_H
22
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <cpl.h>
29#include <hdrl.h>
30#include "moo_map.h"
31#include "moo_spectral_format.h"
32#include "moo_ext_single.h"
33#include "moo_detector.h"
34/*-----------------------------------------------------------------------------
35 Types
36 -----------------------------------------------------------------------------*/
37typedef struct
38{
39 const char *filename;
40 cpl_propertylist *primary_header;
41 moo_ext_single *ri[2];
42 moo_ext_single *yj[2];
43 moo_ext_single *h[2];
44 cpl_table *fibre_table;
45
46} moo_ext;
47/*-----------------------------------------------------------------------------
48 Functions prototypes
49 -----------------------------------------------------------------------------*/
50moo_ext *moo_ext_new(void);
51moo_ext *moo_ext_create(const cpl_frame *frame);
52cpl_error_code moo_ext_load(moo_ext *self, unsigned int level);
53moo_ext_single *moo_ext_load_single(moo_ext *self,
55 int num,
56 unsigned int level);
57cpl_error_code moo_ext_set_single(moo_ext *self,
59 int ntas,
60 moo_ext_single *s);
61
62moo_ext_single *
63moo_ext_get_single(moo_ext *self, moo_detector_type type, int num);
64
65cpl_error_code moo_ext_add_single(moo_ext *self,
66 moo_ext_single *s,
68 int ntas);
69cpl_error_code moo_ext_add_fibre_table(moo_ext *self, cpl_table *fibre_table);
70
71cpl_table *moo_ext_get_fibre_table(moo_ext *self);
72void moo_ext_delete(moo_ext *self);
73void moo_ext_save(moo_ext *self, const char *filename);
74cpl_error_code moo_ext_dump(const moo_ext *self, FILE *stream);
75cpl_error_code
76moo_ext_free_single(moo_ext *self, moo_detector_type type, int num);
77cpl_error_code moo_ext_sum(moo_ext *self, moo_ext *ext);
78cpl_error_code moo_ext_compute_snr(moo_ext *self,
79 moo_map *wmap,
80 moo_spectral_format *sformat,
81 moo_sky_lines_list *skylines);
82#endif
cpl_error_code moo_ext_free_single(moo_ext *self, moo_detector_type type, int num)
Free the given type part in EXT.
Definition: moo_ext.c:486
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
moo_ext_single * moo_ext_get_single(moo_ext *self, moo_detector_type type, int num)
Get a EXT single from EXT.
Definition: moo_ext.c:199
moo_ext * moo_ext_new(void)
Create a new moo_ext.
Definition: moo_ext.c:69
cpl_error_code moo_ext_add_fibre_table(moo_ext *self, cpl_table *fibre_table)
Add fibre table to EXT filename and update moo_ext structure.
Definition: moo_ext.c:309
cpl_error_code moo_ext_set_single(moo_ext *self, moo_detector_type type, int ntas, moo_ext_single *s)
assign moo_ext_single structure in moo_ext structure
Definition: moo_ext.c:231
cpl_error_code moo_ext_add_single(moo_ext *self, moo_ext_single *s, moo_detector_type type, int ntas)
Add EXT_SINGLE extension to EXT filename and update moo_ext structure.
Definition: moo_ext.c:276
moo_ext_single * moo_ext_load_single(moo_ext *self, moo_detector_type type, int num, unsigned int level)
Load the type part in EXT and return it.
Definition: moo_ext.c:156
cpl_error_code moo_ext_load(moo_ext *self, unsigned int level)
Load all parts in EXT.
Definition: moo_ext.c:126
moo_ext * moo_ext_create(const cpl_frame *frame)
Create a new empty EXT filename.
Definition: moo_ext.c:86
cpl_error_code moo_ext_sum(moo_ext *self, moo_ext *ext)
Sum EXT structure.
Definition: moo_ext.c:514
cpl_table * moo_ext_get_fibre_table(moo_ext *self)
Get the FIBRE TABLE in EXT.
Definition: moo_ext.c:344
cpl_error_code moo_ext_dump(const moo_ext *self, FILE *stream)
Dump structural information of EXT.
Definition: moo_ext.c:441
void moo_ext_save(moo_ext *self, const char *filename)
Save a moo_ext to a FITS file.
Definition: moo_ext.c:406
void moo_ext_delete(moo_ext *self)
Delete a moo_ext.
Definition: moo_ext.c:370
cpl_error_code moo_ext_compute_snr(moo_ext *self, moo_map *wmap, moo_spectral_format *sformat, moo_sky_lines_list *skylines)
Compute SNR for all fibres EXT.
Definition: moo_ext.c:553