73 cpl_frame * res_frame = NULL ;
74 const char * fname = NULL ;
75 cpl_propertylist *list_B = NULL;
76 const char * name_B = NULL;
77 double ra_off_B, dec_off_B;
78 double ra_cumoff_B, dec_cumoff_B;
81 fname = cpl_frame_get_filename( frame);
82 name_B = cpl_frame_get_filename( B_frame);
84 check( list_B = cpl_propertylist_load( name_B, 0));
126 cpl_frameset* result = NULL;
127 const char* arm_name = NULL;
134 check(
size = cpl_frameset_get_size( raws_ord_set));
135 result = cpl_frameset_new();
137 for( i = 0; i<
size; i += 2) {
138 char frame_name[256];
139 cpl_frame * a = NULL, * b = NULL, *a_b = NULL, *b_a = NULL;
141 check( a = cpl_frameset_get_frame( raws_ord_set, i)) ;
142 check( b = cpl_frameset_get_frame( raws_ord_set, i+1));
143 sprintf( frame_name,
"SUBTRACTED_NOD_AB_%d_%s.fits", i/2, arm_name);
147 check(cpl_frameset_insert( result, a_b)) ;
149 if (mode_fast != CPL_TRUE){
151 sprintf( frame_name,
"SUBTRACTED_NOD_BA_%d_%s.fits", i/2, arm_name);
154 check(cpl_frameset_insert( result, b_a)) ;
159 if ( cpl_error_get_code() != CPL_ERROR_NONE){
static xsh_instrument * instrument
xsh_pre * xsh_pre_load(cpl_frame *frame, xsh_instrument *instr)
Load a xsh_pre structure from a frame.
cpl_frame * xsh_pre_frame_subtract(cpl_frame *one, cpl_frame *two, const char *filename, xsh_instrument *instr, const int clean_tmp)
Subtract 2 frames (in XSH_PRE format) Just loads the 2 frames, subtract (xsh_pre_subtract) and save r...
void xsh_pre_free(xsh_pre **pre)
Free a xsh_pre structure.
cpl_frame * xsh_pre_save(const xsh_pre *pre, const char *filename, const char *tag, int temp)
Save PRE on disk.
#define XSH_ASSURE_NOT_NULL(pointer)
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
void xsh_pfits_set_b_ra_reloffset(cpl_propertylist *plist, double value)
double xsh_pfits_get_ra_cumoffset(const cpl_propertylist *plist)
void xsh_pfits_set_b_dec_cumoffset(cpl_propertylist *plist, double value)
void xsh_pfits_set_b_dec_reloffset(cpl_propertylist *plist, double value)
double xsh_pfits_get_dec_cumoffset(const cpl_propertylist *plist)
double xsh_pfits_get_dec_reloffset(const cpl_propertylist *plist)
void xsh_pfits_set_b_ra_cumoffset(cpl_propertylist *plist, double value)
double xsh_pfits_get_ra_reloffset(const cpl_propertylist *plist)
static void save_pre_frame(cpl_frame *frame, xsh_instrument *instrument, cpl_frame *B_frame)
cpl_frameset * xsh_subtract_sky_nod(cpl_frameset *raws_ord_set, xsh_instrument *instrument, int mode_fast)
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.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
void xsh_add_temporary_file(const char *name)
Add temporary file to temprary files list.
cpl_propertylist * data_header