26#ifndef XSH_DATA_INSTRUMENT_H
27#define XSH_DATA_INSTRUMENT_H
42#define XSH_ORDERS_NIR 16
43#define XSH_ORDER_MIN_NIR 11
44#define XSH_ORDER_MAX_NIR 26
46#define XSH_ORDERS_UVB 12
47#define XSH_ORDERS_UVB_QTH 8
48#define XSH_ORDERS_UVB_D2 4
50#define XSH_ORDER_MIN_UVB 13
51#define XSH_ORDER_MAX_UVB 24
52#define XSH_ORDER_MIN_UVB_D2 21
53#define XSH_ORDER_MAX_UVB_D2 XSH_ORDER_MAX_UVB
54#define XSH_ORDER_MIN_UVB_QTH XSH_ORDER_MIN_UVB
55#define XSH_ORDER_MAX_UVB_QTH XSH_ORDER_MIN_UVB_D2 -1
57#define XSH_ORDERS_VIS 15
58#define XSH_ORDER_MIN_VIS 16
59#define XSH_ORDER_MAX_VIS 30
61#define XSH_ORDERS_UNDEFINED 0
63#define XSH_NB_PINHOLE 9
66#define XSH_ARCSEC_NIR 0.2
67#define XSH_ARCSEC_UVB 0.14
68#define XSH_ARCSEC_VIS 0.135
78#define LENGTH_SLIT 11.
79#define BASE_MIN_SLIT -5.5
80#define BASE_MAX_SLIT 5.5
83#define MIN_SLIT_IFU -6.0
84#define MAX_SLIT_IFU 6.0
85#define LENGTH_SLIT_IFU 12
86#define WIDTH_SLIT_IFU 0.6
88#define CHECK_POS_IN_SLIT( pos)\
89 if ( (pos < MIN_SLIT_IFU) || (pos > MAX_SLIT_IFU)){\
90 xsh_error_msg( "Invalid slit position %f : not in [%f,%f]"\
91 ,pos, MIN_SLIT_IFU, MAX_SLIT_IFU);\
95#define IFU_SCALE 0.03925
96#define IFU_MAP_LEFT_C0X (-0.6*IFU_SCALE)
97#define IFU_MAP_LEFT_C1X -1.0
98#define IFU_MAP_LEFT_C2X 0.0
99#define IFU_MAP_CEN_C0X 0.0
100#define IFU_MAP_CEN_C1X 1.0
101#define IFU_MAP_CEN_C2X 0.0
102#define IFU_MAP_RIGHT_C0X (0.6*IFU_SCALE)
103#define IFU_MAP_RIGHT_C1X -1.0
104#define IFU_MAP_RIGHT_C2X 0.0
106#define IFU_MAP_LEFT_C0Y (4.0*IFU_SCALE)
107#define IFU_MAP_LEFT_C1Y -1.0
108#define IFU_MAP_LEFT_C2Y 0.0
109#define IFU_MAP_CEN_C0Y 0.0
110#define IFU_MAP_CEN_C1Y 1.0
111#define IFU_MAP_CEN_C2Y 0.0
112#define IFU_MAP_RIGHT_C0Y (-4.0*IFU_SCALE)
113#define IFU_MAP_RIGHT_C1Y -1.0
114#define IFU_MAP_RIGHT_C2Y 0.0
119#define IFU_LEFT_MIN -0.9
120#define IFU_LEFT_MAX -0.3
121#define IFU_CEN_MIN -0.3
122#define IFU_CEN_MAX 0.3
123#define IFU_RIGHT_MIN 0.3
124#define IFU_RIGHT_MAX 0.9
197#define XSH_NAME_LAMP_MODE_ARM( name, id, ext, instr) \
198 XSH_NAME_PREFIX_LAMP_MODE_ARM( name, "", id, ext, instr)
200#define XSH_NAME_PREFIX_LAMP_MODE_ARM( name, prefix, id, ext, instr)\
202 XSH_ASSURE_NOT_NULL( prefix);\
203 if ( xsh_instrument_get_mode( instr) != XSH_MODE_UNDEFINED){\
204 if (xsh_instrument_get_lamp( instr) != XSH_LAMP_UNDEFINED){\
205 name = xsh_stringcat_any( prefix, id, "_", \
206 xsh_instrument_lamp_tostring( instr)\
207 , "_", xsh_instrument_mode_tostring( instr),"_", \
208 xsh_instrument_arm_tostring( instr), ext, "");\
211 name = xsh_stringcat_any( prefix, id, "_",\
212 xsh_instrument_mode_tostring( instr),"_", \
213 xsh_instrument_arm_tostring( instr), ext, "");\
217 name = xsh_stringcat_any( prefix, id, "_",\
218 xsh_instrument_arm_tostring( instr), ext, "");\
220 XSH_ASSURE_NOT_NULL( name)
238 cpl_frame* spectralformat_frame);
static xsh_instrument * instrument
const char * xsh_instrument_mode_tostring(xsh_instrument *i)
Get the string associated with a mode.
const char * xsh_lamp_tostring(XSH_LAMP lamp)
Get the string associated with a lamp.
cpl_error_code xsh_instrument_nir_corr_if_spectral_format_is_JH(cpl_frameset *calib, xsh_instrument *instr)
cpl_error_code xsh_instrument_nir_corr_if_JH(cpl_frameset *raws, xsh_instrument *instr)
void xsh_instrument_set_mode(xsh_instrument *i, XSH_MODE mode)
Set a mode on instrument structure.
void xsh_instrument_update_from_spectralformat(xsh_instrument *i, cpl_frame *spectralformat_frame)
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
void xsh_instrument_update_lamp(xsh_instrument *i, XSH_LAMP lamp)
void xsh_instrument_set_recipe_id(xsh_instrument *i, const char *recipe_id)
Set the recipe_id into the instrument structure.
double xsh_arcsec_get(xsh_instrument *instrument)
Get the Arc seconds per pixel for this Arm.
XSH_LAMP xsh_instrument_get_lamp(xsh_instrument *i)
Get a lamp on instrument structure.
void xsh_mode_set(xsh_instrument *instrument, XSH_MODE mode)
set the instrument mode as user specifies
int xsh_instrument_get_binx(xsh_instrument *instrument)
void xsh_instrument_set_arm(xsh_instrument *i, XSH_ARM arm)
Set an arm on instrument structure.
XSH_MODE xsh_instrument_get_mode(xsh_instrument *i)
Get a mode on instrument structure.
double xsh_resolution_get(xsh_instrument *instrument, double slit)
Get the resoltion.
const char * xsh_instrument_lamp_tostring(xsh_instrument *i)
Get the string associated with a lamp.
void xsh_instrument_set_biny(xsh_instrument *instrument, const int biny)
int xsh_instrument_nir_is_JH(cpl_frame *frm, xsh_instrument *instr)
const char * xsh_arm_tostring(XSH_ARM arm)
Get the string associated with an arm.
void xsh_instrument_set_binx(xsh_instrument *instrument, const int binx)
XSH_INSTRCONFIG * xsh_instrument_get_config(xsh_instrument *i)
Get the instrument default set of keywords.
xsh_instrument * xsh_instrument_duplicate(xsh_instrument *instrument)
int xsh_instrument_get_biny(xsh_instrument *instrument)
XSH_LAMP xsh_lamp_get(const char *tag)
get the lamp from the frame tag
XSH_ARM xsh_arm_get(const char *tag)
get the arm from the frame tag
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
XSH_MODE xsh_mode_get(const char *tag)
get the mode from the frame tag
void xsh_instrument_set_lamp(xsh_instrument *i, XSH_LAMP lamp)
Set a lamp on instrument structure.
void xsh_instrument_parse_tag(xsh_instrument *inst, const char *tag)
analyse a frame tag to set data in instrument structure
void xsh_instrument_free(xsh_instrument **)
free an instrument structure
xsh_instrument * xsh_instrument_new(void)
create new instrument structure
void xsh_instrument_set_decode_bp(xsh_instrument *i, const int decode_bp)
Set bad pixel code.
const char * xsh_mode_tostring(XSH_MODE mode)
Get the string associated with a mode.