/home/amodigli/releases/xsh/2.1.1/xsh.30433/xshp/xsh/xsh_drl.h File Reference

#include <cpl.h>
#include <xsh_error.h>
#include <xsh_dfs.h>
#include <xsh_utils.h>
#include <xsh_data_pre.h>
#include <xsh_data_rec.h>
#include <xsh_data_instrument.h>
#include <xsh_data_order.h>
#include <xsh_data_dispersol.h>
#include <xsh_parameters.h>
#include <xsh_qc_handling.h>

Go to the source code of this file.

Defines

#define XSH_CONCAT(A, B)   A ## B
#define XSH_STRING(A)   # A
#define PICKUP_NOISE_HOT_PIXEL_MAP
#define REGDEBUG_OPTEXTRACT   0
#define XSH_DIVIDE_FLAT_THRESH   1e-10
#define XSH_MULTIPLY_FLAT_THRESH   1e+30
#define WAVELENGTH_PRECISION   0.00001
#define SLIT_PRECISION   0.00001
#define SLIT_PRECISION_IFU   0.21
#define XSH_DETECT_ARCLINES_TYPE_POLY   0
#define XSH_DETECT_ARCLINES_TYPE_MODEL   1
#define XSH_DETECT_ARCLINES_MODE_NORMAL   0
#define XSH_DETECT_ARCLINES_MODE_CORRECTED   1
#define XSH_DETECT_ARCLINES_MODE_RECOVER   2
#define XSH_RECTIFY_TYPE_POLY   0
#define XSH_RECTIFY_TYPE_MODEL   1
#define XSH_OBJPOS_NB_COL   2
#define XSH_OBJPOS_COLNAME_WAVELENGTH   "Wavelength"
#define XSH_OBJPOS_UNIT_WAVELENGTH   "nm"
#define XSH_OBJPOS_COLNAME_SLIT   "Slit"
#define XSH_OBJPOS_UNIT_SLIT   "arcsec"
#define XSH_LAMBDA_DIMM   0.0000005
#define XSH_SHIFTIFU_NB_COL   2
#define XSH_SHIFTIFU_COLNAME_WAVELENGTH   "Wavelength"
#define XSH_SHIFTIFU_UNIT_WAVELENGTH   "nm"
#define XSH_SHIFTIFU_COLNAME_SHIFTSLIT   "Slit_shift"
#define XSH_SHIFTIFU_UNIT_SHIFTSLIT   "arcsec"
#define XSH_MATH_SQRT_2   1.4142135623730951
#define REGDEBUG_GAUSSIAN   0
#define REGDEBUG_BLAZE   0
#define REGDEBUG_EXTRACT   0
#define REGDEBUG_EXTRACT_XY   0
#define REGDEBUG_SUBEXTRACT_XY   0
#define REGDEBUG_EXTRACT_STD   0
#define REGDEBUG_N   0
#define LSTART_COLUMN_NAME   "LAMBDASTART"
#define LEND_COLUMN_NAME   "LAMBDAEND"
#define GUESS_TELL_MASK_RESOLUTION_UVB   9100
#define GUESS_TELL_MASK_RESOLUTION_VIS   17400
#define GUESS_TELL_MASK_RESOLUTION_NIR   11300

Enumerations

enum  xsh_sol_wavelength { XSH_SOLUTION_ABSOLUTE, XSH_SOLUTION_RELATIVE }

Functions

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 and an error image.
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_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)
cpl_frame * xsh_compute_noise_map (cpl_imagelist *, cpl_frame *bpmap, xsh_clipping_param *, xsh_instrument *instr, cpl_frame **noisemap)
cpl_frame * xsh_create_master_dark (cpl_frame *bpMap, xsh_instrument *instr, cpl_parameterlist *parameters, cpl_frame *crh_frm, cpl_frame *bp_map_frm)
cpl_frame * xsh_create_master_dark2 (cpl_frameset *raws, xsh_stack_param *stack_param, cpl_parameterlist *drs_param, cpl_propertylist *qc_log, xsh_instrument *instr)
cpl_frame * xsh_compute_qc_on_master_bias (cpl_frameset *raws, cpl_frame *frame, xsh_instrument *instr, cpl_parameterlist *drs_params)
 Computes QC on a master bias frame.
cpl_frame * xsh_create_master_flat (cpl_frame *frame, xsh_instrument *instr)
cpl_frame * xsh_create_master_flat_with_mask (cpl_frame *frame, cpl_frame *edges, xsh_instrument *instr)
cpl_frame * xsh_create_master_flat2 (cpl_frameset *set, cpl_frame *order_tab_cen, xsh_stack_param *stack_par, xsh_instrument *inst)
 Combine master frames.
cpl_frame * xsh_create_master_dark_bpmap (cpl_frame *frame, xsh_instrument *instr)
cpl_frame * xsh_compute_linearity (cpl_frameset *, xsh_instrument *, xsh_clipping_param *, const int decode_bp)
int xsh_linear_group_by_exptime (cpl_frameset *, xsh_instrument *, double, cpl_frameset **)
cpl_frame * xsh_subtract_bias (cpl_frame *frame, cpl_frame *bias, xsh_instrument *instr, const char *type, const int pre_overscan_corr, const int save_tmp)
 Subtract the master bias frame from PRE frame.
cpl_frameset * xsh_subtract_nir_on_off (cpl_frameset *on, cpl_frameset *off, xsh_instrument *instr)
 (NIR only) subtract the OFF set of files from the On set of files
cpl_frame * xsh_subtract_dark (cpl_frame *frame, cpl_frame *dark, const char *filename, xsh_instrument *instr)
 subtract the master dark frame from PRE frame
cpl_frame * xsh_divide_flat (cpl_frame *frame, cpl_frame *flat, const char *filename, xsh_instrument *instr)
 divide PRE frame with the master FLAT frame
cpl_frame * xsh_multiply_flat (cpl_frame *frame, cpl_frame *flat, const char *filename, xsh_instrument *instr)
 multiply PRE frame with the master FLAT frame
cpl_frame * xsh_subtract_background (cpl_frame *frame, cpl_frame *ordertable, xsh_background_param *bckg, xsh_instrument *instr, const char *prefix, cpl_frame **grid_frame, cpl_frame **frame_backg, const int save_bkg, const int save_grid, const int save_sub_bkg)
 Subtract the inter-order background from PRE frame.
cpl_frame * xsh_detect_order_edge (cpl_frame *frame, cpl_frame *order_table, xsh_detect_order_param *det_param, xsh_instrument *instr)
 Detect order edges and compute polynomial description of ordermin and order max.
cpl_frame * xsh_detect_continuum (cpl_frame *frame, cpl_frame *order_table, cpl_frame *spectral_format, xsh_detect_continuum_param *param, xsh_clipping_param *dcn_clipping, xsh_instrument *instr, cpl_frame **resid_frame)
 Detect order and compute polynomial description of ordermin and order max. Uses a guess order table if available. If not, tries to compute one (see function xsh_order_table_from_fmtchk).
cpl_frame * xsh_order_table_from_fmtchk (xsh_pre *pre, cpl_frame *spectral_frame, xsh_detect_continuum_param *detect_param, xsh_instrument *instrument)
void xsh_create_map (cpl_frame *dispsol_frame, cpl_frame *ordertab_frame, cpl_frame *pre_frame, xsh_instrument *instrument, cpl_frame **wavemap_frame, cpl_frame **slitmap_frame, const char *rec_prefix)
cpl_frame * xsh_create_wavemap (cpl_frame *in_frame, cpl_frame *resid_frame, cpl_frame *order_frame, xsh_dispersol_param *dispersol_param, xsh_instrument *instrument)
cpl_frame * xsh_create_poly_wavemap (cpl_frame *pre_frame, cpl_frame *wave_tab_2d_frame, cpl_frame *order_tab_frame, cpl_frame *spectral_format_frame, xsh_dispersol_param *dispsol_par, xsh_instrument *instrument, const char *filename, cpl_frame **dispersol_frame, cpl_frame **slitmap_frame)
void xsh_create_model_map (cpl_frame *model_frame, xsh_instrument *instrument, const char *wave_map_tag, const char *slit_map_tag, cpl_frame **wavemap_frame, cpl_frame **slitmap_frame, const int save_tmp)
cpl_frame * xsh_create_order_table (cpl_frame *in_frame, cpl_frame *spectralformat_frame, cpl_frame *resid_frame, cpl_frame *arclines, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instrument)
void xsh_detect_arclines (cpl_frame *frame, cpl_frame *theo_tab_frame, cpl_frame *arc_lines_tab_frame, cpl_frame *wave_tab_guess_frame, cpl_frame *order_tab_recov_frame, cpl_frame *config_model_frame, cpl_frame *spectralformat_frame, cpl_frame **resid_tab_orders_frame, cpl_frame **arc_lines_clean_tab_frame, cpl_frame **wave_tab_frame, cpl_frame **resid_tab_frame, xsh_sol_wavelength type, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instr, const char *rec_id, const int clean_tmp, const int resid_tab_name_sw)
 detect the position on the detector of emission lines listed in a catalogue, from expected position values given by the Physical model.
void xsh_detect_arclines_dan (cpl_frame *frame, cpl_frame *theo_tab_frame, cpl_frame *arc_lines_tab_frame, cpl_frame *wave_tab_guess_frame, cpl_frame *order_tab_recov_frame, cpl_frame *config_model_frame, cpl_frame *spectralformat_frame, cpl_frame **resid_tab_orders_frame, cpl_frame **arc_lines_clean_tab_frame, cpl_frame **wave_tab_frame, cpl_frame **resid_tab_frame, xsh_sol_wavelength type, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instr, const char *rec_id, const int clean_tmp, const int resid_tab_name_sw)
 detect the position on the detector of emission lines listed in a catalogue, from expected position values given by the Physical model.
void xsh_follow_arclines_slit (cpl_frame *inframe, cpl_frame *arclines, cpl_frame *wavesol, cpl_frame *order_table, cpl_frame *spectralformat_frame, cpl_frame *model_config_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *param, xsh_instrument *instrument, cpl_frame **tilt_list, cpl_frame **shift_frame)
void xsh_follow_arclines_ifu (cpl_frame *inframe, cpl_frame *arclines, cpl_frame *wavesol, cpl_frame *order_table, cpl_frame *spectralformat_frame, cpl_frame *model_config_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *follow_param, xsh_instrument *instrument, cpl_frameset *tilt_set, cpl_frame **shift_frame)
 Detect and follow arc lines. Computes center, width and tilt parameters. The position of the center of each line is computed using the wavesol table, with arguments: lambda, order and slit. lambda is taken from the arclines table, order and slit is taken from the theoretical table.
void xsh_rec_slit_size (xsh_rectify_param *rectify_par, double *slit_min, int *nslit, XSH_MODE mode)
 rectify frame
cpl_frame * xsh_rectify_orders (cpl_frame *sci_frame, xsh_order_list *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *disp_tab_frame, const char *res_name, const char *tag, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab, int min_index, int max_index, double slit_min, int nslit, double slit_shift, cpl_frame *slitshift_tab)
 Create a grid in wavelength with the step in lambda and slit. Steps are defined in the parameters. Lambda min and max are taken from the spectralformat list. Slit min/max are hard coded. Range orders arve given.
cpl_frameset * xsh_rectify_orders_ifu (cpl_frame *sci_frame, xsh_order_list *orderlist, cpl_frameset *wavesol_frameset, cpl_frameset *shift_frameset, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *slitmap_frame, cpl_frameset **rec_frameset_ext, cpl_frameset **rec_frameset_tab, int min_index, int max_index, const char *rec_prefix)
cpl_frame * xsh_rectify (cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *wavesol_frame, cpl_frame *model_config_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectral_format, cpl_frame *disp_tab_frame, const char *fname, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab, const char *prefix)
 Create a grid in wavelength with the step in lambda and slit. Steps are defined in the parameters. Lambda min and max are taken from the spectralformat list. Slit min/max are hard coded.
cpl_frame * shift_with_kw (cpl_frame *rec_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, const char *fname, cpl_frame **res_frame_ext, double **ref_ra, double **ref_dec, int flag)
 This function creates a structure containing for each order the shift to be applied.
cpl_frame * xsh_rectify_and_shift (cpl_frame *sci_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *loc_frame, cpl_frame *loc0_frame, double *throw_shift, cpl_frame *disp_tab_frame, const char *res_name, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab)
cpl_frameset * xsh_rectify_ifu (cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frameset *wavesol_frame_set, cpl_frameset *shiftifu_frameset, cpl_frame *model_config_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectral_format, cpl_frame *slitmap_frame, cpl_frameset **rec_frameset_ext, cpl_frameset **rec_frameset_tab, const char *rec_prefix)
cpl_frame * xsh_shift_rectified (cpl_frame *rec_frame, cpl_frame *loc_frame, cpl_frame *loc0_frame, const char *file_name, xsh_combine_nod_param *combine_nod_param, xsh_rectify_param *rectif_par, xsh_instrument *instrument, cpl_frame **res_frame_ext)
void xsh_compute_slitlet_center (xsh_order_list *order_list, cpl_frame *slitmap_frame, double *down, double *cen, double *up, XSH_ARM arm)
void xsh_get_slit_edges (cpl_frame *slitmap_frame, double *sdown, double *sup, double *sldown, double *slup, xsh_instrument *instrument)
 Trace slit edges in a master flat.
void xsh_compute_slitlet_limits (cpl_frameset *shift_set, double sdown, double sldown, double slup, double sup, double slit_bin, double *slitmin_tab, int *nslit_tab, double *slitcen_tab)
cpl_frame * xsh_subtract_sky_single (cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *slitmap_frame, cpl_frame *wavemap_frame, cpl_frame *locTable_frame, cpl_frame *mflat_frame, cpl_frame *usr_defined_break_points_frame, xsh_instrument *instrument, int nbkpts, xsh_subtract_sky_single_param *sky_par, cpl_frame **sky_spectrum, cpl_frame **sky_spectrum_eso, const char *rec_prefix, const int clean_tmp)
 Subtract the sky background for single frame. If sky_spectrum is NOT NULL it is saved as a product, of type REC.
cpl_frame * xsh_add_sky_model (cpl_frame *sub_sky_frame, cpl_frame *sky_frame, xsh_instrument *instrument, const char *rec_prefix)
cpl_frame * xsh_localize_obj (cpl_frame *sci_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slit_limit_param, const char *fname)
 Build the localization table.
cpl_frameset * xsh_localize_obj_ifu (cpl_frameset *sci_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slit_limit_param)
cpl_frame * xsh_extract (cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, cpl_frame **res_frame_ext, const char *rec_prefix)
 simple 1D extraction of point source like object
cpl_frame * xsh_extract_clean (cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, xsh_interpolate_bp_param *ipol_bp, cpl_frame **res_frame_ext, const char *rec_prefix)
 simple 1D extraction of point source like object
cpl_frameset * xsh_extract_ifu (cpl_frameset *rec_frame_set, cpl_frameset *loc_frame_set, xsh_instrument *instrument, xsh_extract_param *extract_par, const char *rec_prefix)
 Loop on IFU Frames to extract simple 1D (1 per slitlet).
cpl_frame * xsh_abs_remove_crh_single (cpl_frame *sci_frame, xsh_instrument *instrument, xsh_remove_crh_single_param *single_par, const char *res_tag)
cpl_frame * xsh_remove_crh_single (cpl_frame *sci_frame, xsh_instrument *instrument, xsh_remove_crh_single_param *single_par, const char *name)
 Remove cosmic rays from a single frame.
cpl_frame * xsh_merge_ord_slitlet (cpl_frame *rec_frame, xsh_instrument *instrument, int merge_par, int slitlet, const char *rec_prefix)
 Merge orders of the rectified frame using merge parameters.
cpl_frame * xsh_merge_ord (cpl_frame *sci_frame, xsh_instrument *instrument, int merge, const char *rec_prefix)
 Merge orders of the rectified frame using merge parameters.
cpl_frameset * xsh_merge_ord_ifu (cpl_frameset *rec_frameset, xsh_instrument *instrument, int merge_par, const char *rec_prefix)
 Merge orders of the rectified frame using merge parameters.
double xsh_convert_seeing (cpl_frame *frame)
 Convert seeing keywork in mu sigma.
cpl_frame * xsh_localize_ifu_slitlet (cpl_frame *merge2d_slitlet, cpl_frame *skymask_frame, int smooth_hsize, int nscales, int HF_skip, const char *resname, double cut_sigma_low, double cut_sigma_up, double cut_snr_low, double cut_snr_up, double slit_min, double slit_max, int deg, int box_hsize, xsh_instrument *instr)
 Localize center of object on a merge 2D IFU slitlet.
cpl_frameset * xsh_localize_ifu (cpl_frameset *merge2d_frameset, cpl_frame *skymask_frame, xsh_localize_ifu_param *locifu_par, xsh_instrument *instrument, const char *resname)
 Localize center of object on a merge 2D IFU slitlet.
cpl_frame * xsh_compute_shift_ifu_slitlet (double lambda_ref, cpl_frame *objpos_frame, cpl_frame *shiftifu_frame, double lambdaref_hsize, const char *resname)
 Compute the shift in slit between reference wavelength and others.
cpl_frameset * xsh_compute_shift_ifu (double lambda_ref, double lambdaref_hsize, cpl_frameset *objpos_frameset, cpl_frameset *shiftifu_frameset, xsh_instrument *instr, const char *prefix)
 Compute the shift in slit between reference wavelength and others for all the slitlets.
cpl_frameset * xsh_subtract_sky_nod (cpl_frameset *raws, xsh_instrument *instrument, int mode_fast)
void xsh_flat_merge_qth_d2 (cpl_frame *qth_frame, cpl_frame *qth_order_tab_frame, cpl_frame *d2_frame, cpl_frame *d2_order_tab_frame, cpl_frame *qth_bkg_frame, cpl_frame *d2_bkg_frame, cpl_frame **qth_d2_flat_frame, cpl_frame **qth_d2_bkg_frame, cpl_frame **qth_d2_order_tab_frame, xsh_instrument *instrument)
 Merge two master flat fields and order tables according the spectral format.
void xsh_flat_merge_qth_d2_smooth (cpl_frame *qth_frame, cpl_frame *qth_order_tab_frame, cpl_frame *d2_frame, cpl_frame *d2_order_tab_frame, cpl_frame *qth_bkg_frame, cpl_frame *d2_bkg_frame, cpl_frame **qth_d2_flat_frame, cpl_frame **qth_d2_bkg_frame, cpl_frame **qth_d2_order_tab_frame, xsh_instrument *instrument)
 Merge two master flat fields and order tables according the spectral format.
cpl_frame * xsh_flat_merge_qth_d2_tabs (cpl_frame *qth_edges_tab, cpl_frame *d2_edges_tab, xsh_instrument *instrument)
 Merge two order edges tables according the spectral format.
cpl_error_code xsh_extract_clean_slice (const float *flux, const float *errs, int *qual, const double *lambda, const int ilambda, xsh_instrument *instrument, const int slit_min, const int slit_max, const int nlambda, const int nslit, const int mask_hsize, double *fluxval, double *errval, int *qualval)
void xsh_opt_extract (cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *loc_frame, cpl_frame *spectralformat_frame, cpl_frame *masterflat_frame, xsh_instrument *instrument, xsh_opt_extract_param *opt_extract_par, const char *rec_prefix, cpl_frame **orderext1d_frame, cpl_frame **orderoxt1d_frame, cpl_frame **orderoxt1d_eso_frame, cpl_frame **qc_subextract_frame, cpl_frame **qc_s2ddiv1d_frame, cpl_frame **qc_model_frame, cpl_frame **qc_weight_frame)
 Create a SPECTRUM 1D from a Science frame.
void xsh_opt_extract_orders (cpl_frame *sci_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *loc_frame, cpl_frame *spectralformat_frame, cpl_frame *masterflat_frame, xsh_instrument *instrument, xsh_opt_extract_param *opt_extract_par, int min_index, int max_index, const char *rec_refix, cpl_frame **orderext1d_frame, cpl_frame **orderoxt1d_frame, cpl_frame **orderoxt1d_eso_frame, cpl_frame **qc_subextract_frame, cpl_frame **qc_s2ddiv1d_frame, cpl_frame **qc_model_frame, cpl_frame **qc_weight_frame)
 Create a SPECTRUM 1D from a Science frame.
cpl_frame * xsh_combine_nod (cpl_frameset *frames, xsh_combine_nod_param *param, const char *fname, xsh_instrument *instrument, cpl_frame **res_frame_ext)
cpl_frame * xsh_create_master_bias2 (cpl_frameset *rawFrames, xsh_stack_param *stack_par, xsh_instrument *instr, const char *result_name, const int method_code)
 Creates master bias.
cpl_frame * xsh_compute_slice_dist (cpl_frameset *loc_frame_set, cpl_frame *order_tab, cpl_frame *slitmap_frame, cpl_frameset *merge_frameset, double lambda, xsh_instrument *instrument)
cpl_frame * xsh_format (cpl_frameset *rect_frame_set, const char *result_name, xsh_instrument *instrument, const char *rec_prefix)
cpl_frame * xsh_cube (cpl_frameset *merge2d_frameset, xsh_instrument *instrument, const char *rec_prefix)
 Create a cube.
void xsh_center_cube (cpl_frame *cube_frame, cpl_frame *sky_line_frame, int chunk_size, xsh_instrument *instrument)
 Shift a cube to center object at 0 arcsec.
cpl_frameset * xsh_subtract_sky_offset (cpl_frameset *object_raws, cpl_frameset *sky_raws, int nraws, xsh_instrument *instrument)
cpl_frame * xsh_combine_offset (cpl_frameset *rawFrames, const char *result_name, xsh_stack_param *stack_par, xsh_instrument *instr, cpl_imagelist **list, cpl_image **crh_ima, const int save_tmp)
cpl_frame * xsh_compute_response (cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, xsh_instrument *instrument, double exptime)
cpl_frame * xsh_compute_response2 (cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, cpl_frame *tell_mod_cat_frame, xsh_instrument *instrument, double exptime, const int tell_corr)
cpl_frame * xsh_compute_response_ord (cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, xsh_instrument *instrument, double exptime)
void xsh_data_check_spectralformat (cpl_frame *spectralformat_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_config, xsh_instrument *instr)
 Check the borders of wavelength foreach orders in spectral format.
cpl_error_code xsh_wavemap_qc (cpl_frame *frm_map, const cpl_frame *frm_tab)
 Monitor Flux level along the orders traces given by an input table.
cpl_error_code xsh_wavetab_qc (cpl_frame *frm_tab, const int is_poly)
 Monitor min/max/med/avg distance between detected lines on each ordee.
cpl_frame * xsh_flexcor (cpl_frame *afc_frame, cpl_frame *wave_tab_frame, cpl_frame *model_config_frame, cpl_frame *order_tab_frame, cpl_frame *attresidtab_frame, int afc_xmin, int afc_ymin, xsh_instrument *instr, cpl_frame **afc_order_tab_frame, cpl_frame **afc_model_config_frame)
 This function applies the computed shift betwwen AFC CAL and AFC ATT frame.
cpl_frame * xsh_afcthetab_create (cpl_frame *wave_tab_frame, cpl_frame *model_config_frame, int order, cpl_frame *spectralformat_frame, cpl_frame *arclines_frame, int xmin, int ymin, xsh_instrument *instr, const int clean_tmp)
 Create a The tab for AFC.
cpl_frameset * xsh_ifu_wavetab_create (cpl_frame *wave_tab_frame, cpl_frame *shift_tab_frame, xsh_instrument *instr)
 Create an IFU wave tab frame set.
cpl_frame * xsh_calibrate_flux (cpl_frame *spectrum_frame, cpl_frame *respon_frame, cpl_frame *atmos_ext_frame, const char *fname, xsh_instrument *instrument)
cpl_frame * xsh_create_dispersol_physmod (cpl_frame *pre_frame, cpl_frame *order_tab_frame, cpl_frame *mod_cfg_frame, cpl_frame *wave_map_frame, cpl_frame *slit_map_frame, xsh_dispersol_param *dispsol_param, cpl_frame *spectral_format_frame, xsh_instrument *instrument, const int clean_tmp)
cpl_frame * xsh_compute_absorp (cpl_frame *s1d_frame, cpl_frame *telllist_frame, int filter_hsize, double threshold, xsh_instrument *instr)
 Compute the shift in slit between reference wavelength and others for all the slitlets.
void xsh_mark_tell (cpl_frame *s1d_frame, cpl_frame *tellmask_frame)
 Mark telluric in spectrum.

Define Documentation

#define GUESS_TELL_MASK_RESOLUTION_NIR   11300

Definition at line 730 of file xsh_drl.h.

Referenced by xsh_compute_absorp().

#define GUESS_TELL_MASK_RESOLUTION_UVB   9100

Definition at line 728 of file xsh_drl.h.

Referenced by xsh_compute_absorp().

#define GUESS_TELL_MASK_RESOLUTION_VIS   17400

Definition at line 729 of file xsh_drl.h.

Referenced by xsh_compute_absorp().

#define LEND_COLUMN_NAME   "LAMBDAEND"

Definition at line 727 of file xsh_drl.h.

Referenced by xsh_compute_absorp().

#define LSTART_COLUMN_NAME   "LAMBDASTART"

Definition at line 726 of file xsh_drl.h.

Referenced by xsh_compute_absorp().

#define PICKUP_NOISE_HOT_PIXEL_MAP

Definition at line 51 of file xsh_drl.h.

#define REGDEBUG_BLAZE   0

Definition at line 583 of file xsh_drl.h.

#define REGDEBUG_EXTRACT   0

Definition at line 584 of file xsh_drl.h.

#define REGDEBUG_EXTRACT_STD   0

Definition at line 587 of file xsh_drl.h.

#define REGDEBUG_EXTRACT_XY   0

Definition at line 585 of file xsh_drl.h.

#define REGDEBUG_GAUSSIAN   0

Definition at line 582 of file xsh_drl.h.

#define REGDEBUG_N   0

Definition at line 588 of file xsh_drl.h.

#define REGDEBUG_OPTEXTRACT   0

Definition at line 60 of file xsh_drl.h.

#define REGDEBUG_SUBEXTRACT_XY   0

Definition at line 586 of file xsh_drl.h.

#define SLIT_PRECISION   0.00001

Definition at line 191 of file xsh_drl.h.

#define SLIT_PRECISION_IFU   0.21

Definition at line 192 of file xsh_drl.h.

#define WAVELENGTH_PRECISION   0.00001
#define XSH_CONCAT ( A,
 )     A ## B

Definition at line 48 of file xsh_drl.h.

#define XSH_DETECT_ARCLINES_MODE_CORRECTED   1

Definition at line 228 of file xsh_drl.h.

Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().

#define XSH_DETECT_ARCLINES_MODE_NORMAL   0

Definition at line 227 of file xsh_drl.h.

Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().

#define XSH_DETECT_ARCLINES_MODE_RECOVER   2

Definition at line 229 of file xsh_drl.h.

Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().

#define XSH_DETECT_ARCLINES_TYPE_MODEL   1
#define XSH_DETECT_ARCLINES_TYPE_POLY   0
#define XSH_DIVIDE_FLAT_THRESH   1e-10

Definition at line 151 of file xsh_drl.h.

Referenced by xsh_divide_flat().

#define XSH_LAMBDA_DIMM   0.0000005

Definition at line 499 of file xsh_drl.h.

Referenced by xsh_convert_seeing().

#define XSH_MATH_SQRT_2   1.4142135623730951
#define XSH_MULTIPLY_FLAT_THRESH   1e+30

Definition at line 155 of file xsh_drl.h.

Referenced by xsh_multiply_flat().

#define XSH_OBJPOS_COLNAME_SLIT   "Slit"

Definition at line 497 of file xsh_drl.h.

Referenced by main(), xsh_compute_shift_ifu_slitlet(), and xsh_localize_ifu_slitlet().

#define XSH_OBJPOS_COLNAME_WAVELENGTH   "Wavelength"

Definition at line 495 of file xsh_drl.h.

Referenced by main(), xsh_compute_shift_ifu_slitlet(), and xsh_localize_ifu_slitlet().

#define XSH_OBJPOS_NB_COL   2

Definition at line 494 of file xsh_drl.h.

#define XSH_OBJPOS_UNIT_SLIT   "arcsec"

Definition at line 498 of file xsh_drl.h.

Referenced by xsh_localize_ifu_slitlet().

#define XSH_OBJPOS_UNIT_WAVELENGTH   "nm"

Definition at line 496 of file xsh_drl.h.

Referenced by xsh_localize_ifu_slitlet().

#define XSH_RECTIFY_TYPE_MODEL   1

Definition at line 378 of file xsh_drl.h.

Referenced by xsh_rectify_orders().

#define XSH_RECTIFY_TYPE_POLY   0

Definition at line 377 of file xsh_drl.h.

Referenced by xsh_rectify_orders().

#define XSH_SHIFTIFU_COLNAME_SHIFTSLIT   "Slit_shift"

Definition at line 517 of file xsh_drl.h.

Referenced by fill_rectified(), xsh_compute_shift_ifu_slitlet(), and xsh_shift_offsettab().

#define XSH_SHIFTIFU_COLNAME_WAVELENGTH   "Wavelength"

Definition at line 515 of file xsh_drl.h.

Referenced by fill_rectified(), and xsh_compute_shift_ifu_slitlet().

#define XSH_SHIFTIFU_NB_COL   2

Definition at line 514 of file xsh_drl.h.

#define XSH_SHIFTIFU_UNIT_SHIFTSLIT   "arcsec"

Definition at line 518 of file xsh_drl.h.

Referenced by xsh_compute_shift_ifu_slitlet().

#define XSH_SHIFTIFU_UNIT_WAVELENGTH   "nm"

Definition at line 516 of file xsh_drl.h.

Referenced by xsh_compute_shift_ifu_slitlet().

#define XSH_STRING (  )     # A

Definition at line 49 of file xsh_drl.h.


Enumeration Type Documentation

Enumerator:
XSH_SOLUTION_ABSOLUTE 
XSH_SOLUTION_RELATIVE 

Definition at line 231 of file xsh_drl.h.


Function Documentation

cpl_frame* xsh_compute_response ( cpl_frame *  spectrum_frame,
cpl_frame *  flux_std_star_cat_frame,
cpl_frame *  atmos_ext_frame,
cpl_frame *  high_abs_frame,
xsh_instrument instrument,
double  exptime 
)

Compute the instrument response using the rectified frame and the Standard star flux frame. The input should include also the Master Response Function and the Athmospheric Extinction Curve. Also should be produced the Efficiency frame.

Parameters:
spectrum_frame Rectified frame (1D spectrum)
flux_std_star_cat_frame Standard star flux catalog frame
atmos_ext_frame Atmospheric Extinction Frame
instrument Instrument strcture
exptime Exposure time
Returns:
Frame of the computed response

< computed response frame

< Std star flux

< Std star flux

< 1d spectrum

< 1d spectrum

Definition at line 3222 of file xsh_compute_response.c.

References check, check_msg, do_compute(), INTERPOL_WSTEP_NM, STAR_MATCH_DEPSILON, xsh_add_temporary_file(), XSH_ARM_NIR, XSH_ASSURE_NOT_NULL, XSH_ATMOS_EXT, xsh_atmos_ext_list_free(), xsh_atmos_ext_list_load(), xsh_fill_high_abs_regions(), xsh_frame_product(), xsh_frame_sci_get_ra_dec_airmass(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), xsh_instrument_mode_tostring(), xsh_msg, xsh_msg_warning, xsh_parse_catalog_std_stars(), xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_get_gain(), xsh_pfits_get_naxis1(), xsh_response_merge_obj_std_info(), xsh_spectrum_free(), xsh_spectrum_interpolate(), xsh_spectrum_load(), xsh_spectrum_resample(), xsh_spectrum_save(), xsh_star_flux_list_free(), xsh_star_flux_list_load(), and xsh_star_flux_list_save().

Referenced by xsh_util_integrate().

cpl_frame* xsh_compute_response2 ( cpl_frame *  obs_std_star,
cpl_frame *  flux_std_star_cat,
cpl_frame *  atmos_ext,
cpl_frame *  high_abs,
cpl_frame *  tell_mod_cat,
xsh_instrument instrument,
double  exptime,
const int  tell_corr 
)

Compute the instrument response using the rectified frame and the Standard star flux frame. The input should include also the Master Response Function and the Athmospheric Extinction Curve. Also should be produced the Efficiency frame.

Parameters:
obbs_std_star Rectified frame (1D spectrum)
flux_std_star_cat Standard star flux catalog frame
atmos_ext Atmospheric Extinction Frame
instrument Instrument structure
exptime Exposure time
tell_corr apply telluric correction
Returns:
Frame of the computed response

Definition at line 2874 of file xsh_compute_response.c.

References check, xsh_star_flux_list::flux, xsh_star_flux_list::lambda, xsh_star_flux_list::size, STAR_MATCH_DEPSILON, xsh_rv_ref_wave_param::wguess, xsh_add_temporary_file(), XSH_ARM_NIR, XSH_ARM_UVB, XSH_ASSURE_NOT_NULL, xsh_bspline_fit(), xsh_fill_high_abs_regions(), xsh_frame_product(), xsh_frame_sci_get_ra_dec_airmass(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), xsh_instrument_mode_tostring(), xsh_msg, xsh_msg_warning, xsh_obs_std_correct(), xsh_parse_catalog_std_stars(), xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_get_naxis1(), xsh_response_merge_obj_std_info(), xsh_rv_ref_wave_init(), xsh_rv_ref_wave_param_create(), xsh_rv_ref_wave_param_destroy(), xsh_spectrum_interpolate_linear(), xsh_spectrum_load(), xsh_star_flux_list_divide(), xsh_star_flux_list_duplicate(), xsh_star_flux_list_extrapolate_wave_end(), xsh_star_flux_list_filter_lowpass(), xsh_star_flux_list_filter_median(), xsh_star_flux_list_free(), xsh_star_flux_list_load(), xsh_star_flux_list_load_spectrum(), xsh_star_flux_list_save(), xsh_star_flux_list_to_frame(), xsh_std_star_spectra_correlate(), xsh_table_shift_rv(), and xsh_telluric_model_eval().

Referenced by xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), and xsh_util_compute_response().

cpl_frame* xsh_compute_response_ord ( cpl_frame *  spectrum_frame,
cpl_frame *  flux_std_star_cat_frame,
cpl_frame *  atmos_ext_frame,
cpl_frame *  high_abs_win_frame,
xsh_instrument instrument,
double  exptime 
)

Compute the instrument response using the rectified frame and the Standard star flux frame. The input should include also the Master Response Function and the Athmospheric Extinction Curve. Also should be produced the Efficiency frame.

Parameters:
spectrum_frame Rectified frame (1D spectrum)
flux_std_star_cat_frame Standard star flux catalog frame
atmos_ext_frame Atmospheric Extinction Frame
instrument Instrument strcture
exptime Exposure time
Returns:
Frame of the computed response

< computed response frame

< Std star flux

< obj star flux

< 1d spectrum

< 1d spectrum

Definition at line 3408 of file xsh_compute_response.c.

References check, check_msg, do_compute(), INTERPOL_WSTEP_NM, STAR_MATCH_DEPSILON, xsh_add_temporary_file(), XSH_ARM_NIR, XSH_ASSURE_NOT_NULL, xsh_atmos_ext_list_free(), xsh_atmos_ext_list_load(), xsh_fill_high_abs_regions(), xsh_frame_product(), xsh_frame_sci_get_ra_dec_airmass(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), xsh_instrument_mode_tostring(), xsh_msg, xsh_msg_warning, xsh_parse_catalog_std_stars(), xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_get_gain(), xsh_pfits_get_naxis1(), xsh_spectrum_free(), xsh_spectrum_interpolate(), xsh_spectrum_load_order(), xsh_spectrum_save_order(), xsh_star_flux_list_free(), xsh_star_flux_list_load(), and xsh_star_flux_list_save_order().

Referenced by xsh_respon_slit_nod(), xsh_respon_slit_offset(), and xsh_respon_slit_stare().

void xsh_compute_slitlet_center ( xsh_order_list order_list,
cpl_frame *  slitmap_frame,
double *  down,
double *  cen,
double *  up,
XSH_ARM  arm 
)
cpl_frame* xsh_create_dispersol_physmod ( cpl_frame *  pre_frame,
cpl_frame *  order_tab_frame,
cpl_frame *  mod_cfg_frame,
cpl_frame *  wave_map_frame,
cpl_frame *  slit_map_frame,
xsh_dispersol_param dispsol_param,
cpl_frame *  spectral_format_frame,
xsh_instrument instrument,
const int  clean_tmp 
)
void xsh_create_map ( cpl_frame *  dispsol_frame,
cpl_frame *  ordertab_frame,
cpl_frame *  pre_frame,
xsh_instrument instrument,
cpl_frame **  wavemap_frame,
cpl_frame **  slitmap_frame,
const char *  rec_prefix 
)
void xsh_create_model_map ( cpl_frame *  model_frame,
xsh_instrument instrument,
const char *  wave_map_tag,
const char *  slit_map_tag,
cpl_frame **  wavemap_frame,
cpl_frame **  slitmap_frame,
const int  save_tmp 
)
cpl_frame* xsh_create_order_table ( cpl_frame *  in_frame,
cpl_frame *  spectralformat_frame,
cpl_frame *  resid_frame,
cpl_frame *  arclines,
xsh_detect_arclines_param da,
xsh_clipping_param dac,
xsh_instrument instrument 
)
cpl_frame* xsh_create_poly_wavemap ( cpl_frame *  pre_frame,
cpl_frame *  wave_tab_2d_frame,
cpl_frame *  order_tab_frame,
cpl_frame *  spectral_format_frame,
xsh_dispersol_param dispsol_par,
xsh_instrument instrument,
const char *  filename,
cpl_frame **  dispersol_frame,
cpl_frame **  slitmap_frame 
)
cpl_frame* xsh_create_wavemap ( cpl_frame *  in_frame,
cpl_frame *  resid_frame,
cpl_frame *  order_frame,
xsh_dispersol_param dispersol_param,
xsh_instrument instrument 
)
cpl_error_code xsh_wavemap_qc ( cpl_frame *  frm_map,
const cpl_frame *  frm_tab 
)

Monitor Flux level along the orders traces given by an input table.

Parameters:
frm_map The input frame image whose flux is to be monitored
frm_tab input frame table with order traces
Returns:
The input frame image FITS header is updated with flux level QC parameters

Definition at line 565 of file xsh_create_wavemap.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), XSH_QC_WMAP_WAVEC, and xsh_update_pheader_in_image_multi().

Referenced by xsh_2dmap().

cpl_error_code xsh_wavetab_qc ( cpl_frame *  frm_tab,
const int  is_poly 
)

Monitor min/max/med/avg distance between detected lines on each ordee.

Parameters:
frm_tab input frame table with order traces
is_poly data reduction method
Returns:
The input frame image FITS header is updated with flux level QC parameters

Definition at line 643 of file xsh_create_wavemap.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_msg_warning, XSH_QC_LINE_DIFAVG, XSH_QC_LINE_DIFAVG_C, XSH_QC_LINE_DIFMAX, XSH_QC_LINE_DIFMAX_C, XSH_QC_LINE_DIFMAX_ORD, XSH_QC_LINE_DIFMED, XSH_QC_LINE_DIFMED_C, XSH_QC_LINE_DIFMIN, XSH_QC_LINE_DIFMIN_C, and XSH_QC_LINE_DIFMIN_ORD.

Referenced by xsh_2dmap(), and xsh_predict().


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1