MOONS Pipeline Reference Manual 0.13.2
moo_loc.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_LOC_H
21#define MOO_LOC_H
22
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <cpl.h>
29#include <hdrl.h>
30#include "moo_loc_single.h"
31#include "moo_detector.h"
32/*-----------------------------------------------------------------------------
33 Types
34 -----------------------------------------------------------------------------*/
35typedef struct
36{
37 char *filename;
38 cpl_propertylist *primary_header;
39 moo_loc_single *ri[2];
40 moo_loc_single *yj[2];
41 moo_loc_single *h[2];
42 cpl_table *fibre_table;
43} moo_loc;
44
45#define MOO_LOC_CRPIX1 1
46#define MOO_LOC_CRVAL1 1
47#define MOO_LOC_CD1_1 1.
48#define MOO_LOC_CTYPE1 "PIXELS"
49#define MOO_LOC_CRPIX2 1
50#define MOO_LOC_CRVAL2 1
51#define MOO_LOC_C2_2 1.
52#define MOO_LOC_CTYPE2 "INDEX"
53#define MOO_LOC_BUNIT "pixels"
54/*-----------------------------------------------------------------------------
55 Functions prototypes
56 -----------------------------------------------------------------------------*/
57moo_loc *moo_loc_new(void);
58cpl_error_code moo_loc_set_single(moo_loc *self,
60 int ntas,
61 moo_loc_single *s);
62moo_loc *moo_loc_create(const char *filename);
63
64moo_loc *moo_loc_load(const cpl_frame *locframe);
65moo_loc_single *
66moo_loc_get_single(moo_loc *self, moo_detector_type type, int num);
67
68cpl_error_code moo_loc_add_single(moo_loc *self,
69 moo_loc_single *s,
71 int ntas,
72 int keep_points);
73cpl_error_code moo_loc_add_fibre_table(moo_loc *self, cpl_table *fibre_table);
74
75cpl_table *moo_loc_get_fibre_table(moo_loc *self);
76void moo_loc_delete(moo_loc *self);
77void moo_loc_save(moo_loc *self, const char *filename, int keep_points);
78cpl_error_code moo_loc_dump(const moo_loc *self, FILE *stream);
79#endif
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
moo_loc * moo_loc_create(const char *filename)
Create a new empty LOC filename.
Definition: moo_loc.c:83
moo_loc_single * moo_loc_get_single(moo_loc *self, moo_detector_type type, int num)
Get the type part in LOC and return it.
Definition: moo_loc.c:155
cpl_error_code moo_loc_add_fibre_table(moo_loc *self, cpl_table *fibre_table)
Add fibre table to LOC filename and update moo_loc structure.
Definition: moo_loc.c:271
moo_loc * moo_loc_new(void)
Create a new moo_loc.
Definition: moo_loc.c:66
cpl_error_code moo_loc_set_single(moo_loc *self, moo_detector_type type, int ntas, moo_loc_single *s)
assign moo_loc_single structure in moo_loc structure
Definition: moo_loc.c:188
moo_loc * moo_loc_load(const cpl_frame *locframe)
Load a LOC frame and create a moo_loc.
Definition: moo_loc.c:109
cpl_error_code moo_loc_add_single(moo_loc *self, moo_loc_single *s, moo_detector_type type, int ntas, int keep_points)
Add LOC_SINGLE extension to LOC filename and update moo_loc structure.
Definition: moo_loc.c:234
cpl_error_code moo_loc_dump(const moo_loc *self, FILE *stream)
Dump structural information of LOC.
Definition: moo_loc.c:413
cpl_table * moo_loc_get_fibre_table(moo_loc *self)
Get the FIBRE TABLE in LOC.
Definition: moo_loc.c:306
void moo_loc_save(moo_loc *self, const char *filename, int keep_points)
Save a moo_loc to a FITS file.
Definition: moo_loc.c:372
void moo_loc_delete(moo_loc *self)
Delete a moo_loc.
Definition: moo_loc.c:332