Orders
[Data Format Handling functions]

Functions

void xsh_order_list_dump (xsh_order_list *list, const char *fname)
void xsh_order_list_verify (xsh_order_list *list, int ny)
xsh_order_listxsh_order_list_new (int size)
 Create a new order list from size (no check).
xsh_order_listxsh_order_list_create (xsh_instrument *instr)
 create an empty order list
xsh_order_listxsh_order_list_load (cpl_frame *frame, xsh_instrument *instr)
 load an order list from a frame
void xsh_order_list_fit (xsh_order_list *list, int size, double *order, double *posx, double *posy, int deg_poly)
 fit the polynomial solution of given points
void xsh_order_list_free (xsh_order_list **list)
 free memory associated to an order_list
int xsh_order_list_get_index_by_absorder (xsh_order_list *list, double absorder)
cpl_propertylist * xsh_order_list_get_header (xsh_order_list *list)
 get header of the table
int xsh_order_list_get_starty (xsh_order_list *list, int i)
 get position on Y axis of first pixel detected on order
int xsh_order_list_get_endy (xsh_order_list *list, int i)
 get position on Y axis of last pixel detected on order
int xsh_order_list_get_order (xsh_order_list *list, int absorder)
xsh_order_listxsh_order_list_merge (xsh_order_list *lista, xsh_order_list *listb)
void xsh_order_list_set_bin_x (xsh_order_list *list, int bin)
 Set the bin of image in x.
void xsh_order_list_set_bin_y (xsh_order_list *list, int bin)
 Set the bin of image in y.
double xsh_order_list_eval (xsh_order_list *list, cpl_polynomial *poly, double y)
 Evaluate an order list poly.
int xsh_order_list_eval_int (xsh_order_list *list, cpl_polynomial *poly, double y)
 Evaluate an order list poly but return the central pixel position rounding the polynomial.
void xsh_order_list_apply_shift (xsh_order_list *list, double xshift, double yshift)
 Shift a order list.
cpl_frame * xsh_order_list_save (xsh_order_list *order_list, xsh_instrument *instrument, const char *filename, const char *tag, const int ny)
 Save an order list to a frame.
void xsh_order_split_qth_d2 (cpl_frame *order_tab_frame, cpl_frame *spectralformat_frame, cpl_frame **qth_order_tab_frame, cpl_frame **d2_order_tab_frame, xsh_instrument *instr)
xsh_spectrum1Dxsh_spectrum1D_create (double lambda_min, double lambda_max, double lambda_step)
 Create a 1D spectrum structure.
xsh_spectrum1Dxsh_spectrum1D_load (cpl_frame *s1d_frame, xsh_instrument *instr)
 Load a 1D spectrum structure.
int xsh_spectrum1D_get_size (xsh_spectrum1D *s)
 Get size of spectrum.
double xsh_spectrum1D_get_lambda_min (xsh_spectrum1D *s)
 Get minimum lambda of spectrum.
double xsh_spectrum1D_get_lambda_max (xsh_spectrum1D *s)
 Get maximum lambda of spectrum.
double xsh_spectrum1D_get_lambda_step (xsh_spectrum1D *s)
 Get bin in lambda of spectrum.
double * xsh_spectrum1D_get_flux (xsh_spectrum1D *s)
 Get flux of spectrum.
double * xsh_spectrum1D_get_errs (xsh_spectrum1D *s)
 Get errs of spectrum.
int * xsh_spectrum1D_get_qual (xsh_spectrum1D *s)
 Get qual of spectrum.
void xsh_spectrum1D_free (xsh_spectrum1D **s)
 free memory associated to an 1D spectrum
cpl_frame * xsh_spectrum1D_save (xsh_spectrum1D *s, const char *filename)
 save a 1D spectrum
static cpl_error_code xsh_monitor_spectrum1D_flux_qc (xsh_spectrum *s, const double ws, const double we, const int index)
cpl_error_code xsh_monitor_spectrum1D_flux (cpl_frame *in_frm, xsh_instrument *instrument)

Function Documentation

cpl_error_code xsh_monitor_spectrum1D_flux ( cpl_frame *  in_frm,
xsh_instrument instrument 
)
static cpl_error_code xsh_monitor_spectrum1D_flux_qc ( xsh_spectrum s,
const double  ws,
const double  we,
const int  index 
) [static]
void xsh_order_list_apply_shift ( xsh_order_list list,
double  xshift,
double  yshift 
)

Shift a order list.

Parameters:
[in] list The order_list structure which contains polynomials coefficients of the orders
[in] xshift X shift
[in] yshift Y shift

Definition at line 718 of file xsh_data_order.c.

References xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order_list::list, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_flexcor().

xsh_order_list* xsh_order_list_create ( xsh_instrument instr  ) 
void xsh_order_list_dump ( xsh_order_list list,
const char *  fname 
)

Dump main info about an order table (for each order of the list)

Parameters:
[in] list pointer to table list
[in] fname File name

Definition at line 67 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order::cenpoly, degree, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, xsh_order_list::list, xsh_order_list::size, and xsh_order::starty.

Referenced by main(), and xsh_detect_continuum().

double xsh_order_list_eval ( xsh_order_list list,
cpl_polynomial *  poly,
double  y 
)

Evaluate an order list poly.

Parameters:
[in] list order list structure
[in] poly An order list poly
[in] y The position to evaluate
Returns:
The result

Definition at line 655 of file xsh_data_order.c.

References xsh_order_list::bin_x, xsh_order_list::bin_y, check, convert_bin_to_data(), convert_data_to_bin(), and XSH_ASSURE_NOT_NULL.

Referenced by find_tilt(), xsh_compute_flat_edges(), xsh_detect_order_edge(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_order_list_eval_int(), xsh_subtract_background(), and xsh_wavemap_lambda_range().

int xsh_order_list_eval_int ( xsh_order_list list,
cpl_polynomial *  poly,
double  y 
)

Evaluate an order list poly but return the central pixel position rounding the polynomial.

Parameters:
[in] list The order list to update
[in] poly An order list poly
[in] y The position to evaluate
Returns:
The result

Definition at line 688 of file xsh_data_order.c.

References check, XSH_ASSURE_NOT_NULL, and xsh_order_list_eval().

Referenced by create_blaze(), xsh_compute_flat_edges(), xsh_detect_edges(), xsh_detect_max_y(), xsh_detect_order_edge(), xsh_flat_merge_qth_d2(), xsh_mflat_normalize(), and xsh_wavemap_list_new().

void xsh_order_list_fit ( xsh_order_list list,
int  size,
double *  order,
double *  posx,
double *  posy,
int  deg_poly 
)

fit the polynomial solution of given points

Parameters:
[in] list The order list
[in] size Nb of elements in the list
[in] order Array of orders
[in] posx Array of X positions
[in] posy Array of Y positions
[in] deg_poly Degree of the polynomial

Definition at line 347 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order_list::absorder_max, xsh_order_list::absorder_min, xsh_order::cenpoly, check, xsh_order_list::list, xsh_order::order, xsh_order_list::size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_low, xsh_polynomial_fit_1d_create(), and xsh_unwrap_vector().

Referenced by fit_order_list(), and xsh_create_order_table().

void xsh_order_list_free ( xsh_order_list **  list  ) 
int xsh_order_list_get_endy ( xsh_order_list list,
int  i 
)
cpl_propertylist* xsh_order_list_get_header ( xsh_order_list list  ) 

get header of the table

Parameters:
[in] list the order_list
Returns:
the header associated to the table

Definition at line 473 of file xsh_data_order.c.

References xsh_order_list::header, and XSH_ASSURE_NOT_NULL.

Referenced by set_qc_parameters(), and xsh_create_order_table().

int xsh_order_list_get_index_by_absorder ( xsh_order_list list,
double  absorder 
)
int xsh_order_list_get_order ( xsh_order_list list,
int  absorder 
)
int xsh_order_list_get_starty ( xsh_order_list list,
int  i 
)
xsh_order_list* xsh_order_list_load ( cpl_frame *  frame,
xsh_instrument instr 
)

load an order list from a frame

Parameters:
[in] frame the table wich contains polynomials coefficients of the orders
[in] instr instrument in use
Returns:
the order list structure

Definition at line 189 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order_list::bin_x, xsh_order_list::bin_y, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, xsh_order_list::header, xsh_order_list::list, xsh_order::order, xsh_order::pol_degree, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, xsh_order::starty, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_error_msg, xsh_free_propertylist(), xsh_get_table_value(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_msg_dbg_medium, xsh_order_list_create(), xsh_order_list_free(), XSH_ORDER_TABLE_COLNAME_ABSORDER, XSH_ORDER_TABLE_COLNAME_CENTER, XSH_ORDER_TABLE_COLNAME_EDGLO, XSH_ORDER_TABLE_COLNAME_EDGUP, XSH_ORDER_TABLE_COLNAME_ENDY, XSH_ORDER_TABLE_COLNAME_ORDER, XSH_ORDER_TABLE_COLNAME_SLICLO, XSH_ORDER_TABLE_COLNAME_SLICUP, XSH_ORDER_TABLE_COLNAME_STARTY, XSH_ORDER_TABLE_DEGY, XSH_TABLE_FREE, and XSH_TABLE_LOAD.

Referenced by main(), xsh_cfg_recover_add_peaks_xpos(), xsh_cfg_recover_guess_tab_corr_by_ordpos(), xsh_cfg_recover_linear_ext(), xsh_data_check_spectralformat(), xsh_detect_arclines(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_flat_merge_qth_d2(), xsh_flexcor(), xsh_follow_arclines(), xsh_geom_ifu(), xsh_model_reduce(), xsh_opt_extract_orders(), xsh_rectify(), xsh_rectify_and_shift(), xsh_rectify_ifu(), xsh_subtract_background(), xsh_subtract_sky_single(), and xsh_wavemap_list_save().

xsh_order_list* xsh_order_list_merge ( xsh_order_list lista,
xsh_order_list listb 
)
xsh_order_list* xsh_order_list_new ( int  size  ) 

Create a new order list from size (no check).

Parameters:
[in] size The size of list
Returns:
A new ALLOCATED order list

Definition at line 129 of file xsh_data_order.c.

References xsh_order_list::header, xsh_order_list::list, xsh_order_list::size, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, and xsh_order_list_free().

Referenced by xsh_order_list_create(), and xsh_order_list_merge().

cpl_frame* xsh_order_list_save ( xsh_order_list order_list,
xsh_instrument instrument,
const char *  filename,
const char *  tag,
const int  ny 
)

Save an order list to a frame.

Parameters:
[in] order_list The order_list structure wich contains polynomials coefficients of the orders
[in] instrument The instrument setting
[in] filename The name of the save file on disk
[in] tag The frame tag
[in] ny y size of frame
Returns:
A newly allocated frame

Definition at line 785 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, endy, xsh_order::endy, xsh_order_list::header, xsh_order_list::list, norder, xsh_order::order, PointStep, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, starty, xsh_order::starty, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CMP_TAG_LAMP, xsh_frame_product(), xsh_free_table(), xsh_msg, xsh_msg_dbg_high, XSH_ORDER_TAB_EDGES, XSH_ORDER_TABLE_COLNAME_ABSORDER, XSH_ORDER_TABLE_COLNAME_CENTER, XSH_ORDER_TABLE_COLNAME_CENTERX, XSH_ORDER_TABLE_COLNAME_CENTERY, XSH_ORDER_TABLE_COLNAME_EDGLO, XSH_ORDER_TABLE_COLNAME_EDGLOX, XSH_ORDER_TABLE_COLNAME_EDGUP, XSH_ORDER_TABLE_COLNAME_EDGUPX, XSH_ORDER_TABLE_COLNAME_ENDY, XSH_ORDER_TABLE_COLNAME_ORDER, XSH_ORDER_TABLE_COLNAME_SLICLO, XSH_ORDER_TABLE_COLNAME_SLICLOX, XSH_ORDER_TABLE_COLNAME_SLICUP, XSH_ORDER_TABLE_COLNAME_SLICUPX, XSH_ORDER_TABLE_COLNAME_STARTY, XSH_ORDER_TABLE_DEGY, xsh_pfits_set_pcatg(), and XSH_QC_ORD_EDGE_NDET.

Referenced by main(), xsh_create_order_table(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_flat_merge_qth_d2(), xsh_flexcor(), xsh_model_order_edges_tab_create(), and xsh_order_table_from_fmtchk().

void xsh_order_list_set_bin_x ( xsh_order_list list,
int  bin 
)

Set the bin of image in x.

Parameters:
[in] list The order list to update
[in] bin The binning value in x

Definition at line 614 of file xsh_data_order.c.

References xsh_order_list::bin_x, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_flat_merge_qth_d2(), and xsh_subtract_background().

void xsh_order_list_set_bin_y ( xsh_order_list list,
int  bin 
)

Set the bin of image in y.

Parameters:
[in] list The order list to update
[in] bin The binning value in y

Definition at line 633 of file xsh_data_order.c.

References xsh_order_list::bin_y, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_flat_merge_qth_d2(), and xsh_subtract_background().

void xsh_order_list_verify ( xsh_order_list list,
int  ny 
)

Check that end and starty are coherent. If not, set starty at 0 and endy at the Y size of the image.

Parameters:
list Order list to check
ny Image size (Y)

Definition at line 104 of file xsh_data_order.c.

References xsh_order::endy, xsh_order_list::list, xsh_order_list::size, and xsh_order::starty.

Referenced by xsh_detect_continuum().

void xsh_order_split_qth_d2 ( cpl_frame *  order_tab_frame,
cpl_frame *  spectralformat_frame,
cpl_frame **  qth_order_tab_frame,
cpl_frame **  d2_order_tab_frame,
xsh_instrument instr 
)
xsh_spectrum1D* xsh_spectrum1D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step 
)

Create a 1D spectrum structure.

Parameters:
[in] lambda_min minimum wavelength of spectrum
[in] lambda_max maximum wavelength of spectrum
[in] lambda_step lambda binning
Returns:
the spectrum1D structure

Definition at line 70 of file xsh_data_spectrum1D.c.

References check, xsh_spectrum1D::errs, xsh_spectrum1D::errs_header, xsh_spectrum1D::flux, xsh_spectrum1D::flux_header, xsh_spectrum1D::lambda_max, xsh_spectrum1D::lambda_min, xsh_spectrum1D::lambda_step, xsh_spectrum1D::qual, xsh_spectrum1D::qual_header, xsh_spectrum1D::size, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, xsh_pfits_set_cdelt1(), xsh_pfits_set_crpix1(), xsh_pfits_set_crval1(), xsh_pfits_set_extname(), and xsh_spectrum1D_free().

void xsh_spectrum1D_free ( xsh_spectrum1D **  s  ) 

free memory associated to an 1D spectrum

Parameters:
[in] s spectrum structure to free

Definition at line 313 of file xsh_data_spectrum1D.c.

References XSH_FREE, xsh_free_image(), and xsh_free_propertylist().

Referenced by xsh_spectrum1D_create(), and xsh_spectrum1D_load().

double* xsh_spectrum1D_get_errs ( xsh_spectrum1D s  ) 

Get errs of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the errs data of spectrum

Definition at line 272 of file xsh_data_spectrum1D.c.

References check, xsh_spectrum1D::errs, and XSH_ASSURE_NOT_NULL.

double* xsh_spectrum1D_get_flux ( xsh_spectrum1D s  ) 

Get flux of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the flux data of spectrum

Definition at line 250 of file xsh_data_spectrum1D.c.

References check, xsh_spectrum1D::flux, and XSH_ASSURE_NOT_NULL.

double xsh_spectrum1D_get_lambda_max ( xsh_spectrum1D s  ) 

Get maximum lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
maximum lambda of spectrum

Definition at line 207 of file xsh_data_spectrum1D.c.

References xsh_spectrum1D::lambda_max, and XSH_ASSURE_NOT_NULL.

double xsh_spectrum1D_get_lambda_min ( xsh_spectrum1D s  ) 

Get minimum lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
minimum lambda spectrum

Definition at line 186 of file xsh_data_spectrum1D.c.

References xsh_spectrum1D::lambda_min, and XSH_ASSURE_NOT_NULL.

double xsh_spectrum1D_get_lambda_step ( xsh_spectrum1D s  ) 

Get bin in lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
bin in lambda of spectrum

Definition at line 228 of file xsh_data_spectrum1D.c.

References xsh_spectrum1D::lambda_step, and XSH_ASSURE_NOT_NULL.

int* xsh_spectrum1D_get_qual ( xsh_spectrum1D s  ) 

Get qual of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the qual data of spectrum

Definition at line 294 of file xsh_data_spectrum1D.c.

References check, xsh_spectrum1D::qual, and XSH_ASSURE_NOT_NULL.

int xsh_spectrum1D_get_size ( xsh_spectrum1D s  ) 

Get size of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the size of flux data in spectrum

Definition at line 165 of file xsh_data_spectrum1D.c.

References xsh_spectrum1D::size, and XSH_ASSURE_NOT_NULL.

xsh_spectrum1D* xsh_spectrum1D_load ( cpl_frame *  s1d_frame,
xsh_instrument instr 
)
cpl_frame* xsh_spectrum1D_save ( xsh_spectrum1D s,
const char *  filename 
)

save a 1D spectrum

Parameters:
[in] s spectrum structure to save
[in] filename name of the save file
Returns:
1D spectrum frame

Definition at line 336 of file xsh_data_spectrum1D.c.

References check, check_msg, xsh_spectrum1D::errs, xsh_spectrum1D::errs_header, xsh_spectrum1D::flux, xsh_spectrum1D::flux_header, xsh_spectrum1D::qual, xsh_spectrum1D::qual_header, XSH_ASSURE_NOT_NULL, xsh_frame_product(), xsh_free_frame(), XSH_SPECTRUM1D_DATA_BPP, XSH_SPECTRUM1D_ERRS_BPP, and XSH_SPECTRUM1D_QUAL_BPP.


Generated on 9 Mar 2011 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1