69 if ( fname == NULL ) {
73 fout = fopen( fname,
"w" ) ;
77 fprintf( fout,
"Rec List. Nb of orders: %d\n", list->
size ) ;
78 for( i = 0 ; i<list->
size ; i++ ) {
79 fprintf( fout,
" Entry %2d: Order %d, Nlambda: %d, Nslit: %d\n",
85 if ( fname != NULL && fout != NULL ) fclose( fout ) ;
113 if ( instr->
config != NULL )
130 if ( cpl_error_get_code() != CPL_ERROR_NONE) {
170 if ( cpl_error_get_code() != CPL_ERROR_NONE) {
192 int nlambda,
int ns )
202 XSH_CMP_INT( nlambda, >, 0,
"Check size in lambda",);
204 prec = &list->
list[idx] ;
211 prec->
order = absorder;
230 int nb_orders,
order ;
235 nb_orders = old->
size ;
237 int absorder, nslit, nlambda ;
238 float * fold, * fnew ;
240 double * dold, * dnew ;
251 memcpy( fnew, fold, nlambda*nslit*
sizeof(
float ) ) ;
255 memcpy( fnew, fold, nlambda*nslit*
sizeof(
float ) ) ;
259 memcpy( inew, iold, nlambda*nslit*
sizeof(
int ) ) ;
263 memcpy( fnew, fold, nslit*
sizeof(
float ) ) ;
267 memcpy( dnew, dold, nlambda*
sizeof(
double ) ) ;
271 new->header = cpl_propertylist_duplicate( old->
header ) ;
293 const char * tablename = NULL ;
294 cpl_table * table = NULL;
295 cpl_propertylist* header = NULL;
304 check(tablename = cpl_frame_get_filename(frame));
307 check(
size = cpl_frame_get_nextensions( frame));
320 check(header = cpl_propertylist_load(tablename,0));
321 check(cpl_propertylist_erase_regexp(header,
322 "^(ARCFILE|ORIGFILE|CHECKSUM|DATASUM)$", CPL_FALSE));
323 check(cpl_propertylist_append(result->
header, header));
334 for( i = 0 ; i<nbext ; i++ ) {
335 int nb, k,
order, depth, nlambda, nslit ;
336 const cpl_array * data_array ;
337 const float * farray = NULL ;
338 const int * iarray = NULL ;
340 check( table = cpl_table_load( tablename, i+1, 0 ) ) ;
342 CPL_TYPE_INT, 0, &
order));
346 CPL_TYPE_INT, 0, &nlambda ));
349 CPL_TYPE_INT, 0, &nslit ));
359 CPL_TYPE_FLOAT, 0, result->
list[i].
slit ));
365 depth = nlambda*nslit ;
367 check( data_array = cpl_table_get_array( table,
370 nb = cpl_array_get_size( data_array ) ;
374 check( farray = cpl_array_get_data_float_const( data_array ) ) ;
375 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
data1+k) = *farray++ ;
378 check( data_array = cpl_table_get_array( table,
381 check( nb = cpl_array_get_size( data_array ) ) ;
383 check( farray = cpl_array_get_data_float_const( data_array ) ) ;
384 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
errs1+k) = *farray++ ;
386 check( data_array = cpl_table_get_array( table,
389 nb = cpl_array_get_size( data_array ) ;
391 iarray = cpl_array_get_data_int_const( data_array ) ;
392 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
qual1+k) = *iarray++ ;
395 order, nlambda, nslit ) ;
397 cpl_table_delete( table ) ;
411 const char * imagelist_name = NULL ;
412 cpl_image * ima_data = NULL;
413 cpl_image * ima_errs = NULL;
414 cpl_image * ima_qual = NULL;
415 cpl_propertylist* header = NULL;
416 cpl_propertylist* hdata=NULL;
417 cpl_propertylist* herrs=NULL;
418 cpl_propertylist* hqual=NULL;
419 const char* ext_name=NULL;
430 check(imagelist_name = cpl_frame_get_filename(frame));
433 check( nbext = cpl_frame_get_nextensions( frame));
450 check(header = cpl_propertylist_load(imagelist_name,0));
451 check(cpl_propertylist_erase_regexp(header,
452 "^(ARCFILE|ORIGFILE|CHECKSUM|DATASUM)$", CPL_FALSE));
453 check(cpl_propertylist_append(result->
header, header));
462 for( i = 0,j=0 ; j<nbext ; i++, j+=3 ) {
463 int k,
order, depth, nlambda, nslit ;
464 const float * farray = NULL ;
465 const int * iarray = NULL ;
477 check( hdata = cpl_propertylist_load( imagelist_name, j+0 ) ) ;
478 check( herrs = cpl_propertylist_load( imagelist_name, j+1 ) ) ;
479 check( hqual = cpl_propertylist_load( imagelist_name, j+2 ) ) ;
481 order=10*(ext_name[3]-48)+(ext_name[4]-48);
503 for(k=0;k<nslit;k++) {
504 *(result->
list[i].
slit+k)=(s_start+k*s_step);
508 for(k=0;k<nslit;k++) {
514 for(k=0;k<nlambda;k++) {
515 *(result->
list[i].
lambda+k)=(w_start+k*w_step);
518 depth = nlambda*nslit ;
521 check( farray = cpl_image_get_data_float( ima_data)) ;
522 sx = cpl_image_get_size_x( ima_data ) ;
523 sy = cpl_image_get_size_y( ima_data ) ;
526 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
data1+k) = *farray++ ;
530 check( farray = cpl_image_get_data_float( ima_errs)) ;
531 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
errs1+k) = *farray++ ;
534 check( iarray = cpl_image_get_data_int( ima_qual)) ;
535 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
qual1+k) = *iarray++ ;
538 order, nlambda, nslit ) ;
567 const char * imagelist_name = NULL ;
568 cpl_vector * vec_data = NULL;
569 cpl_vector * vec_errs = NULL;
570 cpl_vector * vec_qual = NULL;
571 cpl_propertylist* header = NULL;
572 cpl_propertylist* hdata=NULL;
573 cpl_propertylist* herrs=NULL;
574 cpl_propertylist* hqual=NULL;
575 const char* ext_name=NULL;
586 check(imagelist_name = cpl_frame_get_filename(frame));
589 check( nbext = cpl_frame_get_nextensions( frame));
606 check(header = cpl_propertylist_load(imagelist_name,0));
607 check(cpl_propertylist_erase_regexp(header,
608 "^(ARCFILE|ORIGFILE|CHECKSUM|DATASUM)$", CPL_FALSE));
609 check(cpl_propertylist_append(result->
header, header));
618 for( i = 0,j=0 ; j<nbext ; i++, j+=3 ) {
619 int k,
order, depth, nlambda;
620 const double * farray = NULL ;
621 const double * iarray = NULL ;
626 check(vec_data=cpl_vector_load(imagelist_name,j+0));
627 check(vec_errs=cpl_vector_load(imagelist_name,j+1));
628 check(vec_qual=cpl_vector_load(imagelist_name,j+2));
630 check( hdata = cpl_propertylist_load( imagelist_name, j+0 ) ) ;
631 check( herrs = cpl_propertylist_load( imagelist_name, j+1 ) ) ;
632 check( hqual = cpl_propertylist_load( imagelist_name, j+2 ) ) ;
634 order=10*(ext_name[3]-48)+(ext_name[4]-48);
651 for(k=0;k<nlambda;k++) {
652 *(result->
list[i].
lambda+k)=(w_start+k*w_step);
658 check( farray = cpl_vector_get_data( vec_data)) ;
659 sx = cpl_vector_get_size( vec_data ) ;
662 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
data1+k) = (float)*farray++ ;
666 check( farray = cpl_vector_get_data( vec_errs)) ;
667 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
errs1+k) = (float)*farray++ ;
670 check( iarray = cpl_vector_get_data( vec_qual)) ;
671 for( k = 0 ; k<depth ; k++ ) *(result->
list[i].
qual1+k) = (int)*iarray++ ;
716 cpl_frame *result = NULL;
730 norders = rec_list->
size;
733 int img_size, nlambda, nslit;
737 img_size = nlambda * nslit;
740 for( i = 0 ; i< img_size ; i++,
data++ ) {
746 sprintf( fname,
"%s.fits", tag);
762 if (list != NULL && *list != NULL ) {
778 for (i = 0; i < plist->
size; i++) {
782 if ( pr == NULL ) continue ;
784 cpl_free( pr->
slit ) ;
786 cpl_free( pr->
data1 ) ;
787 cpl_free( pr->
errs1 ) ;
788 cpl_free( pr->
qual1 ) ;
791 cpl_free((*list)->list);
811 cpl_propertylist * res = NULL;
937 double lambda_min = 10000;
942 for( i=0; i< list->
size; i++){
947 if ( lambda < lambda_min){
959 double lambda_max =0.0;
964 for( i=0; i< list->
size; i++){
969 if ( lambda > lambda_max){
994 return cpl_error_get_code() ;
1014 return cpl_error_get_code() ;
1028 double* res = NULL ;
1047 float * res = NULL ;
1066 float * res = NULL ;
1113 const char* tag,
int is_temp)
1115 cpl_frame * result = NULL ;
1116 cpl_table * table = NULL;
1117 int nlambda = 0, nslit = 0, depth = 0;
1118 cpl_array * dim = NULL, * temp_array = NULL ;
1120 unsigned mode = CPL_IO_DEFAULT;
1128 for( i = 0 ; i < list->
size ; i++ ) {
1132 depth = nlambda*nslit;
1139 check( table = cpl_table_new( 1));
1149 CPL_TYPE_DOUBLE, nlambda));
1151 CPL_TYPE_FLOAT, nslit));
1153 CPL_TYPE_FLOAT, depth));
1155 CPL_TYPE_FLOAT, depth));
1157 CPL_TYPE_INT, depth));
1160 check( dim = cpl_array_new( 1, CPL_TYPE_INT)) ;
1161 cpl_array_set_int( dim, 0, nlambda);
1162 check( cpl_table_set_column_dimensions(
1164 cpl_array_set_int( dim, 0, nslit);
1165 check( cpl_table_set_column_dimensions( table,
1169 check( dim = cpl_array_new( 2, CPL_TYPE_INT)) ;
1170 cpl_array_set_int( dim, 0, nlambda);
1171 cpl_array_set_int( dim, 1, nslit);
1173 check( cpl_table_set_column_dimensions( table,
1175 check( cpl_table_set_column_dimensions( table,
1177 check( cpl_table_set_column_dimensions( table,
1190 check ( temp_array = cpl_array_new( nslit, CPL_TYPE_FLOAT));
1191 for( k = 0 ; k<nslit ; k++ ) {
1192 check( cpl_array_set_float( temp_array, k,
1201 check( temp_array = cpl_array_new( nlambda, CPL_TYPE_DOUBLE));
1202 for( k = 0 ; k<nlambda ; k++ ) {
1203 check( cpl_array_set_double( temp_array, k,
1212 check( temp_array = cpl_array_new( depth, CPL_TYPE_FLOAT));
1213 for( k = 0 ; k<depth ; k++ ) {
1214 check( cpl_array_set_float( temp_array, k,
1220 for( k = 0 ; k<depth ; k++ ) {
1221 check( cpl_array_set_float( temp_array, k,
1228 check( temp_array = cpl_array_new( depth, CPL_TYPE_INT));
1229 for( k = 0 ; k<depth ; k++ ) {
1230 check( cpl_array_set_int( temp_array, k,
1241 mode = CPL_IO_EXTEND;
1247 CPL_FRAME_GROUP_PRODUCT, CPL_FRAME_LEVEL_FINAL));
1279 double lambda_min, lambda_max;
1333 const char* tag,
int is_temp)
1335 cpl_frame * result = NULL ;
1336 cpl_table * table = NULL;
1337 int nlambda = 0, nslit = 0, depth = 0;
1338 cpl_array * dim = NULL, * temp_array = NULL ;
1340 unsigned mode = CPL_IO_DEFAULT;
1348 for( i = 0 ; i < list->
size ; i++ ) {
1352 depth = nlambda*nslit;
1359 check( table = cpl_table_new( 1));
1369 CPL_TYPE_DOUBLE, nlambda));
1371 CPL_TYPE_FLOAT, nslit));
1374 check( dim = cpl_array_new( 1, CPL_TYPE_INT)) ;
1375 cpl_array_set_int( dim, 0, nlambda);
1376 check( cpl_table_set_column_dimensions(
1378 cpl_array_set_int( dim, 0, nslit);
1379 check( cpl_table_set_column_dimensions( table,
1383 check( dim = cpl_array_new( 2, CPL_TYPE_INT)) ;
1384 cpl_array_set_int( dim, 0, nlambda);
1385 cpl_array_set_int( dim, 1, nslit);
1398 check ( temp_array = cpl_array_new( nslit, CPL_TYPE_FLOAT));
1399 for( k = 0 ; k<nslit ; k++ ) {
1400 check( cpl_array_set_float( temp_array, k,
1409 check( temp_array = cpl_array_new( nlambda, CPL_TYPE_DOUBLE));
1410 for( k = 0 ; k<nlambda ; k++ ) {
1411 check( cpl_array_set_double( temp_array, k,
1422 mode = CPL_IO_EXTEND;
1428 CPL_FRAME_GROUP_PRODUCT, CPL_FRAME_LEVEL_FINAL));
1430 if ( is_temp == CPL_TRUE){
1431 check( cpl_frame_set_level( result, CPL_FRAME_LEVEL_TEMPORARY));
1456 cpl_table * table = NULL;
1457 int nlambda, nslit, depth ;
1458 cpl_array * temp_array = NULL ;
1460 cpl_frame* result=NULL;
1462 double* plambda=NULL;
1469 char data_extname[20];
1470 char errs_extname[20];
1471 char qual_extname[20];
1472 unsigned mode = CPL_IO_DEFAULT;
1473 cpl_propertylist *header_data = NULL;
1474 cpl_propertylist *header_errs = NULL;
1475 cpl_propertylist *header_qual = NULL;
1483 for( i = 0; i < list->
size ; i++ ) {
1487 depth = nlambda*nslit ;
1491 xsh_msg(
"depth %d : %dx%d", depth, nslit, nlambda);
1496 table = cpl_table_new(nlambda);
1497 cpl_table_new_column(table,
"wave",CPL_TYPE_DOUBLE);
1498 cpl_table_new_column(table,
"flux",CPL_TYPE_DOUBLE);
1499 cpl_table_new_column(table,
"errs",CPL_TYPE_DOUBLE);
1500 cpl_table_new_column(table,
"qual",CPL_TYPE_INT);
1501 cpl_table_fill_column_window_double(table,
"wave",0,nlambda,0);
1502 cpl_table_fill_column_window_double(table,
"flux",0,nlambda,0);
1503 cpl_table_fill_column_window_double(table,
"errs",0,nlambda,0);
1504 cpl_table_fill_column_window_int(table,
"qual",0,nlambda,0);
1505 check( header_data = cpl_propertylist_duplicate( list->
header));
1506 header_errs=cpl_propertylist_new();
1507 header_qual=cpl_propertylist_new();
1510 check(plambda=cpl_table_get_data_double(table,
"wave"));
1511 check(pflux=(
float *) cpl_table_get_data_double(table,
"flux"));
1512 check(perr=(
float *) cpl_table_get_data_double(table,
"errs"));
1513 check(pqual=cpl_table_get_data_int(table,
"qual"));
1520 for( k = 0 ; k<nlambda ; k++ ) {
1524 for( k = 0 ; k<depth ; k++ ) {
1533 cpl_propertylist_erase_regexp(header_data,
"^CRPIX2",0);
1534 cpl_propertylist_erase_regexp(header_data,
"^CRVAL2",0);
1535 cpl_propertylist_erase_regexp(header_data,
"^CDELT2",0);
1537 cpl_propertylist_erase_regexp(header_errs,
"^CRPIX2",0);
1538 cpl_propertylist_erase_regexp(header_errs,
"^CRVAL2",0);
1539 cpl_propertylist_erase_regexp(header_errs,
"^CDELT2",0);
1541 cpl_propertylist_erase_regexp(header_qual,
"^CRPIX2",0);
1542 cpl_propertylist_erase_regexp(header_qual,
"^CRVAL2",0);
1543 cpl_propertylist_erase_regexp(header_qual,
"^CDELT2",0);
1548 sprintf(data_extname,
"ORD%d_FLUX",
order);
1549 sprintf(errs_extname,
"ORD%d_ERRS",
order);
1550 sprintf(qual_extname,
"ORD%d_QUAL",
order);
1556 data_extname,errs_extname,qual_extname,0));
1562 data_extname,errs_extname,qual_extname,1));
1567 data_extname,errs_extname,qual_extname,2));
1569 mode = CPL_IO_EXTEND;
1572 cpl_table_save( table, header_data, NULL, filename, CPL_IO_DEFAULT );
1574 cpl_table_save( table, header_data, NULL, filename,
mode );
1584 CPL_FRAME_GROUP_PRODUCT,
1585 CPL_FRAME_LEVEL_FINAL));
1610 cpl_table * table = NULL;
1611 int nlambda, nslit, depth ;
1612 cpl_array * temp_array = NULL ;
1615 cpl_image* img_lambda=NULL;
1616 cpl_image* img_slit=NULL;
1618 cpl_image* img_flux=NULL;
1619 cpl_image* img_err=NULL;
1620 cpl_image* img_qual=NULL;
1621 cpl_frame* result=NULL;
1625 double* plambda=NULL;
1638 char data_extname[20];
1639 char errs_extname[20];
1640 char qual_extname[20];
1641 unsigned mode = CPL_IO_DEFAULT;
1642 cpl_propertylist *header_data = NULL;
1643 cpl_propertylist *header_errs = NULL;
1644 cpl_propertylist *header_qual = NULL;
1652 for( i = 0; i < list->
size ; i++ ) {
1656 depth = nlambda*nslit ;
1666 check( header_data = cpl_propertylist_duplicate( list->
header));
1667 header_errs=cpl_propertylist_new();
1668 header_qual=cpl_propertylist_new();
1670 check(img_lambda=cpl_image_new(nlambda,1,CPL_TYPE_DOUBLE));
1671 check(img_slit=cpl_image_new(nslit,1,CPL_TYPE_FLOAT));
1672 check(img_flux=cpl_image_new(nlambda,nslit,CPL_TYPE_FLOAT));
1673 check(img_err=cpl_image_new(nlambda,nslit,CPL_TYPE_FLOAT));
1674 check(img_qual=cpl_image_new(nlambda,nslit,CPL_TYPE_INT));
1676 check(plambda=cpl_image_get_data_double(img_lambda));
1677 check(pslit=cpl_image_get_data_float(img_slit));
1678 check(pflux=cpl_image_get_data_float(img_flux));
1679 check(perr=cpl_image_get_data_float(img_err));
1680 check(pqual=cpl_image_get_data_int(img_qual));
1682 for( k = 0 ; k<nslit ; k++ ) {
1683 pslit[k]= (*(list->
list[i].
slit+k) ) ;
1685 for( k = 0 ; k<nlambda ; k++ ) {
1690 cdelt1=plambda[1]-plambda[0];
1703 for( k = 0 ; k<depth ; k++ ) {
1714 cdelt2=pslit[1]-pslit[0];
1720 cpl_propertylist_erase_regexp(header_data,
"^CRPIX2",0);
1721 cpl_propertylist_erase_regexp(header_data,
"^CRVAL2",0);
1722 cpl_propertylist_erase_regexp(header_data,
"^CDELT2",0);
1724 cpl_propertylist_erase_regexp(header_errs,
"^CRPIX2",0);
1725 cpl_propertylist_erase_regexp(header_errs,
"^CRVAL2",0);
1726 cpl_propertylist_erase_regexp(header_errs,
"^CDELT2",0);
1728 cpl_propertylist_erase_regexp(header_qual,
"^CRPIX2",0);
1729 cpl_propertylist_erase_regexp(header_qual,
"^CRVAL2",0);
1730 cpl_propertylist_erase_regexp(header_qual,
"^CDELT2",0);
1747 sprintf(data_extname,
"ORD%d_FLUX",
order);
1748 sprintf(errs_extname,
"ORD%d_ERRS",
order);
1749 sprintf(qual_extname,
"ORD%d_QUAL",
order);
1755 data_extname,errs_extname,qual_extname,0));
1761 data_extname,errs_extname,qual_extname,1));
1766 data_extname,errs_extname,qual_extname,2));
1768 mode = CPL_IO_EXTEND;
1771 cpl_image_save(img_flux,filename, CPL_BPP_IEEE_FLOAT, header_data,
1774 cpl_image_save(img_flux,filename, CPL_BPP_IEEE_FLOAT, header_data,
mode);
1777 cpl_image_save(img_err,filename, CPL_BPP_IEEE_FLOAT, header_errs,
mode) ;
1781 cpl_vector* flux1D = cpl_vector_new_from_image_row( img_flux, 1);
1782 cpl_vector* errs1D = cpl_vector_new_from_image_row( img_err, 1);
1783 cpl_vector* qual1D = cpl_vector_new_from_image_row( img_qual, 1);
1786 cpl_vector_save( flux1D, filename, CPL_BPP_IEEE_FLOAT, header_data,CPL_IO_DEFAULT );
1788 cpl_vector_save( flux1D, filename, CPL_BPP_IEEE_FLOAT, header_data,
mode);
1790 cpl_vector_save( errs1D, filename, CPL_BPP_IEEE_FLOAT, header_errs,
mode);
1791 cpl_vector_save( qual1D, filename, CPL_BPP_32_SIGNED, header_qual,
mode);
1811 CPL_FRAME_GROUP_PRODUCT,
1812 CPL_FRAME_LEVEL_FINAL));
1827 double * reloffset,
double * cumoffset )
1829 cpl_propertylist * header ;
1830 const char *fname = NULL ;
1834 check( fname = cpl_frame_get_filename( rec_frame ) ) ;
1835 check( header = cpl_propertylist_load( fname, 0 ) ) ;
1838 if ( cpl_error_get_code() == CPL_ERROR_NONE ) {
1841 else cpl_error_reset() ;
1844 if ( cpl_error_get_code() == CPL_ERROR_NONE ) {
1851 if ( cpl_error_get_code() == CPL_ERROR_NONE ) {
1854 else cpl_error_reset() ;
1857 if ( cpl_error_get_code() == CPL_ERROR_NONE ) {
1860 else cpl_error_reset() ;
1869 double* smin,
double* smax)
1874 int hslit = round(0.5 * nod_throw /
slit_step);
1875 *smax = nslit/2. + hslit;
1876 *smin = nslit/2. - hslit;
1878 return cpl_error_get_code();
static xsh_instrument * instrument
int xsh_rec_list_get_nslit(xsh_rec_list *list, int idx)
double * xsh_rec_list_get_lambda(xsh_rec_list *list, int idx)
cpl_error_code xsh_rec_list_set_slit_max(xsh_rec_list *list, const double val)
xsh_rec_list * xsh_rec_list_load(cpl_frame *frame, xsh_instrument *instrument)
load an rec list from a frame
float * xsh_rec_list_get_data1(xsh_rec_list *list, int idx)
cpl_frame * xsh_rec_list_save(xsh_rec_list *list, const char *filename, const char *tag, int is_temp)
Save a rec list in a frame.
cpl_frame * xsh_rec_list_save2(xsh_rec_list *list, const char *filename, const char *tag)
save an rec list to a frame
cpl_error_code xsh_rec_get_nod_extract_slit_min_max(xsh_rec_list *rlist, const double slit_step, double *smin, double *smax)
xsh_rec_list * xsh_rec_list_create_with_size(int size, xsh_instrument *instr)
Create an empty order list.
float * xsh_rec_list_get_errs1(xsh_rec_list *list, int idx)
cpl_propertylist * xsh_rec_list_get_header(xsh_rec_list *list)
get header of the table
void xsh_rec_list_update_header(xsh_rec_list *rec_list, xsh_pre *pre, xsh_rectify_param *rec_par, const char *pro_catg)
Update header of rectified list writing mandatory KW.
int xsh_rec_list_get_order(xsh_rec_list *list, int idx)
double xsh_rec_list_get_slit_max(xsh_rec_list *list)
xsh_rec_list * xsh_rec_list_load_eso(cpl_frame *frame, xsh_instrument *instrument)
void xsh_rec_list_set_data_size(xsh_rec_list *list, int idx, int absorder, int nlambda, int ns)
Allocate memory for the order idx of the rectify list.
void xsh_rec_list_dump(xsh_rec_list *list, const char *fname)
double xsh_rec_list_get_lambda_max(xsh_rec_list *list)
cpl_frame * xsh_rec_list1D_save_as_tab(xsh_rec_list *list, const char *filename, const char *tag)
save an rec list to a frame
xsh_rec_list * xsh_rec_list_load_eso_1d(cpl_frame *frame, xsh_instrument *instrument)
int * xsh_rec_list_get_qual1(xsh_rec_list *list, int idx)
xsh_rec_list * xsh_rec_list_duplicate(xsh_rec_list *old, xsh_instrument *instrument)
double xsh_rec_list_get_lambda_min(xsh_rec_list *list)
float * xsh_rec_list_get_slit(xsh_rec_list *list, int idx)
int xsh_rec_list_get_nlambda(xsh_rec_list *list, int idx)
cpl_frame * xsh_rec_list_frame_invert(cpl_frame *rec_frame, const char *tag, xsh_instrument *instrument)
Invert the rectified flux images of the input frame into a new frame.
void xsh_rec_list_free(xsh_rec_list **list)
free memory associated to a rec_list
xsh_rec_list * xsh_rec_list_create(xsh_instrument *instr)
Create an empty order list.
double xsh_rec_list_get_slit_min(xsh_rec_list *list)
void xsh_rec_get_nod_kw(cpl_frame *rec_frame, double *throw, double *jitter, double *reloffset, double *cumoffset)
cpl_frame * xsh_rec_list_save_table(xsh_rec_list *list, const char *filename, const char *tag, int is_temp)
Save a rec list in a frame.
cpl_error_code xsh_rec_list_set_slit_min(xsh_rec_list *list, const double val)
#define XSH_ASSURE_NOT_ILLEGAL(cond)
#define XSH_CMP_INT(A, OPERATOR, B, SUFFIX,...)
#define XSH_ASSURE_NOT_NULL(pointer)
xsh_instrument * xsh_instrument_duplicate(xsh_instrument *old)
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
#define xsh_msg_dbg_medium(...)
#define xsh_msg(...)
Print a message on info level.
#define xsh_msg_dbg_low(...)
#define xsh_msg_dbg_high(...)
double xsh_pfits_get_crval2(const cpl_propertylist *plist)
find out the crval2
cpl_error_code xsh_plist_set_extra_keys(cpl_propertylist *plist, const char *hduclas1, const char *hduclas2, const char *hduclas3, const char *scidata, const char *errdata, const char *qualdata, const int type)
set hdu keys
void xsh_pfits_set_pcatg(cpl_propertylist *plist, const char *value)
Write the PCATG value.
double xsh_pfits_get_cdelt2(const cpl_propertylist *plist)
find out the cdelt2
void xsh_pfits_set_rectify_bin_lambda(cpl_propertylist *plist, double value)
WRITE the lambda binning.
void xsh_pfits_set_rectify_lambda_max(cpl_propertylist *plist, double value)
WRITE the lambda max value.
double xsh_pfits_get_nod_jitterwidth(const cpl_propertylist *plist)
Get the Jitter Box size.
const char * xsh_pfits_get_extname(const cpl_propertylist *plist)
find out the EXTNAME
void xsh_pfits_set_rectify_space_max(cpl_propertylist *plist, double value)
WRITE the space (slit) max value.
void xsh_pfits_set_extname(cpl_propertylist *plist, const char *value)
Write the EXTNAME value.
double xsh_pfits_get_nodthrow(const cpl_propertylist *plist)
Get the Nod Throw value.
cpl_error_code xsh_pfits_set_wcs(cpl_propertylist *header, const double crpix1, const double crval1, const double cdelt1, const double crpix2, const double crval2, const double cdelt2)
void xsh_pfits_set_rectify_space_min(cpl_propertylist *plist, double value)
WRITE the space (slit) min value.
cpl_error_code xsh_pfits_set_wcs1(cpl_propertylist *header, const double crpix1, const double crval1, const double cdelt1)
double xsh_pfits_get_cdelt1(const cpl_propertylist *plist)
find out the cdelt1
void xsh_pfits_set_rectify_bin_space(cpl_propertylist *plist, double value)
WRITE the space (slit) binning.
double xsh_pfits_get_nod_reloffset(const cpl_propertylist *plist)
Get the Relative Jitter Offset.
void xsh_pfits_set_bunit(cpl_propertylist *plist, const char *value)
Write the BUNIT value.
void xsh_pfits_set_rectify_lambda_min(cpl_propertylist *plist, double value)
WRITE the lambda min value.
int xsh_pfits_get_naxis1(const cpl_propertylist *plist)
find out the NAXIS1 value
double xsh_pfits_get_crval1(const cpl_propertylist *plist)
find out the crval1
void xsh_pfits_set_extract_slit_min(cpl_propertylist *plist, double value)
WRITE the min slit for extraction.
void xsh_pfits_set_extract_slit_max(cpl_propertylist *plist, double value)
WRITE the min slit for extraction.
double xsh_pfits_get_nod_cumoffset(const cpl_propertylist *plist)
Get the Cumulative Jitter Offset.
int xsh_pfits_get_naxis2(const cpl_propertylist *plist)
find out the NAXIS2 value
void xsh_free_vector(cpl_vector **v)
Deallocate a vector 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_array(cpl_array **m)
Deallocate an array and set the pointer to NULL.
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_get_table_value(const cpl_table *table, const char *colname, cpl_type coltype, int i, void *result)
Read a table value from a fits table.
void xsh_add_temporary_file(const char *name)
Add temporary file to temprary files list.
cpl_propertylist * data_header
xsh_instrument * instrument
cpl_propertylist * header
#define XSH_PRE_DATA_TYPE
#define XSH_PRE_QUAL_TYPE
#define XSH_PRE_ERRS_TYPE
#define XSH_REC_TABLE_COLNAME_ERRS1
#define XSH_REC_TABLE_NB_VIS_ORDERS
#define XSH_REC_TABLE_COLNAME_SLIT
#define XSH_REC_TABLE_COLNAME_ORDER
#define XSH_REC_TABLE_COLNAME_NLAMBDA
#define XSH_REC_TABLE_NB_NIR_ORDERS
#define XSH_REC_TABLE_NB_UVB_ORDERS
#define XSH_REC_TABLE_COLNAME_NSLIT
#define XSH_REC_TABLE_COLNAME_QUAL1
#define XSH_REC_TABLE_COLNAME_LAMBDA
#define XSH_REC_TABLE_COLNAME_FLUX1
cpl_frame * xsh_frame_product(const char *fname, const char *tag, cpl_frame_type type, cpl_frame_group group, cpl_frame_level level)
Creates a frame with given characteristics.
#define XSH_BUNIT_FLUX_REL_C
#define XSH_NEW_PROPERTYLIST(POINTER)
#define XSH_CALLOC(POINTER, TYPE, SIZE)
void xsh_table_get_array_double(cpl_table *table, const char *colname, double *pointer, int nb)
void xsh_table_get_array_float(cpl_table *table, const char *colname, float *pointer, int nb)
#define XSH_TABLE_FREE(TABLE)