MUSE Pipeline Reference Manual  2.1.1
muse_geo.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2008-2014 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef MUSE_GEO_H
23 #define MUSE_GEO_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_cplwrappers.h"
31 #include "muse_image.h"
32 #include "muse_imagelist.h"
33 
37 /*----------------------------------------------------------------------------*
38  * Defines *
39  *----------------------------------------------------------------------------*/
40 /* This lists some constants that are not really hard instrument properties *
41  * (and hence do not belong into muse_instrument.h) but where set up by *
42  * experience with a few (full) geometry datasets sind spring of 2013. */
43 
44 /* define some standard gap sizes to fall back onto; these numbers *
45  * were derived as the peaks of the histograms of the valid *
46  * (positive) gap sizes of the datasets 2013-06 and 2013-08 */
47 static const double kMuseGeoMiddleGap = 0.04, /* [pix] for central gap */
48  kMuseGeoOuterGap = 0.07; /* [pix] for left and right gaps */
49 /* approximate vertical size of an IFU, guessed from real data */
50 static const double kMuseGeoIFUVGap = 1.5780; /* [mm] */
51 
52 /* maximum slice angle to expect in the creation of the geometry *
53  * table (the real angles should be much smaller, but angles above *
54  * this absolute value will definitely be wrong ) */
55 static const double kMuseGeoSliceMaxAngle = 5.; /* [deg] */
56 
57 /*----------------------------------------------------------------------------*
58  * Special variable types *
59  *----------------------------------------------------------------------------*/
62 
63 /*----------------------------------------------------------------------------*/
70 /*----------------------------------------------------------------------------*/
71 typedef struct {
77  cpl_table *table;
78 
83  double scale;
85 
86 /*----------------------------------------------------------------------------*/
90 /*----------------------------------------------------------------------------*/
91 typedef enum {
95 
98 /*----------------------------------------------------------------------------*
99  * Function prototypes *
100  *----------------------------------------------------------------------------*/
101 cpl_table *muse_geo_table_extract_ifu(const cpl_table *, const unsigned char);
102 double muse_geo_table_ifu_area(const cpl_table *, const unsigned char, double);
103 
104 cpl_vector *muse_geo_lines_get(const cpl_table *);
105 cpl_table *muse_geo_measure_spots(muse_image *, muse_imagelist *, const cpl_table *, const cpl_table *, const cpl_vector *, double, muse_geo_centroid_type);
106 
107 cpl_error_code muse_geo_compute_pinhole_local_distance(cpl_array *, cpl_table *);
108 double muse_geo_compute_pinhole_global_distance(cpl_array *, double, double, double);
109 
110 muse_geo_table *muse_geo_table_new(cpl_size, double);
113 
114 muse_geo_table *muse_geo_determine_initial(cpl_table *, const cpl_table *);
116 cpl_error_code muse_geo_refine_horizontal(muse_geo_table *, cpl_table *);
118 cpl_error_code muse_geo_finalize(muse_geo_table *);
119 cpl_error_code muse_geo_correct_slices(muse_geo_table *, cpl_propertylist *, double);
120 
121 cpl_error_code muse_geo_qc_global(const muse_geo_table *, cpl_propertylist *);
122 
123 #endif /* MUSE_GEO_H */
muse_geo_table * muse_geo_table_duplicate(const muse_geo_table *)
Make a copy of a MUSE geometry table.
Definition: muse_geo.c:1217
Structure definition for a collection of muse_images.
cpl_error_code muse_geo_refine_horizontal(muse_geo_table *, cpl_table *)
Refine relative horizontal positions of adjacent IFUs.
Definition: muse_geo.c:2360
const muse_cpltable_def muse_geo_measurements_def[]
Spots measurement table definition for geometrical calibration.
Definition: muse_geo.c:90
cpl_error_code muse_geo_correct_slices(muse_geo_table *, cpl_propertylist *, double)
Correct deviant slices in an existing MUSE geometry table.
Definition: muse_geo.c:3364
const muse_cpltable_def muse_geo_table_def[]
Geometry table definition.
Definition: muse_geo.c:169
double muse_geo_table_ifu_area(const cpl_table *, const unsigned char, double)
Compute the area of an IFU in the VLT focal plane.
Definition: muse_geo.c:297
double muse_geo_compute_pinhole_global_distance(cpl_array *, double, double, double)
Use vertical pinhole distance measurements of all IFUs to compute the effective global value...
Definition: muse_geo.c:1112
double scale
The VLT focal plane scale factor of the data. output file.
Definition: muse_geo.h:83
muse_geo_table * muse_geo_determine_vertical(const muse_geo_table *)
Use all properties of the central spot and the horizontal properties in each slice to compute the ver...
Definition: muse_geo.c:2737
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:40
muse_geo_table * muse_geo_determine_horizontal(const muse_geo_table *)
Use per-spot and per-wavelength partial geometry to determine the horizontal geometrical properties f...
Definition: muse_geo.c:1929
cpl_error_code muse_geo_compute_pinhole_local_distance(cpl_array *, cpl_table *)
Use spot measurements of one IFU to compute vertical pinhole distance.
Definition: muse_geo.c:1016
cpl_table * muse_geo_measure_spots(muse_image *, muse_imagelist *, const cpl_table *, const cpl_table *, const cpl_vector *, double, muse_geo_centroid_type)
Detect spots on a combined image and measure them on the corresponding series of images.
Definition: muse_geo.c:458
cpl_error_code muse_geo_qc_global(const muse_geo_table *, cpl_propertylist *)
Add the global QC parameters to the geometry table.
Definition: muse_geo.c:3508
cpl_table * table
The geometry table.
Definition: muse_geo.h:77
Structure definition of MUSE geometry table.
Definition: muse_geo.h:71
cpl_error_code muse_geo_finalize(muse_geo_table *)
Create a final version of a geometry table.
Definition: muse_geo.c:3142
muse_geo_centroid_type
Type of centroiding algorithm to use.
Definition: muse_geo.h:91
void muse_geo_table_delete(muse_geo_table *)
Deallocate memory associated to a geometry table object.
Definition: muse_geo.c:1237
muse_geo_table * muse_geo_table_new(cpl_size, double)
Create a new MUSE geometry table.
Definition: muse_geo.c:1196
cpl_table * muse_geo_table_extract_ifu(const cpl_table *, const unsigned char)
Extract the part of a geometry table dealing with a given IFU.
Definition: muse_geo.c:235
Definition of a cpl table structure.
cpl_vector * muse_geo_lines_get(const cpl_table *)
Select lines suitable for geometrical calibration from a line list.
Definition: muse_geo.c:354
muse_geo_table * muse_geo_determine_initial(cpl_table *, const cpl_table *)
Use spot measurements to compute initial geometrical properties.
Definition: muse_geo.c:1313