X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions
Extract objects (xsh_extract)

Macros

#define debug_extraction   0
 

Functions

static cpl_frame * xsh_extract_with_tag (cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, const char *tag, cpl_frame **res_frame_ext)
 Simple 1D extraction of point source like object.
 
static cpl_error_code xsh_extraction_get_slit_minmax (xsh_localization *loc_list, const double lambda, const double slit_0, const double slit_step, const int nslit, int *ylow, int *yup, double *y_frac_up, double *y_frac_low)
 
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, float *pima, float *fima, float *rima)
 
static cpl_frame * xsh_extract_clean_with_tag (cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, xsh_interpolate_bp_param *ipol_bp_par, const char *tag, cpl_frame **res_frame_ext)
 Simple 1D extraction of point source like object.
 
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_par, 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_frameset, cpl_frameset *loc_frameset, xsh_instrument *instrument, xsh_extract_param *extract_par, const char *rec_prefix)
 Loop on IFU Frames to extract simple 1D (1 per slitlet)
 
static void fill_img (cpl_image *img, int ilambda, cpl_image *down, cpl_image *cen, cpl_image *up, int up_shift, int cen_shift)
 
static void make_data_cube (xsh_pre_3d *pre_3d, xsh_pre *pre_down, xsh_pre *pre_cen, xsh_pre *pre_up)
 
cpl_frame * xsh_format (cpl_frameset *spectrum_frame_set, const char *result_name, xsh_instrument *instrument, const char *rec_prefix)
 
static int * create_sky_mask (cpl_frame *sky_line_frame, int size, double lambda_min, double lambda_step, xsh_instrument *instrument)
 Create a sky mask from a SKY LINE lIST where flag sky lines are 1.
 
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_frame * xsh_cube (cpl_frameset *merge2d_frameset, xsh_instrument *instrument, const char *rec_prefix)
 Create a cube.
 

Detailed Description

Function ...

Macro Definition Documentation

◆ debug_extraction

#define debug_extraction   0

Definition at line 65 of file xsh_extract.c.

Function Documentation

◆ create_sky_mask()

static int * create_sky_mask ( cpl_frame *  sky_line_frame,
int  size,
double  lambda_min,
double  lambda_step,
xsh_instrument instrument 
)
static

Create a sky mask from a SKY LINE lIST where flag sky lines are 1.

Parameters
[in]sky_line_frameA Sky line list
[in]sizeSize of mask
[in]chunk_sizeSize of chunk along wavelength direction

Definition at line 287 of file xsh_format.c.

References check, instrument, lambda_step, size, XSH_CALLOC, XSH_FREE, xsh_instrument_arm_tostring(), xsh_instrument_mode_tostring(), xsh_msg, xsh_msg_dbg_low, xsh_resolution_get(), xsh_round_double(), xsh_sort_table_1(), XSH_TABLE_FREE, and XSH_TABLE_LOAD.

Referenced by xsh_center_cube().

◆ fill_img()

static void fill_img ( cpl_image *  img,
int  ilambda,
cpl_image *  down,
cpl_image *  cen,
cpl_image *  up,
int  up_shift,
int  cen_shift 
)
static

Definition at line 67 of file xsh_format.c.

References check, nx, ny, and xsh_msg_dbg_high.

Referenced by make_data_cube().

◆ make_data_cube()

static void make_data_cube ( xsh_pre_3d pre_3d,
xsh_pre pre_down,
xsh_pre pre_cen,
xsh_pre pre_up 
)
static

◆ xsh_center_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.

Parameters
[in,out]cubeThe Data cube
[in]skylines frame The sky lines table or NULL
[in]chunk_sizeSize of chunk along wavelength direction

Definition at line 343 of file xsh_format.c.

References check, create_sky_mask(), xsh_pre_3d::data_header, instrument, sigma, XSH_ASSURE_NOT_NULL, xsh_error_reset, XSH_FREE, xsh_free_vector(), xsh_image_3d_get_data(), xsh_image_3d_get_size_x(), xsh_image_3d_get_size_y(), xsh_image_3d_get_size_z(), XSH_MALLOC, xsh_msg, xsh_pfits_get_cdelt2(), xsh_pfits_get_cdelt3(), xsh_pfits_get_crval2(), xsh_pfits_get_crval3(), xsh_pre_3d_free(), xsh_pre_3d_get_data(), xsh_pre_3d_load(), xsh_unwrap_vector(), and y.

Referenced by main().

◆ xsh_cube()

cpl_frame * xsh_cube ( cpl_frameset *  merge2d_frameset,
xsh_instrument instrument,
const char *  rec_prefix 
)

◆ xsh_extract()

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

Parameters
[in]rec_frameRectified frame (from xsh_rectify)
[in]loc_frameLocalization table
[in]instrumentInstrument pointer
[in]extract_parParameters for object extraction
[out]res_frame_extextracted frame in ESO format
[in]rec_prefixrecipe prefix (for PRO.CATG definition)
Returns
a rectified frame

Definition at line 808 of file xsh_extract.c.

References check, instrument, xsh_add_temporary_file(), xsh_extract_with_tag(), XSH_GET_TAG_FROM_ARM, and XSH_ORDER1D.

Referenced by main(), and xsh_absorp().

◆ xsh_extract_clean()

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_par,
cpl_frame **  res_frame_ext,
const char *  rec_prefix 
)

simple 1D extraction of point source like object

Parameters
[in]rec_frameRectified frame (from xsh_rectify)
[in]loc_frameLocalization table
[in]instrumentInstrument pointer
[in]extract_parParameters for object extraction
[in]ipol_bp_parParameters for bad pixel interpolation during extraction
[out]res_frame_extextracted frame in ESO format
[in]rec_prefixrecipe prefix (for PRO.CATG definition)
Returns
a rectified frame

Definition at line 836 of file xsh_extract.c.

References check, instrument, xsh_add_temporary_file(), xsh_extract_clean_with_tag(), XSH_GET_TAG_FROM_ARM, and XSH_ORDER1D.

Referenced by main(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_slit_nod(), xsh_scired_slit_offset(), and xsh_scired_slit_stare().

◆ xsh_extract_clean_slice()

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,
float *  pima,
float *  fima,
float *  rima 
)

◆ xsh_extract_clean_with_tag()

static cpl_frame * xsh_extract_clean_with_tag ( cpl_frame *  rec_frame,
cpl_frame *  loc_frame,
xsh_instrument instrument,
xsh_extract_param extract_par,
xsh_interpolate_bp_param ipol_bp_par,
const char *  tag,
cpl_frame **  res_frame_ext 
)
static

◆ xsh_extract_ifu()

cpl_frameset * xsh_extract_ifu ( cpl_frameset *  rec_frameset,
cpl_frameset *  loc_frameset,
xsh_instrument instrument,
xsh_extract_param extract_par,
const char *  rec_prefix 
)

Loop on IFU Frames to extract simple 1D (1 per slitlet)

Parameters
[in]rec_framesetRectified frameset (from xsh_rectify_ifu)
[in]loc_framesetLocalization table frameset (xsh_localize_ifu)
[in]instrumentInstrument pointer
[in]extract_parParameters for object extraction
[in]rec_prefixrecipe prefix (to define PRO.CATG value)
Returns
a rectified frame

Definition at line 868 of file xsh_extract.c.

References CENTER_IFU_SLITLET, check, instrument, LOWER_IFU_SLITLET, SlitletName, UPPER_IFU_SLITLET, XSH_ASSURE_NOT_NULL, xsh_extract_with_tag(), XSH_GET_TAG_FROM_ARM, xsh_msg, and xsh_msg_dbg_medium.

Referenced by xsh_scired_ifu_offset().

◆ xsh_extract_with_tag()

static cpl_frame * xsh_extract_with_tag ( cpl_frame *  rec_frame,
cpl_frame *  loc_frame,
xsh_instrument instrument,
xsh_extract_param extract_par,
const char *  tag,
cpl_frame **  res_frame_ext 
)
static

◆ xsh_extraction_get_slit_minmax()

static cpl_error_code xsh_extraction_get_slit_minmax ( xsh_localization loc_list,
const double  lambda,
const double  slit_0,
const double  slit_step,
const int  nslit,
int *  ylow,
int *  yup,
double *  y_frac_up,
double *  y_frac_low 
)
static

◆ xsh_format()

cpl_frame * xsh_format ( cpl_frameset *  spectrum_frame_set,
const char *  result_name,
xsh_instrument instrument,
const char *  rec_prefix 
)