/home/amodigli/releases/xsh/1.2.10/pso/xsh.26608/xshp/xsh/xsh_dfs.c File Reference

#include <xsh_dfs.h>
#include <xsh_pfits.h>
#include <xsh_data_pre.h>
#include <xsh_data_pre_3d.h>
#include <xsh_error.h>
#include <xsh_msg.h>
#include <cpl.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <xsh_paf_save.h>
#include <xsh_utils_table.h>
#include <xsh_utils.h>
#include <xsh_data_spectrum.h>

Go to the source code of this file.

Functions

xsh_file_exists

Find if a given file name corresponds to an existing file.

Parameters:
filename Name of the file to look up.
Returns:
int 1 if file exists, 0 if not

Find out if the given character string corresponds to a file that can be stat()'ed.



static cpl_frame * xsh_find_frame (cpl_frameset *frames, const char *tags[])
 Find a frame.
int xsh_file_exists (const char *filename)
cpl_frameset * xsh_frameset_extract (const cpl_frameset *frames, const char *tag)
 Extract frames with given tag from frameset.
cpl_error_code xsh_frameset_merge (cpl_frameset *set1, cpl_frameset *set2)
 Extracts raw frames.
xsh_instrumentxsh_dfs_set_groups (cpl_frameset *set)
 Set the group as RAW or CALIB in a frameset and return the instrument detected.
cpl_error_code xsh_dfs_extract_raw_frames (cpl_frameset *input, cpl_frameset *raws)
 split input sof in groups: raw and calib
cpl_error_code xsh_dfs_extract_calib_frames (cpl_frameset *input, cpl_frameset *calib)
 split input sof in groups: raw and calib
cpl_error_code xsh_dfs_extract_pro_frames (cpl_frameset *input, cpl_frameset *pros)
 split input sof in groups: raw and calib
void xsh_dfs_split_in_group (cpl_frameset *input, cpl_frameset *raws, cpl_frameset *calib)
 split input sof in groups: raw and calib
void xsh_dfs_split_qth_d2 (cpl_frameset *input, cpl_frameset **qth, cpl_frameset **d2)
 Extracts QTH and D2 frames from input frameset.
void xsh_dfs_split_nir (cpl_frameset *input, cpl_frameset **on, cpl_frameset **off)
 split input RAW NIR sof in ON and OFF
int xsh_dfs_split_offset (cpl_frameset *input, const char *object_tag, const char *sky_tag, cpl_frameset **object, cpl_frameset **sky)
 split input RAW offset sof in OBJECT_... and SKY_... framesets
static bool xsh_dfs_tag_check (const char *tag, const char *tag_list[], int size)
 check if the tag is in the tag list
void xsh_dfs_filter (cpl_frameset *set, const char *tags[], int size)
 filter the frameset with the given tag list
cpl_frameset * xsh_frameset_extract_pre (cpl_frameset *frameset, const char *prefix)
 Extracts pre frames from a frameset.
cpl_frame * xsh_find_bpmap (cpl_frameset *set)
 find the bad pixel map in a set of files
cpl_frame * xsh_find_master_bpmap (cpl_frameset *set)
 find the master bad pixel map in a set of files
cpl_frame * xsh_find_off (cpl_frameset *set)
 find the off frame in set of files
cpl_frame * xsh_find_on (cpl_frameset *set)
 find the on frame in set of files
void xsh_dfs_find_flat (cpl_frameset *raws, cpl_frameset *flat)
 find the flat set of files in the input SOF and detect the mode of instrument. This function assure that all flat files have the same tag
char * xsh_unique_filename (const char *context, const char *caller_id, const char *pro_catg)
 Get unique product filename.
void xsh_add_product (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix, const char *type)
void xsh_add_product_spectrum (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instr)
void xsh_add_product_pre (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instr)
 Add DFS keywords to a product frame.
void xsh_add_product_pre_3d (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instr)
 Add 3d product frame.
void xsh_add_product_bpmap (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
void xsh_add_product_imagelist (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
void xsh_add_product_image (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
void xsh_add_product_table_multi (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument)
 Save Table product (input frame has several extensions, 1 table per extension).
void xsh_add_product_table (cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument)
 Save Table product.
cpl_frame * xsh_find_std_flux (cpl_frameset *frames)
 Find standard star frame.
cpl_frame * xsh_find_std_star_flux (cpl_frameset *frames)
 Find standard standard star flux frame.
cpl_frame * xsh_find_master_bias (cpl_frameset *frames, xsh_instrument *instr)
 Find master bias frame.
cpl_frame * xsh_find_frame_with_tag (cpl_frameset *frames, const char *tag, xsh_instrument *instr)
 Find frame with a given tag.
char * xsh_get_tag_from_arm (const char *tag, xsh_instrument *instr)
 Find arm specific tag from base and instrument setting.
cpl_frame * xsh_find_master_dark (cpl_frameset *frames, xsh_instrument *instr)
 Find master dark frame.
cpl_frame * xsh_find_master_flat (cpl_frameset *frames, xsh_instrument *instr)
 Find master flat frame.
cpl_frame * xsh_find_theo_tab_sing (cpl_frameset *frames, xsh_instrument *instr)
 Find a theoretical tab signle pinhole in SOF.
cpl_frame * xsh_find_theo_tab_mult (cpl_frameset *frames, xsh_instrument *instr)
 Find a theoretical tab multi pinhole in SOF.
cpl_frame * xsh_find_theo_tab_mode (cpl_frameset *frames, xsh_instrument *instr)
 Find a theoretical tab IFU or SINg depending of MODE in SOF.
cpl_frame * xsh_find_order_tab_recov (cpl_frameset *frames, xsh_instrument *instr)
 Find an order tab RECOV.
cpl_frame * xsh_find_order_tab_guess (cpl_frameset *frames, xsh_instrument *instr)
 Find an order tab GUESS.
cpl_frame * xsh_find_order_tab_centr (cpl_frameset *frames, xsh_instrument *instr)
 Find an order tab CENTR.
cpl_frame * xsh_find_order_tab_edges (cpl_frameset *frames, xsh_instrument *instr)
 Find an order tab EDGES.
cpl_frame * xsh_find_wave_tab_guess (cpl_frameset *frames, xsh_instrument *instr)
 Find a wave tab guess.
cpl_frame * xsh_find_wave_tab_2d (cpl_frameset *frames, xsh_instrument *instr)
 Find a wave tab 2D.
cpl_frame * xsh_find_slitmap (cpl_frameset *frames, xsh_instrument *instr)
 Find a slit map.
cpl_frame * xsh_find_wave_tab (cpl_frameset *frames, xsh_instrument *instr)
 Find a wave tab 2D or a wave tab ARC.
cpl_frame * xsh_find_model_config (cpl_frameset *frames, xsh_instrument *instr)
 Find a model config.
cpl_frameset * xsh_find_wave_tab_ifu (cpl_frameset *frames, xsh_instrument *instrument)
 Find wave tab ARC (for IFU 3 frames).
cpl_frame * xsh_find_arc_line_list_clean (cpl_frameset *frames, xsh_instrument *instr)
 Find an arc lines list clean frame.
cpl_frame * xsh_find_arc_line_list (cpl_frameset *frames, xsh_instrument *instr)
 Find an arc line list frame.
cpl_frame * xsh_find_usr_lines_guess_tab (cpl_frameset *frames, xsh_instrument *instr)
 Find a user guess line positions table frame.
cpl_frame * xsh_find_model_config_tab (cpl_frameset *frames, xsh_instrument *instr)
 Find a model configuration table frame.
cpl_frame * xsh_find_wavemap (cpl_frameset *frames, xsh_instrument *instr)
 Find Wave Map frame. The frame returned should not be free by the caller.
cpl_frame * xsh_find_raw_orderdef_vis_uvb (cpl_frameset *frames)
 Find orderdef raw frame for UVB or VIS.
cpl_frame * xsh_find_raw_orderdef_nir (cpl_frameset *frames)
 Find orderdef raw frame for NIR.
cpl_frame * xsh_find_disp_tab (cpl_frameset *frames, xsh_instrument *instr)
 Find Dispersol tab frame. The frame returned should not be free by the caller.
cpl_frame * xsh_find_raw_orderdef_nir_off (cpl_frameset *frames)
 Find orderdef raw frame for NIR OFF.
cpl_frame * xsh_find_raw_arc_slit_uvb_vis (cpl_frameset *frames, XSH_ARM arm)
 Find raw frame for Slit UVB/VIS.
cpl_frame * xsh_find_raw_arc_slit_nir_on (cpl_frameset *frames)
 Find raw frame for Slit NIR ON.
cpl_frame * xsh_find_raw_arc_slit_nir_off (cpl_frameset *frames)
 Find raw frame for Slit NIR OFF.
cpl_frame * xsh_find_calpro_model_config (cpl_frameset *frames, xsh_instrument *instr)
 Find model config frame.
cpl_frame * xsh_find_model_config_open (cpl_frameset *frames, xsh_instrument *instr)
 Find model config frame.
cpl_frame * xsh_find_calpro_model_meas_coord (cpl_frameset *frames, xsh_instrument *instr)
 Find model config frame.
cpl_frame * xsh_find_model_wavelist (cpl_frameset *frames, xsh_instrument *instr)
 Find model wavelength list frame.
cpl_frame * xsh_find_model_testpar (cpl_frameset *frames, xsh_instrument *instr)
 Find model test parameter list.
cpl_frame * xsh_find_spectral_format (cpl_frameset *frames, xsh_instrument *instr)
 Find spectral format frame.



int xsh_parameter_get_default_flag (const cpl_parameter *p)
 Check if an input parameter has been changed by the user.
cpl_error_code xsh_validate_model_cfg (cpl_frame *mod, cpl_frameset *set)
 Validate model cfg.
cpl_frameset * xsh_frameset_ext_table_frames (cpl_frameset *set)
 Extract frameset sub set containing only table frames.
int xsh_dfs_files_dont_exist (cpl_frameset *frameset)
 Check if all SOF files exist.
cpl_frameset * xsh_frameset_ext_image_frames (cpl_frameset *set)
 Extract frameset sub set containing only table frames.
cpl_frameset * xsh_frameset_drl_frames (cpl_frameset *set)
 extract DRL specific frames from frameset
cpl_error_code xsh_ensure_raws_input_offset_recipe_is_proper (cpl_frameset *raws, xsh_instrument *instrument)
 Make sure input frames is an even number (eventually removes the last from the input list).
static double xsh_get_offsety (cpl_propertylist *plist)
 Computes offsety.
cpl_frameset * xsh_frameset_extract_offsety_matches (cpl_frameset *raws, const double offset)
 Extract frames that has same cumoffy as offset.
cpl_frameset * xsh_frameset_extract_offsety_mismatches (cpl_frameset *raws, const double offset)
 Extract frames that has different cumoffy than offset.
cpl_frameset * xsh_extract_nod_pairs (cpl_frameset *raws, cpl_vector *offset)
 Make sure input frames is composed by nod a-b sequence.
cpl_frameset * xsh_extract_obj_and_sky_pairs (cpl_frameset *raws, xsh_instrument *instrument)
 Make sure input frames is composed by obj-sky pairs.
cpl_error_code xsh_ensure_raws_number_is_even (cpl_frameset *raws)
 Make sure input frames is an even number (eventually removes the last from the input list).
int xsh_print_rec_status (const int val)
 Check if an error has happened and returns error kind and location.
void xsh_frame_config (const char *fname, const char *tag, cpl_frame_type type, cpl_frame_group group, cpl_frame_level level, cpl_frame **frame)
 Define a frame characteristics.
cpl_frame * xsh_frame_product (const char *fname, const char *tag, cpl_frame_type type, cpl_frame_group group, cpl_frame_level level)
 Creates a frame with given characteristics.

Function Documentation

void xsh_add_product ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument,
const char *  final_prefix,
const char *  type 
)

Save product

Parameters:
frame Product Frame
frameset Input Frameset
parameters Parameters list
recipe_id Recipe Identification String
instrument Instrument structure
final_prefix Final file name
type of frame (image/imagelist/table)

Definition at line 1605 of file xsh_dfs.c.

References check, check_msg, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, xsh_frame_product(), XSH_FREE, xsh_free_image(), xsh_free_imagelist(), xsh_free_propertylist(), xsh_free_table(), xsh_msg_dbg_low, xsh_msg_error, XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), and xsh_time_stamp_get().

void xsh_add_product_bpmap ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument,
const char *  final_prefix 
)

Save BadPixelMap product

Parameters:
frame Product Frame
frameset Input Frameset
parameters Parameters list
recipe_id Recipe Identification String
instrument Instrument structure
final_prefix Final file name

Definition at line 2056 of file xsh_dfs.c.

References check, check_msg, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, xsh_frame_product(), XSH_FREE, xsh_free_image(), xsh_free_propertylist(), xsh_msg_dbg_low, XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), and xsh_time_stamp_get().

Referenced by xsh_linear(), xsh_lingain(), xsh_mbias(), xsh_mdark(), xsh_mflat(), and xsh_util_bpmap_nl_raw2pre().

void xsh_add_product_image ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument,
const char *  final_prefix 
)
void xsh_add_product_imagelist ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument,
const char *  final_prefix 
)

Save Image product

Parameters:
frame Product Frame
frameset Input Frameset
parameters Parameters list
recipe_id Recipe Identification String
instrument Instrument structure
final_prefix Final file name

Definition at line 2167 of file xsh_dfs.c.

References check, check_msg, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, xsh_frame_product(), XSH_FREE, xsh_free_imagelist(), xsh_free_propertylist(), xsh_msg_dbg_low, XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), and xsh_time_stamp_get().

Referenced by xsh_build_ifu_cube(), and xsh_util_ifu_build_cube().

void xsh_add_product_pre ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instr 
)

Add DFS keywords to a product frame.

Parameters:
frame The product frame
frameset The recipe frameset.
parameters The recipe parameter list
recipe_id The recipe name
instr The instrument settings

Mandatory DFS keywords are added by calling cpl_dfs_setup_product_header()

The function performs the following steps

  • Load primary header, infer product type,
  • Load product,
  • Modify primary header by adding DFS keywords,
  • Save product using the new header,
  • Insert the new frame into the frameset.
Note:
A new frame is created and inserted into the frameset. The provided product_frame must still be deallocated.

Definition at line 1855 of file xsh_dfs.c.

References assure, xsh_pre::binx, xsh_pre::biny, check, xsh_pre::data_header, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, XSH_FREE, xsh_free_frame(), xsh_free_propertylist(), xsh_pfits_get_arcfile(), xsh_pre_free(), xsh_pre_load(), xsh_pre_save(), XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), and xsh_time_stamp_get().

Referenced by xsh_2dmap(), xsh_mbias(), xsh_mdark(), xsh_mflat(), xsh_orderpos(), xsh_predict(), xsh_respon_slit_nod(), xsh_scired_slit_nod(), xsh_scired_slit_stare(), and xsh_wavecal().

void xsh_add_product_pre_3d ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instr 
)

Add 3d product frame.

Parameters:
frame The product frame
frameset The recipe frameset.
parameters The recipe parameter list
recipe_id The recipe name
instr The instrument settings

Definition at line 1967 of file xsh_dfs.c.

References assure, check, xsh_pre_3d::data_header, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, XSH_FREE, xsh_free_frame(), xsh_pre_3d_free(), xsh_pre_3d_load(), xsh_pre_3d_save(), XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), and xsh_time_stamp_get().

void xsh_add_product_spectrum ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instr 
)
void xsh_add_product_table ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument 
)

Save Table product.

Parameters:
frame Product Frame
frameset Input Frameset
parameters Parameters list
recipe_id Recipe Identification String
instrument Instrument structure

Definition at line 2539 of file xsh_dfs.c.

References check, xsh_instrument::dictionary, xsh_instrument::pipeline_id, xsh_add_product_file(), XSH_ASSURE_NOT_NULL, xsh_frame_product(), XSH_FREE, xsh_free_propertylist(), XSH_PRODUCT_PREFIX, xsh_sdate_utc(), xsh_stringcat_any(), XSH_TABLE_FREE, XSH_TABLE_LOAD, and xsh_time_stamp_get().

Referenced by xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_gain(), xsh_geom_ifu(), xsh_predict(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), and xsh_wavecal().

void xsh_add_product_table_multi ( cpl_frame *  frame,
cpl_frameset *  frameset,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
xsh_instrument instrument 
)
cpl_error_code xsh_dfs_extract_calib_frames ( cpl_frameset *  input,
cpl_frameset *  calib 
)

split input sof in groups: raw and calib

Parameters:
input the input set of files
calib the calib files of the input set of files
Returns:
cpl error code

Definition at line 1070 of file xsh_dfs.c.

cpl_error_code xsh_dfs_extract_pro_frames ( cpl_frameset *  input,
cpl_frameset *  pros 
)

split input sof in groups: raw and calib

Parameters:
input the input set of files
pros the product files of the input set of files
Returns:
cpl error code

Definition at line 1096 of file xsh_dfs.c.

References XSH_ASSURE_NOT_NULL_MSG.

Referenced by xsh_lingain().

cpl_error_code xsh_dfs_extract_raw_frames ( cpl_frameset *  input,
cpl_frameset *  raws 
)

split input sof in groups: raw and calib

Parameters:
input the input set of files
raws the raws file of the input set of files
Returns:
cpl error code

Definition at line 1045 of file xsh_dfs.c.

Referenced by xsh_model_first_anneal_save().

int xsh_dfs_files_dont_exist ( cpl_frameset *  frameset  ) 

Check if all SOF files exist.

Parameters:
frameset The input set-of-frames
Returns:
1 if not all files exist, 0 if they all exist.

Definition at line 195 of file xsh_dfs.c.

Referenced by xsh_begin().

void xsh_dfs_filter ( cpl_frameset *  set,
const char *  tags[],
int  size 
)

filter the frameset with the given tag list

Parameters:
set [IN/OUT] The input set of frames
tags the filtered tag list
size size of list
Returns:
void

Definition at line 1373 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, and xsh_dfs_tag_check().

Referenced by xsh_begin().

void xsh_dfs_find_flat ( cpl_frameset *  raws,
cpl_frameset *  flat 
)

find the flat set of files in the input SOF and detect the mode of instrument. This function assure that all flat files have the same tag

Parameters:
raws set of file where we want to do the search
flat frameset contains only flat

Definition at line 1539 of file xsh_dfs.c.

References assure.

xsh_instrument* xsh_dfs_set_groups ( cpl_frameset *  set  ) 

Set the group as RAW or CALIB in a frameset and return the instrument detected.

Parameters:
set the input frameset
Returns:
an instrument structure which contains arm, mode and lamp

Definition at line 973 of file xsh_dfs.c.

References assure, check, check_msg, xsh_instrument::config, instrument, XSH_INSTRCONFIG::order_max, XSH_INSTRCONFIG::order_min, XSH_INSTRCONFIG::orders, XSH_ARM_UNDEFINED, xsh_instrument_arm_tostring(), xsh_instrument_free(), xsh_instrument_get_arm(), xsh_instrument_get_config(), xsh_instrument_mode_tostring(), xsh_instrument_new(), xsh_instrument_parse_tag(), XSH_IS_CALIB, XSH_IS_RAW, xsh_msg, and xsh_msg_error.

Referenced by main(), xsh_begin(), xsh_util_bpmap_coadd(), and xsh_util_ima_arith().

void xsh_dfs_split_in_group ( cpl_frameset *  input,
cpl_frameset *  raws,
cpl_frameset *  calib 
)

split input sof in groups: raw and calib

Parameters:
input the input set of files
raws the raws file of the input set of files
calib the calib files of the input set of files

Definition at line 1122 of file xsh_dfs.c.

References xsh_msg_error.

Referenced by main(), and xsh_begin().

void xsh_dfs_split_nir ( cpl_frameset *  input,
cpl_frameset **  on,
cpl_frameset **  off 
)

split input RAW NIR sof in ON and OFF

Parameters:
[in] input the input RAW NIR set of files
[out] on the on files of the input set of files
[out] off the off files of the input set of files

Definition at line 1213 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_frameset(), xsh_msg_error, and XSH_NEW_FRAMESET.

Referenced by xsh_2dmap(), xsh_geom_ifu(), xsh_mflat(), xsh_predict(), xsh_scired_ifu_stare(), and xsh_wavecal().

int xsh_dfs_split_offset ( cpl_frameset *  input,
const char *  object_tag,
const char *  sky_tag,
cpl_frameset **  object,
cpl_frameset **  sky 
)

split input RAW offset sof in OBJECT_... and SKY_... framesets

Parameters:
[in] input input frameset
[in] object_tag The OBJECT Tag
[in] sky_tag The SKY Tag
[out] object the object files of the input set of files
[out] sky the sky files of the input set of files
Returns:
Number of OBJECT frames (equal nb of SKY frames)

Definition at line 1273 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_msg_dbg_medium, xsh_msg_error, and xsh_print_rec_status().

Referenced by xsh_respon_slit_offset(), xsh_scired_ifu_offset(), and xsh_scired_slit_offset().

void xsh_dfs_split_qth_d2 ( cpl_frameset *  input,
cpl_frameset **  qth,
cpl_frameset **  d2 
)

Extracts QTH and D2 frames from input frameset.

Parameters:
input the input set of files
qth frameset with QTH frames
d2 frameset with D2 frames
Returns:
void

Definition at line 1158 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_frameset(), xsh_msg_error, and XSH_NEW_FRAMESET.

Referenced by xsh_mflat().

static bool xsh_dfs_tag_check ( const char *  tag,
const char *  tag_list[],
int  size 
) [static]

check if the tag is in the tag list

Parameters:
tag the tag to check
tag_list the list of tags
size size of list
Returns:
TRUE if the tag is find else false

Definition at line 1348 of file xsh_dfs.c.

Referenced by xsh_dfs_filter().

cpl_error_code xsh_ensure_raws_input_offset_recipe_is_proper ( cpl_frameset *  raws,
xsh_instrument instrument 
)

Make sure input frames is an even number (eventually removes the last from the input list).

Parameters:
raws input value
instrument arm setting
Returns:
cpl_error_code

Definition at line 301 of file xsh_dfs.c.

References assure, check, xsh_frameset_extract(), xsh_frameset_merge(), xsh_free_frameset(), XSH_GET_TAG_FROM_ARM, xsh_instrument_get_mode(), XSH_MODE_IFU, xsh_msg, XSH_OBJECT_IFU_OFFSET, XSH_OBJECT_SLIT_OFFSET, XSH_SKY_IFU, XSH_SKY_SLIT, XSH_STD_FLUX_IFU_OFFSET, and XSH_STD_FLUX_SLIT_OFFSET.

Referenced by xsh_respon_slit_offset(), xsh_scired_ifu_offset(), and xsh_scired_slit_offset().

cpl_error_code xsh_ensure_raws_number_is_even ( cpl_frameset *  raws  ) 

Make sure input frames is an even number (eventually removes the last from the input list).

Parameters:
raws input value
Returns:
cpl_error_code

Definition at line 734 of file xsh_dfs.c.

References check, xsh_free_propertylist(), xsh_get_offsety(), and xsh_msg_warning.

Referenced by xsh_respon_slit_nod(), and xsh_scired_slit_nod().

cpl_frameset* xsh_extract_nod_pairs ( cpl_frameset *  raws,
cpl_vector *  offset 
)

Make sure input frames is composed by nod a-b sequence.

Parameters:
raws input value
offset vector with different offset values
Returns:
frameset with a-b sequence frames

Definition at line 531 of file xsh_dfs.c.

References assure, check, XSH_ASSURE_NOT_NULL_MSG, xsh_frameset_extract_offsety_matches(), xsh_frameset_extract_offsety_mismatches(), xsh_free_frameset(), xsh_free_propertylist(), xsh_msg, and xsh_pfits_get_mjdobs().

cpl_frameset* xsh_extract_obj_and_sky_pairs ( cpl_frameset *  raws,
xsh_instrument instrument 
)

Make sure input frames is composed by obj-sky pairs.

Parameters:
raws input value
instrument arm
Returns:
cpl_error_code

Definition at line 645 of file xsh_dfs.c.

References assure, check, xsh_frameset_extract(), xsh_free_frameset(), xsh_free_propertylist(), XSH_GET_TAG_FROM_ARM, xsh_instrument_get_mode(), XSH_MODE_IFU, xsh_msg, XSH_OBJECT_IFU_OFFSET, XSH_OBJECT_SLIT_OFFSET, xsh_pfits_get_mjdobs(), XSH_SKY_IFU, and XSH_SKY_SLIT.

int xsh_file_exists ( const char *  filename  ) 

Definition at line 892 of file xsh_dfs.c.

Referenced by xsh_frameset_extract_pre().

cpl_frame* xsh_find_arc_line_list ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an arc line list frame.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3236 of file xsh_dfs.c.

References check, XSH_ARC_LINE_LIST, XSH_ASSURE_NOT_NULL, xsh_find_frame(), and XSH_GET_TAG_FROM_ARM.

Referenced by main(), and xsh_predict().

cpl_frame* xsh_find_arc_line_list_clean ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an arc lines list clean frame.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3210 of file xsh_dfs.c.

References check, XSH_ARC_LINE_LIST, XSH_ASSURE_NOT_NULL, xsh_find_frame(), and XSH_GET_TAG_FROM_ARM.

cpl_frame* xsh_find_bpmap ( cpl_frameset *  set  ) 

find the bad pixel map in a set of files

Parameters:
set the set of files
Returns:
the bad pixel map or NULL if not found

Definition at line 1452 of file xsh_dfs.c.

Referenced by main(), and xsh_linear().

cpl_frame* xsh_find_calpro_model_config ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find model config frame.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3504 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_MOD_CFG, xsh_msg_debug, and xsh_stringcat_any().

Referenced by xsh_model_anneal().

cpl_frame* xsh_find_calpro_model_meas_coord ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find model config frame.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3558 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_MEASCOORD, and xsh_stringcat_any().

Referenced by xsh_model_anneal().

cpl_frame* xsh_find_disp_tab ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find Dispersol tab frame. The frame returned should not be free by the caller.

Parameters:
frames The input frameset
instr The instrument
Returns:
Pointer to wavemap frame

Definition at line 3383 of file xsh_dfs.c.

References check, XSH_DISP_TAB, XSH_DISP_TAB_AFC, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and xsh_msg.

Referenced by main(), xsh_geom_ifu(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), and xsh_wavecal().

static cpl_frame * xsh_find_frame ( cpl_frameset *  frames,
const char *  tags[] 
) [static]
cpl_frame* xsh_find_frame_with_tag ( cpl_frameset *  frames,
const char *  tag,
xsh_instrument instr 
)
cpl_frame* xsh_find_master_bias ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find master bias frame.

Parameters:
frames The input frameset
instr the settings of instrument
Returns:
Pointer to first standard star frame, or NULL on error.

The function sets an error if no standard star frame is present.

Definition at line 2700 of file xsh_dfs.c.

References check, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_MASTER_BIAS.

Referenced by main(), xsh_geom_ifu(), xsh_mflat(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), and xsh_slit_stare_get_calibs().

cpl_frame* xsh_find_master_bpmap ( cpl_frameset *  set  ) 

find the master bad pixel map in a set of files

Parameters:
set the set of files
Returns:
the bad pixel map or NULL if not found

Definition at line 1475 of file xsh_dfs.c.

References XSH_MASTER_BP_MAP.

Referenced by xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_geom_ifu(), xsh_orderpos(), xsh_predict(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), xsh_slit_stare_get_calibs(), and xsh_wavecal().

cpl_frame* xsh_find_master_dark ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find master dark frame.

Parameters:
frames The input frameset
instr the settings of instrument
Returns:
Pointer to first standard star frame, or NULL on error.

The function sets an error if no standard star frame is present.

Definition at line 2785 of file xsh_dfs.c.

References xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_MASTER_DARK.

Referenced by main(), xsh_geom_ifu(), xsh_mflat(), xsh_scired_ifu_stare(), xsh_slit_stare_get_calibs(), and xsh_wavecal().

cpl_frame* xsh_find_master_flat ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find master flat frame.

Parameters:
frames The input frameset
instr the settings of instrument
Returns:
Pointer to first standard star frame, or NULL on error.

The function sets an error if no standard star frame is present.

Definition at line 2807 of file xsh_dfs.c.

References xsh_find_frame(), XSH_GET_TAG_FROM_MODE, and XSH_MASTER_FLAT.

Referenced by main(), xsh_geom_ifu(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), and xsh_slit_stare_get_calibs().

cpl_frame* xsh_find_model_config ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a model config.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3108 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, XSH_MOD_CFG_OPT_2D, XSH_MOD_CFG_OPT_AFC, and XSH_MOD_CFG_TAB.

Referenced by xsh_geom_ifu(), and xsh_util_ifu_build_cube().

cpl_frame* xsh_find_model_config_open ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find model config frame.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3531 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_MOD_CFG_OPEN, xsh_msg_debug, and xsh_stringcat_any().

cpl_frame* xsh_find_model_config_tab ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a model configuration table frame.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3285 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_MOD_CFG_TAB.

Referenced by main().

cpl_frame* xsh_find_model_testpar ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find model test parameter list.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3610 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_MODEL_TEST_PAR, and xsh_stringcat_any().

Referenced by xsh_model().

cpl_frame* xsh_find_model_wavelist ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find model wavelength list frame.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3583 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_MODEL_WAVE_LIST, and xsh_stringcat_any().

Referenced by xsh_model().

cpl_frame* xsh_find_off ( cpl_frameset *  set  ) 

find the off frame in set of files

Parameters:
set the set of files
Returns:
the off frame or NULL if not found

Definition at line 1496 of file xsh_dfs.c.

cpl_frame* xsh_find_on ( cpl_frameset *  set  ) 

find the on frame in set of files

Parameters:
set the set of files
Returns:
the on frame or NULL if not found

Definition at line 1517 of file xsh_dfs.c.

cpl_frame* xsh_find_order_tab_centr ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an order tab CENTR.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2951 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_ORDER_TAB_CENTR.

Referenced by xsh_mflat().

cpl_frame* xsh_find_order_tab_edges ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an order tab EDGES.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2976 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_LAMP, XSH_GET_TAG_FROM_MODE, xsh_msg_dbg_medium, XSH_ORDER_TAB_AFC, and XSH_ORDER_TAB_EDGES.

Referenced by main(), xsh_2dmap(), xsh_flexcomp(), xsh_geom_ifu(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), xsh_slit_stare_get_calibs(), and xsh_wavecal().

cpl_frame* xsh_find_order_tab_guess ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an order tab GUESS.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2926 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_ORDER_TAB_GUESS.

cpl_frame* xsh_find_order_tab_recov ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find an order tab RECOV.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2901 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_ORDER_TAB_RECOV.

cpl_frame* xsh_find_raw_arc_slit_nir_off ( cpl_frameset *  frames  ) 

Find raw frame for Slit NIR OFF.

Parameters:
frames The input frameset
Returns:
Pointer to raw frame

Definition at line 3482 of file xsh_dfs.c.

References check, XSH_ARC_SLIT_OFF, xsh_find_frame(), and xsh_stringcat_any().

cpl_frame* xsh_find_raw_arc_slit_nir_on ( cpl_frameset *  frames  ) 

Find raw frame for Slit NIR ON.

Parameters:
frames The input frameset
Returns:
Pointer to raw frame

Definition at line 3462 of file xsh_dfs.c.

References check, XSH_ARC_SLIT_NIR, xsh_find_frame(), and xsh_stringcat_any().

cpl_frame* xsh_find_raw_arc_slit_uvb_vis ( cpl_frameset *  frames,
XSH_ARM  arm 
)

Find raw frame for Slit UVB/VIS.

Parameters:
frames The input frameset
arm The ARM (UVB or VIS)
Returns:
Pointer to raw frame

Definition at line 3436 of file xsh_dfs.c.

References check, XSH_ARC_SLIT_UVB, XSH_ARC_SLIT_VIS, XSH_ARM_UVB, XSH_ARM_VIS, xsh_find_frame(), and xsh_stringcat_any().

cpl_frame* xsh_find_raw_orderdef_nir ( cpl_frameset *  frames  ) 

Find orderdef raw frame for NIR.

Parameters:
frames The input frameset
Returns:
Pointer to order table frame

Definition at line 3360 of file xsh_dfs.c.

References check, xsh_find_frame(), XSH_ORDERDEF_NIR, and xsh_stringcat_any().

Referenced by xsh_orderpos().

cpl_frame* xsh_find_raw_orderdef_nir_off ( cpl_frameset *  frames  ) 

Find orderdef raw frame for NIR OFF.

Parameters:
frames The input frameset
Returns:
Pointer to order table frame

Definition at line 3416 of file xsh_dfs.c.

References check, xsh_find_frame(), XSH_ORDERDEF_OFF, and xsh_stringcat_any().

Referenced by xsh_orderpos().

cpl_frame* xsh_find_raw_orderdef_vis_uvb ( cpl_frameset *  frames  ) 

Find orderdef raw frame for UVB or VIS.

Parameters:
frames The input frameset
Returns:
Pointer to order table frame

Definition at line 3333 of file xsh_dfs.c.

References check, xsh_find_frame(), XSH_ORDERDEF_D2_UVB, XSH_ORDERDEF_QTH_UVB, XSH_ORDERDEF_VIS, and xsh_stringcat_any().

Referenced by xsh_orderpos().

cpl_frame* xsh_find_slitmap ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a slit map.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3053 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, XSH_IFU_MAP, and XSH_SLIT_MAP.

Referenced by main(), xsh_check_get_map(), xsh_geom_ifu(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_slit_stare_get_maps(), and xsh_wavecal().

cpl_frame* xsh_find_spectral_format ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find spectral format frame.

Parameters:
frames The input frameset
instr the instrument arm setting
Returns:
Pointer to raw frame

Definition at line 3636 of file xsh_dfs.c.

References check, xsh_find_frame(), xsh_instrument_arm_tostring(), XSH_SPECTRAL_FORMAT, and xsh_stringcat_any().

Referenced by main(), xsh_geom_ifu(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), and xsh_wavecal().

cpl_frame* xsh_find_std_flux ( cpl_frameset *  frames  ) 

Find standard star frame.

Parameters:
frames The input frameset
Returns:
Pointer to first standard star frame, or NULL on error.

The function sets an error if no standard star frame is present.

Definition at line 2643 of file xsh_dfs.c.

References XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_find_frame(), XSH_STD_FLUX_OFFSET, XSH_STD_FLUX_SLIT, XSH_STD_TELL_OFFSET, and XSH_STD_TELL_SLIT.

Referenced by xsh_respon_slit_stare().

cpl_frame* xsh_find_std_star_flux ( cpl_frameset *  frames  ) 

Find standard standard star flux frame.

Parameters:
frames The input frameset
Returns:
Pointer to first standard star frame, or NULL on error.

The function sets an error if no standard star frame is present.

Definition at line 2675 of file xsh_dfs.c.

References XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_find_frame(), and XSH_STD_STAR_FLUX.

cpl_frame* xsh_find_theo_tab_mode ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a theoretical tab IFU or SINg depending of MODE in SOF.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2871 of file xsh_dfs.c.

References check, xsh_instrument::mode, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, XSH_MODE_IFU, XSH_THEO_TAB_IFU, and XSH_THEO_TAB_SING.

cpl_frame* xsh_find_theo_tab_mult ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a theoretical tab multi pinhole in SOF.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2849 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_THEO_TAB_MULT.

cpl_frame* xsh_find_theo_tab_sing ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a theoretical tab signle pinhole in SOF.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 2826 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_THEO_TAB_SING.

cpl_frame* xsh_find_usr_lines_guess_tab ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a user guess line positions table frame.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3260 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_GUESS_LINES_POS.

cpl_frame* xsh_find_wave_tab ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a wave tab 2D or a wave tab ARC.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3079 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, XSH_GET_TAG_FROM_MODE, XSH_WAVE_TAB_2D, XSH_WAVE_TAB_AFC, and XSH_WAVE_TAB_ARC.

Referenced by xsh_flexcomp(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), and xsh_slit_stare_get_calibs().

cpl_frame* xsh_find_wave_tab_2d ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a wave tab 2D.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3030 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_WAVE_TAB_2D.

Referenced by main(), and xsh_wavecal().

cpl_frame* xsh_find_wave_tab_guess ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find a wave tab guess.

Parameters:
frames The input frameset where we do the search
instr The instrument
Returns:
Pointer to the search frame or exception if don't find

Definition at line 3005 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_WAVE_TAB_GUESS.

cpl_frameset* xsh_find_wave_tab_ifu ( cpl_frameset *  frames,
xsh_instrument instrument 
)

Find wave tab ARC (for IFU 3 frames).

Parameters:
frames The input frameset where we do the search
instrument The instrument
Returns:
Pointer to the frame set containing the 3 wave tab arc frames or exception if not founf

Definition at line 3136 of file xsh_dfs.c.

References check, XSH_ASSURE_NOT_NULL, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, xsh_msg, xsh_msg_warning, XSH_WAVE_TAB_2D, XSH_WAVE_TAB_AFC, XSH_WAVE_TAB_ARC_CEN_IFU, XSH_WAVE_TAB_ARC_DOWN_IFU, and XSH_WAVE_TAB_ARC_UP_IFU.

Referenced by main(), and xsh_geom_ifu().

cpl_frame* xsh_find_wavemap ( cpl_frameset *  frames,
xsh_instrument instr 
)

Find Wave Map frame. The frame returned should not be free by the caller.

Parameters:
frames The input frameset
instr the instrument
Returns:
Pointer to wavemap frame

Definition at line 3311 of file xsh_dfs.c.

References check, xsh_find_frame(), XSH_GET_TAG_FROM_ARM, and XSH_WAVE_MAP.

Referenced by main(), xsh_check_get_map(), xsh_geom_ifu(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_get_calibs(), xsh_slit_offset_get_calibs(), xsh_slit_stare_get_maps(), and xsh_wavecal().

void xsh_frame_config ( const char *  fname,
const char *  tag,
cpl_frame_type  type,
cpl_frame_group  group,
cpl_frame_level  level,
cpl_frame **  frame 
)

Define a frame characteristics.

Parameters:
fname frame filename
tag frame tag
type frame type
group frame group
level frame level
frame output frame
Returns:
0 if no error is detected,-1 else

Definition at line 833 of file xsh_dfs.c.

References check.

Referenced by xsh_cfg_recover_model_THE_create(), xsh_frame_product(), xsh_util_physmod_model_THE_create(), and xsh_wavelist_subtract_sky().

cpl_frame* xsh_frame_product ( const char *  fname,
const char *  tag,
cpl_frame_type  type,
cpl_frame_group  group,
cpl_frame_level  level 
)

Creates a frame with given characteristics.

Parameters:
fname frame filename
tag frame tag
type frame type
group frame group
level frame level
Returns:
0 if no error is detected,-1 else

Definition at line 863 of file xsh_dfs.c.

References check, xsh_frame_config(), and xsh_free_frame().

Referenced by xsh_add_product(), xsh_add_product_bpmap(), xsh_add_product_image(), xsh_add_product_imagelist(), xsh_add_product_table(), xsh_add_product_table_multi(), xsh_arclist_save(), xsh_build_ifu_cube(), xsh_catalog_extract_spectrum_frame(), xsh_cfg_recover_gen_xyg_frame(), xsh_compute_linearity(), xsh_compute_noise_map(), xsh_compute_response(), xsh_compute_response_ord(), xsh_create_master_bpmap(), xsh_cube_qc_trace_window(), xsh_dispersol_list_save(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_efficiency_compute(), xsh_flat_merge_qth_d2(), xsh_frame_image_ext_qc_trace_window(), xsh_frame_image_qc_trace_window(), xsh_frameset_average(), xsh_frameset_average_pre(), xsh_image_get_hot_cold_pixs(), xsh_image_local_cold_pixs(), xsh_image_local_hot_pixs(), xsh_image_mflat_detect_hotcold(), xsh_linetilt_list_save(), xsh_localization_save(), xsh_mdark(), xsh_mflat(), xsh_model_first_anneal(), xsh_model_first_anneal_save(), xsh_model_maps_create(), xsh_model_pipe_anneal(), xsh_model_spectralformat_create(), xsh_model_THE_create(), xsh_normalize_spectrum(), xsh_normalize_spectrum_ord(), xsh_order_list_save(), xsh_rec_list_save(), xsh_rec_list_save2(), xsh_rec_list_save_table(), xsh_resid_order_save(), xsh_resid_tab_save(), xsh_shift_tab_save(), xsh_slice_offset_save(), xsh_spectrum1D_save(), xsh_spectrum_interpolate(), xsh_spectrum_interpolate_linear(), xsh_spectrum_resample(), xsh_star_flux_list_save(), xsh_star_flux_list_save_order(), xsh_subtract_background(), xsh_the_map_save(), xsh_util_afc(), xsh_util_bpmap_coadd(), xsh_util_crh_single(), xsh_util_frameset_collapse_mean(), xsh_util_ifu_build_cube(), xsh_util_model_SPF_create(), xsh_util_multiply_by_response(), xsh_util_multiply_by_response_ord(), xsh_utils_efficiency(), xsh_wavemap_list_save(), xsh_wavemap_list_save2(), and xsh_wavesol_save().

cpl_frameset* xsh_frameset_drl_frames ( cpl_frameset *  set  ) 

extract DRL specific frames from frameset

Parameters:
set input frameset
Returns:
frameset containing DRL specific frames

Definition at line 268 of file xsh_dfs.c.

References check, xsh_free_propertylist(), and xsh_pfits_get_naxis().

Referenced by xsh_merge_ord_ifu().

cpl_frameset* xsh_frameset_ext_image_frames ( cpl_frameset *  set  ) 

Extract frameset sub set containing only table frames.

Parameters:
set input frameset
Returns:
a new allocated frameset filled by frame tables.

Definition at line 235 of file xsh_dfs.c.

References check, xsh_free_propertylist(), and xsh_pfits_get_naxis().

cpl_frameset* xsh_frameset_ext_table_frames ( cpl_frameset *  set  ) 

Extract frameset sub set containing only table frames.

Parameters:
set input frameset
Returns:
a new allocated frameset filled by frame tables.

Definition at line 157 of file xsh_dfs.c.

References check, xsh_free_propertylist(), and xsh_pfits_get_naxis().

Referenced by xsh_respon_slit_offset(), and xsh_scired_slit_offset().

cpl_frameset* xsh_frameset_extract ( const cpl_frameset *  frames,
const char *  tag 
)

Extract frames with given tag from frameset.

Parameters:
frames frame set
tag to search for
Returns:
newly allocated, possibly empty, frameset, or NULL on error

Definition at line 914 of file xsh_dfs.c.

References assure.

Referenced by xsh_cfg_recover_last_step(), xsh_ensure_raws_input_offset_recipe_is_proper(), xsh_extract_obj_and_sky_pairs(), xsh_gain(), xsh_lingain_pre_format(), xsh_util_ima_arith(), and xsh_util_ima_shift().

cpl_frameset* xsh_frameset_extract_offsety_matches ( cpl_frameset *  raws,
const double  offset 
)

Extract frames that has same cumoffy as offset.

Parameters:
raws input value
offset offset value
Returns:
frameset with matching frames

Definition at line 432 of file xsh_dfs.c.

References XSH_ASSURE_NOT_NULL_MSG, xsh_free_propertylist(), and xsh_get_offsety().

Referenced by xsh_extract_nod_pairs().

cpl_frameset* xsh_frameset_extract_offsety_mismatches ( cpl_frameset *  raws,
const double  offset 
)

Extract frames that has different cumoffy than offset.

Parameters:
raws input value
offset offset value
Returns:
frameset with not matching frames

Definition at line 474 of file xsh_dfs.c.

References M_PI, XSH_ASSURE_NOT_NULL_MSG, xsh_free_propertylist(), xsh_msg, XSH_NOD_CUMULATIVE_OFFSETY, xsh_pfits_get_cumoffsety(), xsh_pfits_get_dec_cumoffset(), xsh_pfits_get_posang(), and xsh_pfits_get_ra_cumoffset().

Referenced by xsh_extract_nod_pairs().

cpl_frameset* xsh_frameset_extract_pre ( cpl_frameset *  frameset,
const char *  prefix 
)

Extracts pre frames from a frameset.

Parameters:
frameset the set of files
prefix the pre frame prefix
Returns:
the frameset with pre frames

Definition at line 1413 of file xsh_dfs.c.

References check, and xsh_file_exists().

Referenced by xsh_lingain_pre_format().

cpl_error_code xsh_frameset_merge ( cpl_frameset *  set1,
cpl_frameset *  set2 
)

Extracts raw frames.

Parameters:
set1 The input frameset that is extended
set2 The input frameset that is merged to set1
Returns:
CPL_ERROR_NONE iff ok

Definition at line 945 of file xsh_dfs.c.

References check, and passure.

Referenced by xsh_ensure_raws_input_offset_recipe_is_proper(), and xsh_lingain().

static double xsh_get_offsety ( cpl_propertylist *  plist  )  [static]
char* xsh_get_tag_from_arm ( const char *  tag,
xsh_instrument instr 
)

Find arm specific tag from base and instrument setting.

Parameters:
tag The frame tag
instr the settings of instrument
Returns:
string composed tag

Definition at line 2755 of file xsh_dfs.c.

References xsh_instrument_arm_tostring(), and xsh_msg_dbg_high.

Referenced by xsh_cfg_recover_last_step(), xsh_cfg_recover_measure_line_xy(), xsh_find_frame_with_tag(), and xsh_model_first_anneal_save().

int xsh_parameter_get_default_flag ( const cpl_parameter *  p  ) 

Check if an input parameter has been changed by the user.

Parameters:
p input parameter
Returns:
if has not changed 0, else 1;

Definition at line 76 of file xsh_dfs.c.

References xsh_msg_error.

Referenced by xsh_params_set_defaults(), and xsh_scired_nod_params_set_defaults().

int xsh_print_rec_status ( const int  val  ) 
char* xsh_unique_filename ( const char *  context,
const char *  caller_id,
const char *  pro_catg 
)

Get unique product filename.

Parameters:
context The current context, or NULL
caller_id Name of calling module
pro_catg The PROduct CATeGory
Returns:
Newly allocated unique filename.

This function can be used to avoid overwriting existing files. It computes the filename depending on the current context (position in the call-tree).

If this turns out not to be a problem, one could simply use pro_catg.fits as the filename.

Definition at line 1581 of file xsh_dfs.c.

References xsh_stringcat_4(), and xsh_stringcat_6().

cpl_error_code xsh_validate_model_cfg ( cpl_frame *  mod,
cpl_frameset *  set 
)

Validate model cfg.

Parameters:
mod model cfg frame
set input frameset
Returns:
a new allocated frameset filled by frame tables.

Definition at line 119 of file xsh_dfs.c.

References check, xsh_msg_warning, and xsh_pfits_get_mjdobs().


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