ERIS Pipeline Reference Manual 1.8.15
eris_ifu_sdp.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) 2015 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 ERIS_IFU_SDP_H
23#define ERIS_IFU_SDP_H
24
25/*----------------------------------------------------------------------------*
26 * Includes *
27 *----------------------------------------------------------------------------*/
28#include <cpl.h>
29#include <eris_ifu_sdp.h>
30#include <eris_ifu_resample.h>
31/*
32#include <eris_ifu_processing.h>
33#include <eris_ifu_datacube.h>
34*/
35
36/*----------------------------------------------------------------------------*
37 * Defines *
38 *----------------------------------------------------------------------------*/
39
40/* IDP unit strings */
41static const char kMuseIdpFluxDataUnit[] = "10**(-20)erg.s**(-1).cm**(-2).angstrom**(-1)";
42static const char kMuseIdpFluxStatUnit[] = "10**(-40)erg**2.s**(-2).cm**(-4).angstrom**(-2)";
43static const char kMuseIdpWavelengthUnit[] = "angstrom";
44static const char kErisIdpFluxDataUnit[] = "erg.s**(-1).cm**(-2).angstrom**(-1)";
45
46/*----------------------------------------------------------------------------*
47 * Data structures *
48 *----------------------------------------------------------------------------*/
49/* JIRA-10635 comments/TODO
50 *
51 * 1. The primary header contains the WCS keywords, please remove them since the PHU doesn't contain data
52
532. Missing keywords:
54PRODCATG = 'SCIENCE.CUBE.IFS' in the primary header
55mandatory keyword OBSTECH is undefined.
56mandatory keyword MJD-END is undefined.
57mandatory keyword PROCSOFT is undefined.
58mandatory keyword REFERENC is undefined.
59mandatory keyword PROG_ID is undefined.
60mandatory keyword FLUXCAL is undefined.
61mandatory keyword PROV1 is undefined.
62mandatory keyword ASSON1 is undefined, the white light image needs to be provided
63mandatory keyword TEXPTIME is undefined.
64mandatory keyword NCOMBINE is undefined.
65mandatory keyword WAVELMIN is undefined.
66mandatory keyword WAVELMAX is undefined.
67mandatory keyword SPEC_RES is undefined.
68mandatory keyword SPECSYS is undefined.
69mandatory keyword OBID1 is undefined.
70mandatory keyword PIXNOISE is undefined.
71mandatory keyword SKY_RES is undefined.
72mandatory keyword ABMAGLIM is undefined.
73mandatory keyword ext:HDUCLASS is undefined in HDU0.
74mandatory keyword ext:HDUCLASS is undefined in HDU1.
75mandatory keyword ext:HDUCLASS is undefined in HDU2.
76mandatory keyword ext:HDUDOC is undefined in HDU0.
77mandatory keyword ext:HDUDOC is undefined in HDU1.
78mandatory keyword ext:HDUDOC is undefined in HDU2.
79mandatory keyword ext:HDUVERS is undefined in HDU0.
80mandatory keyword ext:HDUVERS is undefined in HDU1.
81mandatory keyword ext:HDUVERS is undefined in HDU2.
82mandatory keyword ext:HDUCLAS1 is undefined in HDU0.
83mandatory keyword ext:HDUCLAS1 is undefined in HDU1.
84mandatory keyword ext:HDUCLAS1 is undefined in HDU2.
85
863. The keywords CDELT are not supported by the SDP standard. They are in every extension.
87
884. ORIGFILE must be recorded in the primary header, and not duplicated in any extension.
89
905. CUNIT3 = 'MICRON ' has a wrong value, in each extension, to be replaced with 'um'
91
926. CTYPE3 = 'WAVELENGTH' has a wrong value, in each extension, to be replaced with 'WAVE'
93 *
94 *
95 */
96// XXX: Should this just be implemented as a property list?
97typedef struct eris_ifu_sdp_properties eris_ifu_sdp_properties;
98
99struct eris_ifu_sdp_properties {
100 unsigned int ncombine;
101 double exptime;
102 double texptime;
103 double mjd_end;
104 double fovcenter[2];
105 double wlenrange[2]; /* WLENMIN/MAX ? */
106 double wlerror;
107 double specres;
108 double skyrerr;
109 double pixnoise;
110 double abmaglimit;
111 double skyres;
112 cpl_array *obid;
113 cpl_array *progid;
114 cpl_propertylist *prov; /* PROV1? */
115 cpl_array *asson;
116 cpl_array *assoc; /* deprecated */
117 cpl_array *assom; /* deprecated */
118 cpl_boolean fluxcal;
119 cpl_size nobj;
120 const char *prodcatg;
121 const char *procsoft;
122 const char *obstech;
123 const char *referenc;
124 const char *specsys;
125};
126
127/*----------------------------------------------------------------------------*
128 * Function prototypes *
129 *----------------------------------------------------------------------------*/
130
131eris_ifu_sdp_properties *eris_ifu_sdp_properties_new(void);
132void eris_ifu_sdp_properties_delete(eris_ifu_sdp_properties *aProperties);
133eris_ifu_sdp_properties *eris_ifu_sdp_properties_collect(hdrl_resample_result *aCube,
134 cpl_frameset* set, const cpl_parameterlist* parlist, const char* recipe_name);
135cpl_error_code eris_ifu_sdp_properties_update(cpl_propertylist *aHeader,
136 const eris_ifu_sdp_properties *aProperties);
137
138/*
139eris_ifu_idp_properties *eris_ifu_idp_properties_collect(eris_ifu_processing *aProcessing,
140 const eris_ifu_datacube *aCube,
141 const char *aTag);
142cpl_error_code eris_ifu_idp_properties_update(cpl_propertylist *aHeader,
143 const eris_ifu_idp_properties *aProperties);
144cpl_error_code eris_ifu_idp_properties_update_fov(eris_ifu_image *fov);
145*/
146
147
148#endif /* ERIS_IFU_SDP_H */
eris_ifu_sdp_properties * eris_ifu_sdp_properties_new(void)
Allocate and initialize new SDP properties structure.
Definition: eris_ifu_sdp.c:791
eris_ifu_sdp_properties * eris_ifu_sdp_properties_collect(hdrl_resample_result *aCube, cpl_frameset *set, const cpl_parameterlist *parlist, const char *recipe_name)
Collect all SDP metadata from cube, frameset, and parameters.
void eris_ifu_sdp_properties_delete(eris_ifu_sdp_properties *aProperties)
Free SDP properties structure and all contained data.
Definition: eris_ifu_sdp.c:813
cpl_error_code eris_ifu_sdp_properties_update(cpl_propertylist *aHeader, const eris_ifu_sdp_properties *aProperties)
Update FITS header with ESO Science Data Product keywords.