xsh_follow_arclines
[DRL Functions]

Data Structures

struct  CENTROIDS

Defines

#define XSH_SPECRES_CLIP_KAPPA   3.
#define XSH_SPECRES_CLIP_NITER   2
#define XSH_SPECRES_CLIP_FRAC   0.5

Enumerations

enum  { LAMBDA_FOUND, LAMBDA_TOO_SMALL, LAMBDA_NOT_FOUND }
enum  {
  FIND_TILT_UNKNOW_ORDER = 1, FIND_TILT_BAD_EDGES, FIND_TILT_BAD_CENTER, FIND_TILT_CLIPPED,
  FIND_TILT_BAD_FIT
}

Functions

static int detect_centroid (xsh_pre *pre, float lambda, int ordnum, double xpix, double ypix, xsh_follow_arclines_param *follow_param, int is_center, XSH_GAUSSIAN_FIT *fit_res)
static cpl_polynomial * get_slit_ifu_lo_poly (xsh_order *porder, int ifu_flag)
static cpl_polynomial * get_slit_ifu_up_poly (xsh_order *porder, int ifu_flag)
static int find_tilt (double yp0, double xc, float lambda, int ordnum, xsh_follow_arclines_param *follow_param, xsh_pre *pre, xsh_order_list *orders, xsh_instrument *instrument, double *slope, double *chisq, double *minx, double *maxx, int *nt, int *ng, double *fwhm_center, double *good_center, int ifu_flag)
static float linear_interpol (float xa, float ya, float xb, float yb, float x)
static float get_lambda (float *data, float x, float y, int nx, int ny)
static void compute_specres (cpl_frame *wavemap_frame, cpl_frame *disptab_frame, xsh_instrument *instr, xsh_linetilt_list *tilt_list, int niter, double kappa, double frac, double *specres_med, double *specres_stdev)
static void set_qc_parameters (cpl_propertylist *tilt_header, cpl_propertylist *shift_header, double *ypos, double *width, double *intens, xsh_linetilt_list *tilt_list, xsh_instrument *instrument, int nlinecat, int nb_lines, double specres_med, double specres_stdev)
static void clean_arclist_data (cpl_frame *wavesol_frame, cpl_frame *arclines_frame, xsh_order_list *orders, cpl_frame *config_model_frame, cpl_frame *pre_frame, cpl_frame *spectralformat_frame, double **lambda, double **n, double **x, double **y, double **xmin, double **xmax, int *size, double slit, double slit_min, double slit_max, xsh_instrument *instrument)
static void xsh_follow_arclines (cpl_frame *pre_frame, cpl_frame *arclines_frame, cpl_frame *wavesol_frame, cpl_frame *order_frame, cpl_frame *spectralformat_frame, cpl_frame *config_model_frame, cpl_frame *wavemap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *follow_param, double slit, double slit_min, double slit_max, const char *tag_id, int ifu_flag, xsh_instrument *instrument, cpl_frame **tilt_frame, cpl_frame **shift_frame, const int clean_tmp)
 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_follow_arclines_slit (cpl_frame *pre_frame, cpl_frame *arclines_frame, cpl_frame *wavesol_frame, cpl_frame *order_frame, cpl_frame *spectralformat_frame, cpl_frame *config_model_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *follow_param, xsh_instrument *instrument, cpl_frame **tilt_frame, cpl_frame **shift_frame)
void xsh_follow_arclines_ifu (cpl_frame *pre_frame, cpl_frame *arclines_frame, cpl_frame *wavesol_frame, cpl_frame *order_frame, cpl_frame *spectralformat_frame, cpl_frame *config_model_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.

Variables

static const char * fwhm_debug_mode = NULL

Detailed Description

Functions used to detect and follow arc lines, compute center, width and tilt parameters.


Define Documentation

#define XSH_SPECRES_CLIP_FRAC   0.5

Definition at line 76 of file xsh_follow_arclines.c.

#define XSH_SPECRES_CLIP_KAPPA   3.

Definition at line 74 of file xsh_follow_arclines.c.

#define XSH_SPECRES_CLIP_NITER   2

Definition at line 75 of file xsh_follow_arclines.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
LAMBDA_FOUND 
LAMBDA_TOO_SMALL 
LAMBDA_NOT_FOUND 

Definition at line 84 of file xsh_follow_arclines.c.

anonymous enum
Enumerator:
FIND_TILT_UNKNOW_ORDER 
FIND_TILT_BAD_EDGES 
FIND_TILT_BAD_CENTER 
FIND_TILT_CLIPPED 
FIND_TILT_BAD_FIT 

Definition at line 88 of file xsh_follow_arclines.c.


Function Documentation

static void clean_arclist_data ( cpl_frame *  wavesol_frame,
cpl_frame *  arclines_frame,
xsh_order_list orders,
cpl_frame *  config_model_frame,
cpl_frame *  pre_frame,
cpl_frame *  spectralformat_frame,
double **  lambda,
double **  n,
double **  x,
double **  y,
double **  xmin,
double **  xmax,
int *  size,
double  slit,
double  slit_min,
double  slit_max,
xsh_instrument instrument 
) [static]
static void compute_specres ( cpl_frame *  wavemap_frame,
cpl_frame *  disptab_frame,
xsh_instrument instr,
xsh_linetilt_list tilt_list,
int  niter,
double  kappa,
double  frac,
double *  specres_med,
double *  specres_stdev 
) [static]

Compute the spectral resolution using the wave map.

Parameters:
wavemap_frame wave map frame
disptab_frame dispersion table frame
instr Instrument structure
tilt_list Line tilt list frame
niter number of iterations for kappa sigma clip of outliers
kappa kappa value used in kappa sigma clip of outliers
frac minimum fraction of detector's good pixels
specres_med vector with median values of spectral resolution
specres_stdev vector with stdev values of spectral resolution

Definition at line 556 of file xsh_follow_arclines.c.

References xsh_dispersol::absorder, xsh_linetilt::cenposx, check, xsh_linetilt::deltay, xsh_linetilt::flag, get_lambda(), xsh_dispersol::lambda_poly, xsh_dispersol_list::list, xsh_linetilt_list::list, nx, ny, xsh_linetilt::order, xsh_linetilt_list::size, xsh_linetilt::specres, xsh_linetilt::tilt, xsh_linetilt::tilt_y, xsh_linetilt::wavelength, xsh_array_clip_median(), XSH_ASSURE_NOT_NULL, xsh_dispersol_list_eval(), xsh_dispersol_list_free(), xsh_dispersol_list_load(), xsh_free_array(), xsh_free_image(), xsh_free_vector(), xsh_msg, and xsh_msg_dbg_high.

Referenced by xsh_follow_arclines().

static int detect_centroid ( xsh_pre pre,
float  lambda,
int  ordnum,
double  xpix,
double  y,
xsh_follow_arclines_param follow_param,
int  is_center,
XSH_GAUSSIAN_FIT fit_res 
) [static]

Along the X axis, detect the centers of the line, fit the centers to get the tilt.

Parameters:
pre Scientific Frame (xsh_pre format)
lambda Wavelength
ordnum Order number
xpix X position of the initial center (in [1,nx])
y Y position of the initial center (in [1,ny])
follow_param Parameters used to follow the line
is_center parameter NOT USED!!
fit_res Result of the tilt fit
Returns:
0 if OK, 1 otherwise (can not fit)

Definition at line 129 of file xsh_follow_arclines.c.

References XSH_GAUSSIAN_FIT::area, check, xsh_pre::data, first, last, M_PI, nx, xsh_pre::nx, xsh_pre::ny, ny, XSH_GAUSSIAN_FIT::offset, XSH_GAUSSIAN_FIT::peakpos, xsh_follow_arclines_param::range, XSH_GAUSSIAN_FIT::sigma, x, XSH_ASSURE_NOT_ILLEGAL, xsh_debug_level_get(), XSH_DEBUG_LEVEL_HIGH, xsh_free_vector(), xsh_msg_dbg_high, xsh_msg_dbg_low, xsh_msg_dbg_medium, xsh_round_double(), and xsh_vector_fit_gaussian().

Referenced by find_tilt(), and xsh_follow_arclines().

static int find_tilt ( double  yp0,
double  xc,
float  lambda,
int  ordnum,
xsh_follow_arclines_param follow_param,
xsh_pre pre,
xsh_order_list orders,
xsh_instrument instrument,
double *  slope,
double *  chisq,
double *  minx,
double *  maxx,
int *  nt,
int *  ng,
double *  fwhm_center,
double *  good_center,
int  ifu_flag 
) [static]
static float get_lambda ( float *  data,
float  x,
float  y,
int  nx,
int  ny 
) [static]

Definition at line 513 of file xsh_follow_arclines.c.

References linear_interpol(), xsh_msg_dbg_high, and xsh_round_double().

Referenced by compute_specres().

static cpl_polynomial* get_slit_ifu_lo_poly ( xsh_order porder,
int  ifu_flag 
) [static]
static cpl_polynomial* get_slit_ifu_up_poly ( xsh_order porder,
int  ifu_flag 
) [static]
static float linear_interpol ( float  xa,
float  ya,
float  xb,
float  yb,
float  x 
) [static]

Definition at line 504 of file xsh_follow_arclines.c.

Referenced by get_lambda().

static void set_qc_parameters ( cpl_propertylist *  tilt_header,
cpl_propertylist *  shift_header,
double *  ypos,
double *  width,
double *  intens,
xsh_linetilt_list tilt_list,
xsh_instrument instrument,
int  nlinecat,
int  nb_lines,
double  specres_med,
double  specres_stdev 
) [static]
static void xsh_follow_arclines ( cpl_frame *  pre_frame,
cpl_frame *  arclines_frame,
cpl_frame *  wavesol_frame,
cpl_frame *  order_frame,
cpl_frame *  spectralformat_frame,
cpl_frame *  config_model_frame,
cpl_frame *  wavemap_frame,
cpl_frame *  disptab_frame,
xsh_follow_arclines_param follow_param,
double  slit,
double  slit_min,
double  slit_max,
const char *  tag_id,
int  ifu_flag,
xsh_instrument instrument,
cpl_frame **  tilt_frame,
cpl_frame **  shift_frame,
const int  clean_tmp 
) [static]

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.

Parameters:
pre_frame input frame in PRE format
arclines_frame Input image with arcs
wavesol_frame original wavesolution (from 2dmap)
order_frame Order table frame
[in] spectralformat_frame The spectral format
[in] config_model_frame The model configuration frame
[in] wavemap_frame wavemap frame
[in] disptab_frame dispersion solution frame
[in] follow_param parameters to control line tilt determination
[in] slit slit extension value
[in] slit_min min slit value in arcsec
[in] slit_max max slit value in arcsec
[in] tag_id product category
[in] ifu_flag flag to know if arc frame is observed in IFU mode
[in] instrument instrument arm setting
[out] tilt_frame line tilt table frame
[out] shift_frame line shift frame

Definition at line 972 of file xsh_follow_arclines.c.

References XSH_GAUSSIAN_FIT::area, xsh_linetilt::area, xsh_linetilt::cenposx, xsh_linetilt::cenposy, CENTER_SLIT, check, xsh_linetilt::chisq, clean_arclist_data(), compute_specres(), xsh_pre::data, xsh_instrument::decode_bp, xsh_linetilt::deltay, detect_centroid(), xsh_pre::errs, find_tilt(), xsh_clipping_param::frac, xsh_shift_tab::header, xsh_linetilt::intensity, xsh_linetilt::name, xsh_linetilt::ngood, xsh_clipping_param::niter, xsh_linetilt::ntot, nx, ny, xsh_linetilt::order, order, XSH_GAUSSIAN_FIT::peakpos, xsh_linetilt::pre_pos_y, QC_WAVECAL_CATLINE, QC_WAVECAL_FOUNDLINE, QC_WAVECAL_MATCHLINE, xsh_pre::qual, xsh_follow_arclines_param::s_n_min, set_qc_parameters(), xsh_shift_tab::shift_y, xsh_linetilt::shift_y, xsh_shift_tab::shift_y_cen, XSH_GAUSSIAN_FIT::sigma, xsh_clipping_param::sigma, xsh_linetilt_list::size, xsh_linetilt::slit, xsh_linetilt::specres, xsh_follow_arclines_param::specres_clipping, xsh_linetilt::tilt, xsh_linetilt::tilt_y, xsh_linetilt::wavelength, width, xsh_linetilt::xmax, xsh_linetilt::xmin, xsh_add_temporary_file(), XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), xsh_linetilt_list_add(), xsh_linetilt_list_free(), xsh_linetilt_list_new(), xsh_linetilt_list_save(), xsh_linetilt_new(), xsh_msg, xsh_msg_dbg_low, xsh_msg_error, xsh_order_list_free(), xsh_order_list_load(), xsh_pfits_set_qc(), xsh_pre_free(), xsh_pre_load(), xsh_round_double(), xsh_set_image_cpl_bpmap(), xsh_shift_tab_create(), xsh_shift_tab_free(), xsh_shift_tab_save(), XSH_SHIFT_TAB_SLIT, and xsh_unwrap_vector().

Referenced by xsh_follow_arclines_ifu(), and xsh_follow_arclines_slit().

void xsh_follow_arclines_ifu ( cpl_frame *  pre_frame,
cpl_frame *  arclines_frame,
cpl_frame *  wavesol_frame,
cpl_frame *  order_frame,
cpl_frame *  spectralformat_frame,
cpl_frame *  config_model_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.

Parameters:
pre_frame input frame in PRE format
arclines_frame Input image with arcs
wavesol_frame original wavesolution (from 2dmap)
order_frame Order table frame
[in] spectralformat_frame The spectral format
[in] config_model_frame The model configuration frame
[in] wavemap_frame wavemap frame
[in] slitmap_frame wavemap frame
[in] disptab_frame dispersion solution frame
[in] follow_param parameters to control line tilt determination
[in] instrument instrument arm setting
[out] tilt_set line tilt table frame
[out] shift_frame line shift frame

Definition at line 1326 of file xsh_follow_arclines.c.

References check, LOWER_IFU_SLITLET, xsh_shift_tab::shift_y_cen, xsh_shift_tab::shift_y_down, xsh_shift_tab::shift_y_up, SlitletName, UPPER_IFU_SLITLET, XSH_ASSURE_NOT_NULL, xsh_follow_arclines(), xsh_free_frameset(), xsh_get_slit_edges(), XSH_GET_TAG_FROM_ARM, xsh_msg, xsh_msg_dbg_medium, xsh_shift_tab_free(), XSH_SHIFT_TAB_IFU, xsh_shift_tab_load(), and xsh_shift_tab_save().

Referenced by xsh_wavecal().

void xsh_follow_arclines_slit ( cpl_frame *  pre_frame,
cpl_frame *  arclines_frame,
cpl_frame *  wavesol_frame,
cpl_frame *  order_frame,
cpl_frame *  spectralformat_frame,
cpl_frame *  config_model_frame,
cpl_frame *  wavemap_frame,
cpl_frame *  slitmap_frame,
cpl_frame *  disptab_frame,
xsh_follow_arclines_param follow_param,
xsh_instrument instrument,
cpl_frame **  tilt_frame,
cpl_frame **  shift_frame 
)

Definition at line 1267 of file xsh_follow_arclines.c.

References CENTER_SLIT, check, and xsh_follow_arclines().

Referenced by xsh_wavecal().


Variable Documentation

const char* fwhm_debug_mode = NULL [static]

Definition at line 82 of file xsh_follow_arclines.c.

Referenced by find_tilt().


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