79#define RECIPE_ID "xsh_linear"
80#define RECIPE_AUTHOR "L.Guglielmi,R.Haigron,P.Goldoni,F.Royer"
81#define RECIPE_CONTACT "laurent.guglielmi@apc.univ-paris7.fr"
92static int create(cpl_plugin *);
93static int exec(cpl_plugin *);
94static int destroy(cpl_plugin *);
97static void xsh_linear(cpl_parameterlist *, cpl_frameset *);
98static void xsh_gain(cpl_parameterlist* parameters,
99 cpl_frameset* frameset,
108 "Create the linearity bad pixel mask";
111 "This recipe creates a bad pixel mask from several (at least 3x3)\n\
112 LINEARITY frames in increasing exposure times\n\
114 Raw Frames (Tag = LINEARITY_arm)\n\
115Prepare PRE structures\n\
116Group frames by exposure time\n\
117Remove cosmic rays in each group and create\n\
119Finally compute the linearity bad pixel mask. Linearity is obtained by\n\
120 a polynomial fit (degree 3)\n\
122 Bad Pixel Map, PRO.CATG = BADPIXEL_MAP_arm\n" ;
139 cpl_recipe *recipe = NULL;
140 cpl_plugin *plugin = NULL;
142 recipe = cpl_calloc(1,
sizeof(*recipe));
143 if ( recipe == NULL ){
147 plugin = &recipe->interface ;
149 cpl_plugin_init(plugin,
152 CPL_PLUGIN_TYPE_RECIPE,
163 cpl_pluginlist_append(list, plugin);
165 return (cpl_error_get_code() != CPL_ERROR_NONE);
181 cpl_recipe *recipe = NULL;
182 cpl_parameter* p =NULL;
188 assure( plugin != NULL, CPL_ERROR_NULL_INPUT,
"Null plugin");
191 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
192 CPL_ERROR_TYPE_MISMATCH,
193 "Plugin is not a recipe");
195 recipe = (cpl_recipe *)plugin;
198 recipe->parameters = cpl_parameterlist_new();
199 assure( recipe->parameters != NULL,
200 CPL_ERROR_ILLEGAL_OUTPUT,
201 "Memory allocation failed!");
209 p = cpl_parameter_new_value(
"xsh.xsh_linear.crh_clip_kappa",
211 "multiple of sigma in sigma clipping",
212 "xsh.xsh_linear",5.0);
214 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"crh_clip_kappa");
215 cpl_parameterlist_append(recipe->parameters,p);
218 p = cpl_parameter_new_value(
"xsh.xsh_linear.crh_clip_niter",
219 CPL_TYPE_INT,
"number of iterations in sigma clipping",
"xsh.xsh_linear",2);
220 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"crh_clip_niter");
221 cpl_parameterlist_append(recipe->parameters,p);
224 p = cpl_parameter_new_value(
"xsh.xsh_linear.crh_clip_frac",
225 CPL_TYPE_DOUBLE,
"minimal fractions of points accepted \
226 / total in sigma clipping",
227 "xsh.xsh_linear",0.7);
228 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"crh_clip_frac");
229 cpl_parameterlist_append(recipe->parameters,p);
232 p = cpl_parameter_new_value(
"xsh.xsh_linear.lin_clip_kappa",
234 "multiple of sigma in sigma clipping",
235 "xsh.xsh_linear",10.0);
236 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"lin_clip_kappa");
237 cpl_parameterlist_append(recipe->parameters,p);
239 p = cpl_parameter_new_value(
"xsh.xsh_linear.lin_clip_niter",
240 CPL_TYPE_INT,
"number of iterations in sigma clipping",
"xsh.xsh_linear",2);
241 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"lin_clip_niter");
242 cpl_parameterlist_append(recipe->parameters,p);
244 p = cpl_parameter_new_value(
"xsh.xsh_linear.lin_clip_frac",
245 CPL_TYPE_DOUBLE,
"Minimum fraction of bad pixels allowed",
246 "xsh.xsh_linear",0.7);
247 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"lin_clip_frac");
248 cpl_parameterlist_append(recipe->parameters,p);
250 p = cpl_parameter_new_value(
"xsh.xsh_linear.lin_clip_diff",
251 CPL_TYPE_DOUBLE,
"Minimum relative change in sigma for sigma clipping",
252 "xsh.xsh_linear",0.7);
253 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"lin_clip_diff");
254 cpl_parameterlist_append(recipe->parameters,p);
257 p = cpl_parameter_new_value(
"xsh.xsh_linear.exp_toler",
258 CPL_TYPE_DOUBLE,
"Tolerance for equal exposures times in seconds",
259 "xsh.xsh_linear", 0.001);
260 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"exp_toler");
261 cpl_parameterlist_append(recipe->parameters,p);
266 p = cpl_parameter_new_value(
"xsh.xsh_linear.compute_gain",
269 "xsh.xsh_linear",CPL_FALSE);
272 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"compute_gain");
273 cpl_parameterlist_append(recipe->parameters,p);
276 p = cpl_parameter_new_value(
"xsh.xsh_linear.llx",
277 CPL_TYPE_INT,
"Detector lower left x pix",
278 "xsh.xsh_linear", 1);
279 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"llx");
280 cpl_parameterlist_append(recipe->parameters,p);
283 p = cpl_parameter_new_value(
"xsh.xsh_linear.lly",
284 CPL_TYPE_INT,
"Detector lower left y pix",
285 "xsh.xsh_linear", 1);
286 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"lly");
287 cpl_parameterlist_append(recipe->parameters,p);
291 p = cpl_parameter_new_value(
"xsh.xsh_linear.urx",
292 CPL_TYPE_INT,
"Detector upper right x pix",
293 "xsh.xsh_linear", 2148);
294 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"urx");
295 cpl_parameterlist_append(recipe->parameters,p);
299 p = cpl_parameter_new_value(
"xsh.xsh_linear.ury",
300 CPL_TYPE_INT,
"Detector upper right y pix",
301 "xsh.xsh_linear", 3000);
302 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"ury");
303 cpl_parameterlist_append(recipe->parameters,p);
307 p = cpl_parameter_new_value(
"xsh.xsh_linear.kappa",
308 CPL_TYPE_DOUBLE,
"Value in kappa-sigma clip",
309 "xsh.xsh_linear", 3.);
310 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"kappa");
311 cpl_parameterlist_append(recipe->parameters,p);
316 p = cpl_parameter_new_value(
"xsh.xsh_linear.nclip",
317 CPL_TYPE_INT,
"Number of kappa-sigma clip iterations",
318 "xsh.xsh_linear", 5);
319 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"nclip");
320 cpl_parameterlist_append(recipe->parameters,p);
324 p = cpl_parameter_new_value(
"xsh.xsh_linear.shiftx",
325 CPL_TYPE_INT,
"Pixel X shift applied in autocorrelation. "
327 "xsh.xsh_linear", 26);
328 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"shiftx");
329 cpl_parameterlist_append(recipe->parameters,p);
333 p = cpl_parameter_new_value(
"xsh.xsh_linear.shifty",
334 CPL_TYPE_INT,
"Pixel Y shift applied in autocorrelation. "
336 "xsh.xsh_linear", 26);
337 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"shifty");
338 cpl_parameterlist_append(recipe->parameters,p);
343 p = cpl_parameter_new_value(
"xsh.xsh_linear.autocorr",
344 CPL_TYPE_BOOL,
"Compute autocor?",
345 "xsh.xsh_linear",CPL_FALSE);
346 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,
"autocorr");
347 cpl_parameterlist_append(recipe->parameters,p);
356 if ( cpl_error_get_code() != CPL_ERROR_NONE ){
373static int exec(cpl_plugin *plugin) {
374 cpl_recipe *recipe = NULL;
377 assure( plugin != NULL, CPL_ERROR_NULL_INPUT,
"Null plugin" );
380 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
381 CPL_ERROR_TYPE_MISMATCH,
"Plugin is not a recipe");
383 recipe = (cpl_recipe *)plugin;
386 xsh_linear(recipe->parameters, recipe->frames);
389 if ( cpl_error_get_code() != CPL_ERROR_NONE ) {
408 cpl_recipe *recipe = NULL;
411 assure( plugin != NULL, CPL_ERROR_NULL_INPUT,
"Null plugin" );
414 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
415 CPL_ERROR_TYPE_MISMATCH,
"Plugin is not a recipe");
417 recipe = (cpl_recipe *)plugin;
422 if (cpl_error_get_code() != CPL_ERROR_NONE)
441static void xsh_linear(cpl_parameterlist* parameters, cpl_frameset* frameset){
444 int recipe_tags_size = 1;
446 cpl_parameter* param = NULL;
447 cpl_frameset* raws = NULL;
448 cpl_frameset* calib = NULL;
449 cpl_frame* bpmap = NULL;
454 0.0, 0, 0.0, 0.0, 0.3
459 0.0, 0, 0.0, 0.0, 0.3
467 cpl_frameset ** rawGrp = NULL;
468 cpl_frameset ** pgrp = NULL;
469 cpl_frameset * medSet = NULL;
470 cpl_frameset * nirSet = NULL ;
471 cpl_imagelist * crh_list=NULL;
473 char *final_prefix = NULL ;
474 int gain_switch=
false;
475 cpl_image* crh_ima=NULL;
478 int i = 0, minfr = 999999 ;
482 cpl_frame *medFrame =NULL;
485 int pre_overscan_corr=0;
489 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.crh_clip_kappa");
492 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.crh_clip_niter");
495 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.crh_clip_frac");
499 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.lin_clip_kappa");
500 lin_clipping.
sigma = cpl_parameter_get_double(param);
502 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.lin_clip_niter");
503 lin_clipping.
niter = cpl_parameter_get_int(param);
505 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.lin_clip_frac");
506 lin_clipping.
frac = cpl_parameter_get_double(param);
508 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.lin_clip_diff");
509 lin_clipping.
diff = cpl_parameter_get_double(param);
512 param = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.exp_toler");
513 exp_toler = cpl_parameter_get_double(param);
522 recipe_tags, recipe_tags_size,
526 check(param=cpl_parameterlist_find(parameters,
527 "xsh.xsh_linear.compute_gain"));
528 check(gain_switch = cpl_parameter_get_bool(param));
541 xsh_msg(
"Calling the xsh_prepare function");
544 pre_overscan_corr,CPL_TRUE),
545 "Error with linear");
551 assure( final_prefix != NULL, cpl_error_get_code(),
552 "Cant allocate memory for final prefix" ) ;
554 nRawFrames = cpl_frameset_get_size( raws ) ;
555 xsh_msg(
"Found %d LINEARITY Raw files", nRawFrames ) ;
558 xsh_msg(
"No Bad Pixel Map" ) ;
560 xsh_msg(
"Found BadPixel Map Frame: %s",
561 cpl_frame_get_filename( bpmap ) ) ;
564 xsh_msg(
"Calling xsh_linear_group_by_exptime" ) ;
565 xsh_msg(
"exp_toler: %lf", exp_toler ) ;
571 rawGrp = cpl_malloc( nRawFrames*
sizeof( cpl_frameset *) ) ;
576 xsh_msg(
"Nb of groups: %d", nbLinGroups ) ;
579 assure( nbLinGroups >= 3, CPL_ERROR_ILLEGAL_INPUT,
580 "Not enough EXPTIME Groups, %d < 3", nbLinGroups ) ;
583 for( i = 0 ; i<nbLinGroups ; i++, pgrp++ ) {
584 int nfr = cpl_frameset_get_size( *pgrp ) ;
585 if ( nfr < minfr ) minfr = nfr ;
586 xsh_msg(
"Frameset #%d - %d frames", i, nfr ) ;
594 xsh_msg(
"Calling xsh_remove_crh_multiple" ) ;
595 xsh_msg(
" CRH parameters: Sigma %lf, Niteration %d, Fraction %lf",
598 medSet = cpl_frameset_new() ;
599 crh_list=cpl_imagelist_new();
601 for( i=0, pgrp = rawGrp ; i<nbLinGroups ; i++, pgrp++ ) {
603 sprintf( str,
"%02d", i ) ;
606 str,
"", (
void*)NULL ) ;
609 str,
".fits", (
void*)NULL ) ;
615 &crh_list,&crh_ima ),
616 "Error in xsh_remove_crh" ) ;
618 cpl_frameset_insert( medSet, cpl_frame_duplicate(medFrame) ) ;
621 cpl_imagelist_save(crh_list,
"crh_list.fits",CPL_BPP_IEEE_FLOAT,
622 NULL,CPL_IO_DEFAULT);
624 cpl_image_save (crh_ima,crh_name, CPL_BPP_32_SIGNED,
625 NULL, CPL_IO_DEFAULT);
627 cpl_free(crh_name ) ;
642 assure( nirSet != NULL, cpl_error_get_code(),
643 "Error in subtract" ) ;
652 assure( bpmap != NULL, cpl_error_get_code(),
653 "Error in compute_linearity" ) ;
657 xsh_msg(
"Bad Pixel Map created" ) ;
658 xsh_msg(
"Saving final product" ) ;
678 cpl_free( final_prefix ) ;
696 cpl_frameset* frameset,
700 cpl_frameset* set_flats=NULL;
701 cpl_frameset* set_biases=NULL;
702 cpl_table* gain_tbl=NULL;
703 cpl_parameter* p=NULL;
704 cpl_imagelist* diff_imlist=NULL;
705 cpl_imagelist* autocorr_imlist=NULL;
706 cpl_propertylist* qclist=NULL;
707 cpl_imagelist* iml_flats=NULL;
708 cpl_imagelist* iml_biases=NULL;
711 cpl_frame* result=NULL;
738 const char* tag_on=NULL;
739 const char* tag_off=NULL;
740 cpl_vector* exptimes=NULL;
750 const char* name=NULL;
754 const char* name_o=
"gain_table.fits";
755 const char* name_diff_o=
"diff.fits";
756 const char* name_autocorr_o=
"autocorr.fits";
758 const char* file=NULL;
765 cpl_propertylist* plist=NULL;
774 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.llx"));
775 check(
llx = cpl_parameter_get_int(p));
777 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.lly"));
778 check(
lly = cpl_parameter_get_int(p));
780 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.urx"));
781 check(
urx = cpl_parameter_get_int(p));
783 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.ury"));
784 check(
ury = cpl_parameter_get_int(p));
786 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.kappa"));
789 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.nclip"));
790 check(nclip = cpl_parameter_get_int(p));
792 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.shiftx"));
793 check(shiftx = cpl_parameter_get_int(p));
795 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.shifty"));
796 check(shifty = cpl_parameter_get_int(p));
798 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.autocorr"));
799 check(auto_corr = cpl_parameter_get_bool(p));
801 check(p = cpl_parameterlist_find(parameters,
"xsh.xsh_linear.exp_toler"));
815 tag_on =
"LINEARITY_UVB";
825 tag_on =
"LINEARITY_VIS";
835 tag_on =
"LINEARITY_NIR_ON";
836 tag_off=
"LINEARITY_NIR_OFF";
848 xsh_msg(
"tag_on=%s tag_off=%s",tag_on,tag_off);
853 nflats=cpl_frameset_get_size(set_flats);
860 check(nbiases=cpl_frameset_get_size(set_biases));
861 check(name=cpl_frame_get_filename(cpl_frameset_get_first(set_flats)));
862 check(plist=cpl_propertylist_load(name,0));
868 if(mjd_obs> 53095.4) {
875 for(ext=ext_min;ext<ext_max;ext++) {
876 xsh_msg(
"Processing extention %d",ext);
879 iml_flats=cpl_imagelist_new();
880 for(i=0;i<nflats;i++) {
881 check(frm=cpl_frameset_get_frame(set_flats,i));
882 check(file=cpl_frame_get_filename(frm));
883 check(img=cpl_image_load(file,CPL_TYPE_FLOAT,0,ext));
884 check(cpl_imagelist_set(iml_flats,cpl_image_duplicate(img),i));
890 iml_biases=cpl_imagelist_new();
891 for(i=0;i<nbiases;i++) {
892 check(frm=cpl_frameset_get_frame(set_biases,i));
893 check(file=cpl_frame_get_filename(frm));
894 check(img=cpl_image_load(file,CPL_TYPE_FLOAT,0,ext));
895 check(cpl_imagelist_set(iml_biases,cpl_image_duplicate(img),i));
900 check(qclist=cpl_propertylist_new());
904 sx=cpl_image_get_size_x(cpl_imagelist_get(iml_flats,0));
905 sy=cpl_image_get_size_y(cpl_imagelist_get(iml_flats,0));
915 shiftx,shifty,qclist,
mode,
916 &diff_imlist,&autocorr_imlist));
921 check(cpl_table_save(gain_tbl,qclist,NULL,name_o,CPL_IO_DEFAULT));
923 cpl_imagelist_save(diff_imlist,name_diff_o,CPL_BPP_IEEE_FLOAT,
924 NULL,CPL_IO_DEFAULT);
926 cpl_imagelist_save(autocorr_imlist,name_autocorr_o,
927 CPL_BPP_IEEE_FLOAT,NULL,CPL_IO_DEFAULT);
931 check(cpl_table_save(gain_tbl,qclist,NULL,name_o,CPL_IO_EXTEND));
934 cpl_imagelist_save(diff_imlist,name_diff_o,CPL_BPP_IEEE_FLOAT,
937 cpl_imagelist_save(autocorr_imlist,name_autocorr_o,
938 CPL_BPP_IEEE_FLOAT,NULL,CPL_IO_EXTEND);
951 check(result=cpl_frame_new());
954 cpl_frame_set_filename(result,name_o);
955 cpl_frame_set_tag(result,pro_catg);
956 cpl_frame_set_type(result,CPL_FRAME_TYPE_TABLE);
957 cpl_frame_set_group(result, CPL_FRAME_GROUP_PRODUCT);
958 cpl_frame_set_level(result, CPL_FRAME_LEVEL_FINAL);
970 cpl_free(exptimes); exptimes=NULL;
993 cpl_vector* times=NULL;
996 cpl_propertylist* plist=NULL;
1000 n=cpl_frameset_get_size(set);
1001 times=cpl_vector_new(
n);
1004 check(frm=cpl_frameset_get_frame(set,i));
1005 check(plist=cpl_propertylist_load(cpl_frame_get_filename(frm),0));
static xsh_instrument * instrument
static xsh_clipping_param crh_clipping
cpl_frame * xsh_compute_linearity(cpl_frameset *medSet, xsh_instrument *instrument, xsh_clipping_param *lin_clipping, const int decode_bp)
int xsh_linear_group_by_exptime(cpl_frameset *raws, xsh_instrument *instrument, double exp_toler, cpl_frameset **groupSet)
cpl_frameset * xsh_subtract_on_off(cpl_frameset *set, xsh_instrument *instrument)
void xsh_prepare(cpl_frameset *frames, cpl_frame *bpmap, cpl_frame *mbias, const char *prefix, xsh_instrument *instr, const int pre_overscan_corr, const bool flag_neg_and_thresh_pix)
This function transform RAW frames dataset in PRE frames dataset attaching the default bad pixel map ...
#define assure(CONDITION, ERROR_CODE,...)
#define xsh_error_dump(level)
#define check_msg(COMMAND,...)
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
static char xsh_linear_description_short[]
static int destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static cpl_vector * xsh_get_exptimes(cpl_frameset *set)
get input frames exposure times
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static void xsh_gain(cpl_parameterlist *parameters, cpl_frameset *frameset, xsh_instrument *instr)
computes detector's gain
static int create(cpl_plugin *)
Setup the recipe options.
static char xsh_linear_description[]
static void xsh_linear(cpl_parameterlist *, cpl_frameset *)
Interpret the command line options and execute the data processing.
static int exec(cpl_plugin *)
Execute the plugin instance given by the interface.
#define xsh_msg_warning(...)
Print an warning message.
#define xsh_msg_error(...)
Print an error message.
#define xsh_msg(...)
Print a message on info level.
double xsh_pfits_get_exptime(const cpl_propertylist *plist)
find out the exposure time
double xsh_pfits_get_mjdobs(const cpl_propertylist *plist)
Find out the modified julian observation date.
cpl_frame * xsh_remove_crh_multiple(cpl_frameset *rawFrames, const char *name, xsh_stack_param *stack_param, xsh_clipping_param *crh_clipping, xsh_instrument *inst, cpl_imagelist **, cpl_image **, const int save_tmp)
void xsh_free_parameterlist(cpl_parameterlist **p)
Deallocate a parameter list and set the pointer to NULL.
void xsh_free_image(cpl_image **i)
Deallocate an image and set the pointer to NULL.
void xsh_free_frame(cpl_frame **f)
Deallocate a frame and set the pointer to NULL.
void xsh_free_frameset(cpl_frameset **f)
Deallocate a frame set and set the pointer to NULL.
const char * xsh_get_license(void)
Get the pipeline copyright and license.
char * xsh_stringcat_any(const char *s,...)
Concatenate an arbitrary number of strings.
void xsh_init(void)
Reset library state.
cpl_error_code xsh_begin(cpl_frameset *frames, const cpl_parameterlist *parameters, xsh_instrument **instrument, cpl_frameset **raws, cpl_frameset **calib, const char *tag_list[], int tag_list_size, const char *recipe_id, unsigned int binary_version, const char *short_descr)
Recipe initialization.
void xsh_free_table(cpl_table **t)
Deallocate a table and set the pointer to NULL.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
cpl_error_code xsh_end(const char *recipe_id, cpl_frameset *frames, cpl_parameterlist *parameters)
Recipe termination.
void xsh_free_imagelist(cpl_imagelist **i)
Deallocate an image list and set the pointer to NULL.
void xsh_add_temporary_file(const char *name)
Add temporary file to temprary files list.
cpl_table * xsh_detmon_gain(const cpl_imagelist *imlist_on, const cpl_imagelist *imlist_off, const cpl_vector *exptimes, const cpl_vector *ndit, double tolerance, int llx, int lly, int urx, int ury, double kappa, int nclip, int xshift, int yshift, cpl_propertylist *qclist, unsigned mode, cpl_imagelist **diff_imlist, cpl_imagelist **autocorr_imlist)
Gain computation.
#define IRPLIB_GAIN_WITH_RESCALE
#define IRPLIB_GAIN_NO_COLLAPSE
#define IRPLIB_GAIN_COLLAPSE
#define IRPLIB_GAIN_WITH_AUTOCORR
cpl_frame * xsh_find_bpmap(cpl_frameset *set)
find the bad pixel map in a set of files
void xsh_add_product_bpmap(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
void xsh_add_product_table(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
Save Table product (input frame has several extensions, 1 table per extension)
cpl_frameset * xsh_frameset_extract(const cpl_frameset *frames, const char *tag)
Extract frames with given tag from frameset.
#define XSH_GET_TAG_FROM_ARM(TAG, instr)
cpl_error_code xsh_parameters_decode_bp(const char *recipe_id, cpl_parameterlist *plist, const int ival)
void xsh_parameters_generic(const char *recipe_id, cpl_parameterlist *plist)