MOONS Pipeline Reference Manual 0.13.1
moo_map.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_MAP_H
21#define MOO_MAP_H
22
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <cpl.h>
29#include <hdrl.h>
30#include "moo_rbn.h"
31#include "moo_spectral_format.h"
32#include "moo_detector.h"
33/*-----------------------------------------------------------------------------
34 Types
35 -----------------------------------------------------------------------------*/
36typedef struct
37{
38 char *filename;
39 cpl_propertylist *primary_header;
40 cpl_image *data[6];
41 cpl_propertylist *data_header[6];
42 cpl_table *fibre_table;
43 cpl_table *line_table;
44} moo_map;
45
46#define MOO_MAP_CRPIX1 1
47#define MOO_MAP_CRVAL1 1
48#define MOO_MAP_CD1_1 1.
49#define MOO_MAP_CTYPE1 "PIXELS"
50#define MOO_MAP_CRPIX2 1
51#define MOO_MAP_CRVAL2 1
52#define MOO_MAP_CD2_2 1.
53#define MOO_MAP_CTYPE2 "PIXELS"
54#define MOO_MAP_BUNIT "nm"
55
56/*-----------------------------------------------------------------------------
57 Functions prototypes
58 -----------------------------------------------------------------------------*/
59moo_map *moo_map_new(void);
60
61moo_map *moo_map_load(const cpl_frame *mapframe);
62
63cpl_table *moo_map_get_line_table(moo_map *self);
64cpl_error_code moo_map_set_data(moo_map *self,
66 int ntas,
67 cpl_image *data,
68 cpl_propertylist *header);
69cpl_error_code moo_map_set_fibre_table(moo_map *self, cpl_table *fibre_table);
70cpl_error_code moo_map_set_line_table(moo_map *self, cpl_table *line_table);
71void moo_map_delete(moo_map *self);
72void moo_map_update_linetable(moo_map *self, moo_rbn *rbn);
73void moo_map_save(moo_map *self, const char *filename);
74cpl_error_code moo_map_check(moo_map *self, moo_spectral_format *sformat);
75cpl_error_code moo_map_dump(const moo_map *self, FILE *stream);
76#endif
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
cpl_error_code moo_map_check(moo_map *self, moo_spectral_format *sformat)
Save a moo_map to a FITS file.
Definition: moo_map.c:320
cpl_error_code moo_map_dump(const moo_map *self, FILE *stream)
Dump structural information of MAP.
Definition: moo_map.c:428
void moo_map_save(moo_map *self, const char *filename)
Save a moo_map to a FITS file.
Definition: moo_map.c:275
moo_map * moo_map_new(void)
Create a new moo_map.
Definition: moo_map.c:68
cpl_table * moo_map_get_line_table(moo_map *self)
Get the LINE TABLE extension of a map.
Definition: moo_map.c:84
cpl_error_code moo_map_set_data(moo_map *self, moo_detector_type type, int ntas, cpl_image *data, cpl_propertylist *header)
set map data for relevant extension
Definition: moo_map.c:164
void moo_map_delete(moo_map *self)
Delete a moo_map.
Definition: moo_map.c:236