X-shooter Pipeline Reference Manual 3.8.15
Functions
Localize objects (xsh_localize_obj)

Functions

static void chunk_coadd (double *data, double *flux, int *qual, int nx, int ny, int ifirst, int ilast, const int decode_bp, int *skymask)
 
static void tab_minmax_get_index (double *data, int size, xsh_slit_limit_param *slit_limit_par, int *min, int *max)
 
static xsh_localizationxsh_localize_obj_auto (cpl_frame *merge_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slitlimit_par, const int decode_bp)
 Build localization table frame from the rectified table frame.
 
static xsh_localizationxsh_localize_obj_manual (xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par)
 
cpl_frame * xsh_localize_obj (cpl_frame *rec_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slitlimit_par, const char *fname)
 Build the localization table.
 
cpl_frameset * xsh_localize_obj_ifu (cpl_frameset *rec_frameset, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *locobj_par, xsh_slit_limit_param *slitlimit_par)
 
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 *instrument)
 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 *prefix)
 Localize center of object on a merge 2D IFU slitlet.
 

Detailed Description

Function ...

Function Documentation

◆ chunk_coadd()

static void chunk_coadd ( double *  data,
double *  flux,
int *  qual,
int  nx,
int  ny,
int  ifirst,
int  ilast,
const int  decode_bp,
int *  skymask 
)
static

◆ tab_minmax_get_index()

static void tab_minmax_get_index ( double *  data,
int  size,
xsh_slit_limit_param slit_limit_par,
int *  min,
int *  max 
)
static

◆ xsh_convert_seeing()

double xsh_convert_seeing ( cpl_frame *  frame)

Convert seeing keywork in mu sigma.

Parameters
[in]Objectframe
Returns
mu sigma

Definition at line 959 of file xsh_localize_obj.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_propertylist(), XSH_LAMBDA_DIMM, xsh_msg, xsh_pfits_get_airm_mean(), xsh_pfits_get_seeing_end(), and xsh_pfits_get_seeing_start().

◆ xsh_localize_ifu()

cpl_frameset * xsh_localize_ifu ( cpl_frameset *  merge2d_frameset,
cpl_frame *  skymask_frame,
xsh_localize_ifu_param locifu_par,
xsh_instrument instrument,
const char *  prefix 
)

Localize center of object on a merge 2D IFU slitlet.

Parameters
[in]merge2d_slitletmerge 2D IFU slitlet
[in]smooth_hsizeHalf size of median filter using for smoothing
[in]nscalesnscales use for atrous decomposition
[in]HF_skipNumber of skipping High Frequency used to reconstruct signal
[in]prefixof result table
Returns
frame containing for Wavelength the position of object center on the slit

Definition at line 1527 of file xsh_localize_obj.c.

References xsh_localize_ifu_param::bckg_deg, xsh_localize_ifu_param::box_hsize, check, xsh_localize_ifu_param::cut_sigma_low, xsh_localize_ifu_param::cut_sigma_up, xsh_localize_ifu_param::cut_snr_low, xsh_localize_ifu_param::cut_snr_up, xsh_localize_ifu_param::HF_skip, instrument, LOWER_IFU_SLITLET, xsh_localize_ifu_param::nscales, SlitletName, xsh_localize_ifu_param::slitlow_edges_mask, xsh_localize_ifu_param::slitup_edges_mask, xsh_localize_ifu_param::smooth_hsize, xsh_localize_ifu_param::use_skymask, XSH_ASSURE_NOT_NULL, xsh_free_frameset(), xsh_free_propertylist(), xsh_instrument_arm_tostring(), xsh_localize_ifu_slitlet(), xsh_msg, xsh_pfits_get_rectify_space_max(), and xsh_pfits_get_rectify_space_min().

Referenced by xsh_geom_ifu().

◆ xsh_localize_ifu_slitlet()

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 instrument 
)

Localize center of object on a merge 2D IFU slitlet.

Parameters
[in]merge2d_slitletmerge 2D IFU slitlet
[in]smooth_hsizeHalf size of median filter using for smoothing
[in]nscalesnscales use for atrous decomposition
[in]HF_skipNumber of skipping High Frequency used to reconstruct signal
[in]resnameName of result table
[in]cut_sigma_lowGaussian fits of the cross-dispersion profile whose FWHM is lower than this value are rejected
[in]cut_sigma_upGaussian fits of the cross-dispersion profile whose FWHM is upper than this value are rejected
[in]cut_snr_lowGaussian fits of the cross-dispersion profile whose SNR is lower than this value are rejected
[in]cut_snr_upGaussian fits of the cross-dispersion profile whose SNR is upper than this value are rejected
[in]box_hsizeHalf size of running chunk box
[in]slit_minmin slit value
[in]slit_maxmax slit value
[in]degpoly degree
[in]box_hsizehalf size of box
[in]instrumentarm setting
Returns
frame containing for Wavelength the position of object center on the slit

Definition at line 1018 of file xsh_localize_obj.c.

References check, xsh_instrument::decode_bp, xsh_spectrum::flux_header, instrument, M_PI, sigma, xsh_spectrum::size_lambda, xsh_spectrum::size_slit, xsh_spectrum::slit_min, xsh_spectrum::slit_step, width, xsh_add_temporary_file(), XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_atrous(), XSH_CALLOC, xsh_data_interpolate(), xsh_debug_level_get(), XSH_DEBUG_LEVEL_MEDIUM, xsh_error_reset, xsh_frame_product(), XSH_FREE, xsh_free_matrix(), xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_gsl_fit_gaussian(), xsh_gsl_init_gaussian_fit(), XSH_MALLOC, XSH_MATH_SQRT_2, xsh_msg_dbg_low, xsh_msg_dbg_medium, XSH_OBJPOS_COLNAME_SLIT, XSH_OBJPOS_COLNAME_WAVELENGTH, XSH_OBJPOS_UNIT_SLIT, XSH_OBJPOS_UNIT_WAVELENGTH, xsh_pfits_get_slit_width(), XSH_REGDEBUG, xsh_resolution_get(), xsh_round_double(), xsh_sort_table_1(), xsh_spectrum_free(), xsh_spectrum_get_errs(), xsh_spectrum_get_flux(), xsh_spectrum_get_lambda_min(), xsh_spectrum_get_lambda_step(), xsh_spectrum_get_qual(), xsh_spectrum_load(), XSH_TABLE_FREE, XSH_TABLE_LOAD, XSH_TABLE_NEW_COL, and xsh_unwrap_vector().

Referenced by xsh_localize_ifu().

◆ xsh_localize_obj()

cpl_frame * xsh_localize_obj ( cpl_frame *  rec_frame,
cpl_frame *  skymask_frame,
xsh_instrument instrument,
xsh_localize_obj_param loc_obj_par,
xsh_slit_limit_param slitlimit_par,
const char *  fname 
)

Build the localization table.

Parameters
[in]rec_frameRectified frame (from xsh_rectify) or NULL in MANUAL mode
[in]skymask_framesky mask frame
[in]instrumentPointer to instrument description structure
[in]loc_obj_parParameters for localization
[in]slitlimit_parParameters defining slit limits
[in]fnameoutput filename
Returns
Localization Table

Definition at line 220 of file xsh_localize_obj.c.

References check, xsh_instrument::decode_bp, instrument, LOC_MANUAL_METHOD, LOCALIZE_METHOD_PRINT, xsh_localize_obj_param::method, xsh_localize_obj_param::slit_hheight, xsh_localize_obj_param::slit_position, xsh_add_temporary_file(), XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_instrument_arm_tostring(), xsh_localization_free(), xsh_localization_save(), xsh_localize_obj_auto(), xsh_localize_obj_manual(), xsh_merge_ord(), xsh_msg_dbg_low, and xsh_msg_dbg_medium.

Referenced by main(), xsh_localize_obj_ifu(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_scired_slit_nod(), xsh_scired_slit_nod_accurate(), xsh_scired_slit_offset(), and xsh_slit_stare_correct_crh_and_sky().

◆ xsh_localize_obj_auto()

static xsh_localization * xsh_localize_obj_auto ( cpl_frame *  merge_frame,
cpl_frame *  skymask_frame,
xsh_instrument instrument,
xsh_localize_obj_param loc_obj_par,
xsh_slit_limit_param slitlimit_par,
const int  decode_bp 
)
static

Build localization table frame from the rectified table frame.

Parameters
[in]merge_frameMerge frame (from xsh_merge_ord) or NULL in MANUAL mode
[in]skymask_frameSky mask frame
[in]instrumentPointer to instrument description structure
[in]loc_obj_parParameters for localization @params[in] slitlimit_par Parameters to define slit limits @params[in] decode_bp Bad pixel code
Returns
Localization Table

Definition at line 343 of file xsh_localize_obj.c.

References xsh_localization::cenpoly, check, chunk_coadd(), xsh_localization::edglopoly, xsh_localization::edguppoly, xsh_spectrum::flux, xsh_spectrum::flux_header, instrument, kappa, xsh_localize_obj_param::kappa, xsh_spectrum::lambda_min, lambda_step, xsh_spectrum::lambda_step, xsh_localize_obj_param::loc_chunk_nb, xsh_localize_obj_param::loc_deg_poly, LOC_GAUSSIAN_METHOD, xsh_localize_obj_param::loc_thresh, xsh_localize_obj_param::method, niter, xsh_localize_obj_param::niter, xsh_localize_obj_param::nod_step, xsh_localization::pol_degree, xsh_spectrum::qual, sigma, xsh_spectrum::slit_min, slit_step, xsh_spectrum::slit_step, tab_minmax_get_index(), threshold, xsh_localize_obj_param::use_skymask, width, XSH_ARCSEC_NIR, XSH_ARCSEC_UVB, XSH_ARCSEC_VIS, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_debug_level_get(), XSH_DEBUG_LEVEL_MEDIUM, xsh_error_reset, XSH_FREE, xsh_free_polynomial(), xsh_free_table(), xsh_free_vector(), xsh_instrument_get_arm(), xsh_localization_create(), xsh_msg_dbg_low, xsh_msg_dbg_medium, xsh_msg_warning, xsh_pfits_get_slit_width(), xsh_polynomial_fit_1d_create(), xsh_resolution_get(), xsh_round_double(), xsh_sort_table_1(), xsh_spectrum_free(), xsh_spectrum_get_size_lambda(), xsh_spectrum_get_size_slit(), xsh_spectrum_load(), XSH_TABLE_LOAD, and xsh_unwrap_vector().

Referenced by xsh_localize_obj().

◆ xsh_localize_obj_ifu()

cpl_frameset * xsh_localize_obj_ifu ( cpl_frameset *  rec_frameset,
cpl_frame *  skymask_frame,
xsh_instrument instrument,
xsh_localize_obj_param locobj_par,
xsh_slit_limit_param slitlimit_par 
)

◆ xsh_localize_obj_manual()

static xsh_localization * xsh_localize_obj_manual ( xsh_instrument instrument,
xsh_localize_obj_param loc_obj_par 
)
static