38 #include "sinfo_psf_ini_by_cpl.h"
39 #include "sinfo_hidden.h"
45 static void parse_section_frames(psf_config *,
46 cpl_frameset* sof,cpl_frameset** stk,
int* status);
47 static void parse_section_reconstruction(psf_config *);
71 psf_config * sinfo_parse_cpl_input_psf(cpl_frameset* sof,
74 psf_config * cfg =NULL;
81 cfg = sinfo_psf_cfg_create();
82 parse_section_reconstruction (cfg);
83 parse_section_frames (cfg, sof,stk,&status);
86 sinfo_psf_cfg_destroy(cfg);
94 parse_section_frames(psf_config * cfg,
99 cpl_frame* frame = NULL;
103 char spat_res[FILE_NAME_SZ];
104 char lamp_status[FILE_NAME_SZ];
105 char band[FILE_NAME_SZ];
108 sinfo_contains_frames_type(sof,stk,PRO_PSF_CALIBRATOR_STACKED);
109 npsf = cpl_frameset_get_size(*stk);
111 sinfo_contains_frames_type(sof,stk,PRO_STD_NODDING_STACKED);
112 npsf = cpl_frameset_get_size(*stk);
115 npsf = cpl_frameset_get_size(*stk);
117 sinfo_contains_frames_type(sof,stk,PRO_OBJECT_NODDING_STACKED);
118 npsf = cpl_frameset_get_size(*stk);
122 npsf = cpl_frameset_get_size(*stk);
124 sinfo_contains_frames_type(sof,stk,PRO_PUPIL_LAMP_STACKED);
125 npsf = cpl_frameset_get_size(*stk);
128 npsf = cpl_frameset_get_size(*stk);
135 if(NULL != cpl_frameset_find(sof,PRO_COADD_PSF)) {
136 frame = cpl_frameset_find(sof,PRO_COADD_PSF);
137 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
138 }
else if(NULL != cpl_frameset_find(sof,PRO_OBS_PSF)) {
139 frame = cpl_frameset_find(sof,PRO_OBS_PSF);
140 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
141 }
else if(NULL != cpl_frameset_find(sof,PRO_COADD_STD)) {
142 frame = cpl_frameset_find(sof,PRO_COADD_STD);
143 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
144 }
else if(NULL != cpl_frameset_find(sof,PRO_OBS_STD)) {
145 frame = cpl_frameset_find(sof,PRO_OBS_STD);
146 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
147 }
else if(NULL != cpl_frameset_find(sof,PRO_COADD_OBJ)) {
148 frame = cpl_frameset_find(sof,PRO_COADD_OBJ);
149 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
150 }
else if(NULL != cpl_frameset_find(sof,PRO_OBS_OBJ)) {
151 frame = cpl_frameset_find(sof,PRO_OBS_OBJ);
152 strcpy(cfg -> inFrame,cpl_frame_get_filename(frame));
155 PRO_COADD_PSF,PRO_OBS_PSF,
156 PRO_COADD_STD,PRO_OBS_STD,
157 PRO_COADD_OBJ,PRO_OBS_OBJ);
162 strcpy(cfg -> outName, PSF_OUT_FILENAME);
164 frame = cpl_frameset_get_frame(*stk,0);
166 sinfo_get_spatial_res(frame,spat_res);
167 switch(sinfo_frame_is_on(frame))
171 strcpy(lamp_status,
"on");
174 strcpy(lamp_status,
"off");
177 strcpy(lamp_status,
"undefined");
180 strcpy(lamp_status,
"undefined");
185 sinfo_get_band(frame,band);
186 sinfo_msg(
"Spatial resolution: %s lamp status: %s band: %s \n",
187 spat_res, lamp_status, band);
189 sinfo_get_ins_set(band,&ins_set);
196 parse_section_reconstruction(psf_config * cfg)
198 cfg -> nslits = NSLITLETS;
203 sinfo_free_psf(psf_config ** cfg) {
204 sinfo_psf_cfg_destroy (*cfg);
#define sinfo_msg_error(...)
Print an error message.