83 cpl_frame* result=NULL;
90 name=cpl_sprintf(
"%s.fits",tag);
124 const int pre_overscan_corr,
const bool flag_neg_and_thresh_pix)
127 cpl_frame *current = NULL;
128 cpl_frame* product = NULL;
130 cpl_image* bias_data = NULL;
131 char result_name[256];
132 char result_tag[256];
140 check(
size = cpl_frameset_get_size( frames) );
143 if ( mbias == (cpl_frame *)-1 ) {
144 bias_data = (cpl_image *)-1 ;
146 else if ( mbias != NULL ) {
150 }
else if ( mbias == NULL ) {
151 bias_data = (cpl_image *)-1 ;
153 for( i=0; i<
size; i++ ) {
155 check( current = cpl_frameset_get_frame( frames, i));
160 pre_overscan_corr,flag_neg_and_thresh_pix));
165 sprintf( result_name,
"%s_QTH_PRE_%d.fits", prefix, i);
167 sprintf( result_name,
"%s_D2_PRE_%d.fits", prefix, i);
169 sprintf( result_name,
"%s_PRE_%d.fits", prefix, i);
172 sprintf( result_name,
"%s_PRE_%d.fits", prefix, i);
174 sprintf( result_tag,
"%s_PRE_%d", prefix, i);
180 check( cpl_frame_set_filename( current,
181 cpl_frame_get_filename( product) ) );
182 check( cpl_frame_set_type( current,
183 cpl_frame_get_type( product)));
184 check( cpl_frame_set_level( current,
185 cpl_frame_get_level( product)));
190 if( cpl_error_get_code() != CPL_ERROR_NONE) {
225 cpl_frame *result = NULL;
226 const char* tag = NULL;
233 check( tag = cpl_frame_get_tag( frame));
237 check( cpl_frame_set_tag( result, tag));
240 if( cpl_error_get_code() != CPL_ERROR_NONE) {
void xsh_bpmap_bitwise_to_flag(cpl_image *bpmap, int flag)
cpl_image * xsh_pre_get_data(xsh_pre *pre)
Get data.
xsh_pre * xsh_pre_load(cpl_frame *frame, xsh_instrument *instr)
Load a xsh_pre structure from a frame.
void xsh_pre_extract(xsh_pre *pre, int xmin, int ymin, int xmax, int ymax)
Create a sub pre image.
void xsh_pre_free(xsh_pre **pre)
Free a xsh_pre structure.
xsh_pre * xsh_pre_create(cpl_frame *raw, cpl_frame *bpmap, cpl_image *bias_data, xsh_instrument *instr, const int pre_overscan_corr, const bool flag_neg_and_thresh_pix)
Create a XSH_PRE from a raw frame.
cpl_frame * xsh_pre_save(const xsh_pre *pre, const char *filename, const char *tag, int temp)
Save PRE on disk.
cpl_frame * xsh_preframe_extract(cpl_frame *frame, int xmin, int ymin, int xmax, int ymax, const char *name, xsh_instrument *instr)
This function create a sub frame from PRE frame. the sub frame is described by a box.
cpl_frame * xsh_bpmap_2pre(cpl_frame *bpmap, const char *prefix, xsh_instrument *inst)
This function transform a BP map from raw to pre format.
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 XSH_ASSURE_NOT_NULL(pointer)
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
XSH_LAMP xsh_instrument_get_lamp(xsh_instrument *i)
Get a lamp on instrument structure.
#define xsh_msg_dbg_medium(...)
void xsh_free_frame(cpl_frame **f)
Deallocate a frame and set the pointer to NULL.
#define QFLAG_NON_LINEAR_PIXEL
#define XSH_FREE(POINTER)