Data Structures | |||||||||||||||||||
struct | FRAME_DATE_IDX | ||||||||||||||||||
struct | data | ||||||||||||||||||
Defines | |||||||||||||||||||
#define | CPL_TYPE float | ||||||||||||||||||
#define | CPL_TYPE_T CPL_TYPE_FLOAT | ||||||||||||||||||
#define | CPL_IMAGE_GET_DATA cpl_image_get_data_float | ||||||||||||||||||
#define | CPL_IMAGE_GET_DATA_CONST cpl_image_get_data_float_const | ||||||||||||||||||
#define | CPL_IMAGE_GET_MEDIAN cpl_tools_get_median_float | ||||||||||||||||||
#define | XSH_DOUBLE_SWAP(a, b) { register double t=(a);(a)=(b);(b)=t; } | ||||||||||||||||||
#define | XSH_FLOAT_SWAP(a, b) { register float t=(a);(a)=(b);(b)=t; } | ||||||||||||||||||
#define | XSH_INT_SWAP(a, b) { register int t=(a);(a)=(b);(b)=t; } | ||||||||||||||||||
#define | XSH_PIX_STACK_SIZE 50 | ||||||||||||||||||
Functions | |||||||||||||||||||
cpl_image * | xsh_imagelist_collapse_sigclip_iter_create (const cpl_imagelist *imlist, double sigma_low, double sigma_upp, const int niter) | ||||||||||||||||||
Average with sigma-clipping rejection an imagelist to a single image. | |||||||||||||||||||
double | xsh_hms2deg (const double hms) | ||||||||||||||||||
Convert a double from hours minute seconds to deg:. | |||||||||||||||||||
double | xsh_sess2deg (const double sess) | ||||||||||||||||||
Convert a double from ssessagesimal to deg: 203049.197= 20:30:49.197 = 20.5136658333. | |||||||||||||||||||
cpl_error_code | xsh_check_input_is_unbinned (cpl_frame *in) | ||||||||||||||||||
Check if an input frame is not binned. | |||||||||||||||||||
int | xsh_fileutils_copy (const char *srcpath, const char *dstpath) | ||||||||||||||||||
int | xsh_fileutils_move (const char *srcpath, const char *dstpath) | ||||||||||||||||||
const char * | xsh_set_recipe_sky_file_prefix (char *rec_prefix) | ||||||||||||||||||
Set recipe sky frames prefix. | |||||||||||||||||||
char * | xsh_set_recipe_file_prefix (cpl_frameset *raw, const char *recipe) | ||||||||||||||||||
Set recipe frames prefix. | |||||||||||||||||||
cpl_error_code | xsh_set_cd_matrix (cpl_propertylist *plist) | ||||||||||||||||||
Set CD matrix. | |||||||||||||||||||
cpl_error_code | xsh_set_cd_matrix1d (cpl_propertylist *plist) | ||||||||||||||||||
Set CD matrix. | |||||||||||||||||||
cpl_error_code | xsh_set_cd_matrix2d (cpl_propertylist *plist) | ||||||||||||||||||
Set CD matrix. | |||||||||||||||||||
cpl_error_code | xsh_set_cd_matrix3d (cpl_propertylist *plist) | ||||||||||||||||||
Set CD matrix. | |||||||||||||||||||
cpl_parameterlist * | xsh_parameterlist_duplicate (const cpl_parameterlist *pin) | ||||||||||||||||||
Extract frames with given tag from frameset. | |||||||||||||||||||
static void | xsh_property_dump (cpl_property *property) | ||||||||||||||||||
Dump property. | |||||||||||||||||||
cpl_frame * | xsh_frameset_average (cpl_frameset *set, const char *tag) | ||||||||||||||||||
Dump propertylist. | |||||||||||||||||||
cpl_frame * | xsh_frameset_add (cpl_frameset *set, xsh_instrument *instr, const int decode_bp) | ||||||||||||||||||
coadd frames in a frameset | |||||||||||||||||||
void | xsh_plist_dump (cpl_propertylist *plist) | ||||||||||||||||||
Dump propertylist. | |||||||||||||||||||
cpl_error_code | xsh_frameset_dump (cpl_frameset *set) | ||||||||||||||||||
Dump frameset. | |||||||||||||||||||
cpl_error_code | xsh_frameset_dump_nod_info (cpl_frameset *set) | ||||||||||||||||||
Dump frameset nod info. | |||||||||||||||||||
void | xsh_init (void) | ||||||||||||||||||
Reset library state. | |||||||||||||||||||
char * | xsh_get_basename (const char *filename) | ||||||||||||||||||
Return base filename. | |||||||||||||||||||
const char * | xsh_get_license (void) | ||||||||||||||||||
Get the pipeline copyright and license. | |||||||||||||||||||
cpl_error_code | xsh_begin (cpl_frameset *frames, const cpl_parameterlist *parameters, xsh_instrument **instrument, cpl_frameset **raws, cpl_frameset **calib, const char *tag_list[], int tag_list_size, const char *recipe_id, unsigned int binary_version, const char *short_descr) | ||||||||||||||||||
Recipe initialization. | |||||||||||||||||||
void | xsh_add_temporary_file (const char *name) | ||||||||||||||||||
Add temporary file to temprary files list. | |||||||||||||||||||
void | xsh_free_temporary_files (void) | ||||||||||||||||||
Free temprary files list. | |||||||||||||||||||
void | xsh_add_product_file (const char *name) | ||||||||||||||||||
Add temporary file to temprary files list. | |||||||||||||||||||
void | xsh_free_product_files (void) | ||||||||||||||||||
Free temprary files list. | |||||||||||||||||||
cpl_error_code | xsh_end (const char *recipe_id, cpl_frameset *frames, cpl_parameterlist *parameters) | ||||||||||||||||||
Recipe termination. | |||||||||||||||||||
cpl_error_code | xsh_get_property_value (const cpl_propertylist *plist, const char *keyword, cpl_type keywordtype, void *result) | ||||||||||||||||||
Read a property value from a property list. | |||||||||||||||||||
char * | xsh_stringdup (const char *s) | ||||||||||||||||||
String duplication. | |||||||||||||||||||
char * | xsh_sdate_utc (time_t *now) | ||||||||||||||||||
char * | xsh_stringcat (const char *s1, const char *s2) | ||||||||||||||||||
String concatenation. | |||||||||||||||||||
char * | xsh_stringcat_3 (const char *s1, const char *s2, const char *s3) | ||||||||||||||||||
String concatenation. | |||||||||||||||||||
char * | xsh_stringcat_4 (const char *s1, const char *s2, const char *s3, const char *s4) | ||||||||||||||||||
String concatenation. | |||||||||||||||||||
char * | xsh_stringcat_5 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5) | ||||||||||||||||||
String concatenation. | |||||||||||||||||||
char * | xsh_stringcat_6 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6) | ||||||||||||||||||
String concatenation. | |||||||||||||||||||
char * | xsh_stringcat_any (const char *s,...) | ||||||||||||||||||
Concatenate an arbitrary number of strings. | |||||||||||||||||||
int * | xsh_sort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) | ||||||||||||||||||
Sort an array and give is index table. | |||||||||||||||||||
void | xsh_reindex (double *data, int *idx, int size) | ||||||||||||||||||
TO BE DESCRIBED. | |||||||||||||||||||
void | xsh_reindex_float (float *data, int *idx, int size) | ||||||||||||||||||
TO BE DESCRIBED. | |||||||||||||||||||
void | xsh_reindex_int (int *data, int *idx, int size) | ||||||||||||||||||
TO BE DESCRIBED. | |||||||||||||||||||
void | xsh_free (const void *mem) | ||||||||||||||||||
Deallocate memory. | |||||||||||||||||||
void | xsh_free_image (cpl_image **i) | ||||||||||||||||||
Deallocate an image and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_table (cpl_table **t) | ||||||||||||||||||
Deallocate a table and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_mask (cpl_mask **m) | ||||||||||||||||||
Deallocate an image mask and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_imagelist (cpl_imagelist **i) | ||||||||||||||||||
Deallocate an image list and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_propertylist (cpl_propertylist **p) | ||||||||||||||||||
Deallocate a property list and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_polynomial (cpl_polynomial **p) | ||||||||||||||||||
Deallocate a polynomial and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_matrix (cpl_matrix **m) | ||||||||||||||||||
Deallocate a matrix and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_parameterlist (cpl_parameterlist **p) | ||||||||||||||||||
Deallocate a parameter list and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_parameter (cpl_parameter **p) | ||||||||||||||||||
Deallocate a parameter and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_frameset (cpl_frameset **f) | ||||||||||||||||||
Deallocate a frame set and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_frame (cpl_frame **f) | ||||||||||||||||||
Deallocate a frame and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_vector (cpl_vector **v) | ||||||||||||||||||
Deallocate a vector and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_array (cpl_array **m) | ||||||||||||||||||
Deallocate an array and set the pointer to NULL. | |||||||||||||||||||
void | xsh_free_stats (cpl_stats **s) | ||||||||||||||||||
Deallocate a stats object and set the pointer to NULL. | |||||||||||||||||||
void | xsh_unwrap_image (cpl_image **i) | ||||||||||||||||||
Unwrap an image and set the pointer to NULL. | |||||||||||||||||||
void | xsh_unwrap_vector (cpl_vector **v) | ||||||||||||||||||
Unwrap a vector and set the pointer to NULL. | |||||||||||||||||||
void | xsh_unwrap_array (cpl_array **a) | ||||||||||||||||||
Unwrap an array and set the pointer to NULL. | |||||||||||||||||||
void | xsh_unwrap_bivector_vectors (cpl_bivector **b) | ||||||||||||||||||
Unwrap a bi-vector and set the pointer to NULL. | |||||||||||||||||||
void | xsh_show_time (const char *comment) | ||||||||||||||||||
show time | |||||||||||||||||||
void | xsh_tools_get_statistics (double *tab, int size, double *median, double *mean, double *stdev) | ||||||||||||||||||
Compute median, stdev and mean for the tab. | |||||||||||||||||||
cpl_error_code | xsh_tools_sort_double (double *pix_arr, int n) | ||||||||||||||||||
Sort a double array. | |||||||||||||||||||
cpl_error_code | xsh_tools_sort_float (float *pix_arr, int n) | ||||||||||||||||||
Sort a float array. | |||||||||||||||||||
cpl_error_code | xsh_tools_sort_int (int *pix_arr, int n) | ||||||||||||||||||
Sort an integer array. | |||||||||||||||||||
double | xsh_tools_get_median_double (double *array, int size) | ||||||||||||||||||
Calculates the median value of an array of double. | |||||||||||||||||||
int | xsh_tools_running_median_1d_get_max (double *tab, int size, int wsize) | ||||||||||||||||||
get max of a list of doubles after running median | |||||||||||||||||||
void | xsh_tools_min_max (int size, double *tab, double *min, double *max) | ||||||||||||||||||
computes min & max in ab array | |||||||||||||||||||
cpl_vector * | xsh_tools_tchebitchev_poly_eval (int n, double X) | ||||||||||||||||||
Compute tchebitchev Tn(X) first coefficient for tchebitchev polynomial. | |||||||||||||||||||
void | xsh_tools_tchebitchev_transform_tab (int size, double *pos, double min, double max, double *tcheb_pos) | ||||||||||||||||||
computes Tchebitchev transformation | |||||||||||||||||||
double | xsh_tools_tchebitchev_transform (double pos, double min, double max) | ||||||||||||||||||
computes Tchebitchev transformation | |||||||||||||||||||
double | xsh_tools_tchebitchev_reverse_transform (double pos, double min, double max) | ||||||||||||||||||
computes reverse Tchebitchev transformation | |||||||||||||||||||
void | xsh_image_fit_spline (cpl_image *img, xsh_grid *grid) | ||||||||||||||||||
perform spline fit | |||||||||||||||||||
void | xsh_vector_fit_gaussian (cpl_vector *x, cpl_vector *y, XSH_GAUSSIAN_FIT *result) | ||||||||||||||||||
set debug level | |||||||||||||||||||
int | xsh_debug_level_set (int level) | ||||||||||||||||||
set debug level | |||||||||||||||||||
int | xsh_debug_level_get (void) | ||||||||||||||||||
get debug level | |||||||||||||||||||
const char * | xsh_debug_level_tostring (void) | ||||||||||||||||||
set debug level | |||||||||||||||||||
int | xsh_time_stamp_set (int ts) | ||||||||||||||||||
set timestamp | |||||||||||||||||||
int | xsh_time_stamp_get (void) | ||||||||||||||||||
get timestamp | |||||||||||||||||||
void | xsh_mem_dump (const char *prompt) | ||||||||||||||||||
double | convert_bin_to_data (double bin_data, int binning) | ||||||||||||||||||
double | convert_data_to_bin (double data, int binning) | ||||||||||||||||||
static double | date_to_double (const char *the_date) | ||||||||||||||||||
static int | compare_frame_date (const void *one, const void *two) | ||||||||||||||||||
cpl_frameset * | xsh_order_frameset_by_date (cpl_frameset *frameset) | ||||||||||||||||||
Order frameset by date. | |||||||||||||||||||
polynomial * | xsh_polynomial_regression_2d (cpl_table *t, const char *X1, const char *X2, const char *Y, const char *sigmaY, int degree1, int degree2, const char *polynomial_fit, const char *residual_square, const char *variance_fit, double *mse, double *red_chisq, polynomial **variance, double kappa, double min_reject) | ||||||||||||||||||
Fit a 2d polynomial to three table columns. | |||||||||||||||||||
int | xsh_select_table_rows (cpl_table *t, const char *column, cpl_table_select_operator operator, double value) | ||||||||||||||||||
Select table rows. | |||||||||||||||||||
int | xsh_erase_table_rows (cpl_table *t, const char *column, cpl_table_select_operator operator, double value) | ||||||||||||||||||
Erase table rows. | |||||||||||||||||||
cpl_frame * | xsh_frame_inv (cpl_frame *in, const char *filename, xsh_instrument *instr) | ||||||||||||||||||
Inverse the flux of a PRE frame. | |||||||||||||||||||
cpl_frame * | xsh_frame_abs (cpl_frame *in, xsh_instrument *instr, cpl_frame **sign) | ||||||||||||||||||
Computes absolute value of a frame. | |||||||||||||||||||
void | xsh_frame_image_save (cpl_frame *frm, const char *name_o) | ||||||||||||||||||
save an image frame | |||||||||||||||||||
void | xsh_frame_table_save (cpl_frame *frame, const char *name_o) | ||||||||||||||||||
Save a table frame. | |||||||||||||||||||
cpl_frame * | xsh_frame_mult (cpl_frame *in, xsh_instrument *instr, cpl_frame *sign) | ||||||||||||||||||
Computes product of two input frames. | |||||||||||||||||||
cpl_error_code | xsh_monitor_flux (cpl_frame *frm_ima, const cpl_frame *frm_tab, xsh_instrument *instrument) | ||||||||||||||||||
Monitor Flux level along the orders traces given by an input table. | |||||||||||||||||||
cpl_error_code | xsh_update_pheader_in_image_multi (cpl_frame *frame, const cpl_propertylist *pheader) | ||||||||||||||||||
Update FITS header. | |||||||||||||||||||
double | xsh_vector_get_err_median (cpl_vector *vect) | ||||||||||||||||||
Computes median error on a data set. | |||||||||||||||||||
double | xsh_vector_get_err_mean (cpl_vector *vect) | ||||||||||||||||||
Computes mean error on a data set. | |||||||||||||||||||
long | xsh_round_double (double x) | ||||||||||||||||||
Computes round(x). | |||||||||||||||||||
int | xsh_min_int (int x, int y) | ||||||||||||||||||
Minimum of two numbers. | |||||||||||||||||||
int | xsh_max_int (int x, int y) | ||||||||||||||||||
Maximum of two numbers. | |||||||||||||||||||
double | xsh_min_double (double x, double y) | ||||||||||||||||||
Minimum of two numbers. | |||||||||||||||||||
double | xsh_max_double (double x, double y) | ||||||||||||||||||
Maximum of two numbers. | |||||||||||||||||||
double | xsh_pow_int (double x, int y) | ||||||||||||||||||
Computes x^y. | |||||||||||||||||||
const char * | xsh_string_tolower (char *s) | ||||||||||||||||||
Convert all uppercase characters in a string into lowercase characters. | |||||||||||||||||||
const char * | xsh_string_toupper (char *s) | ||||||||||||||||||
Convert all lowercase characters in a string into uppercase characters. | |||||||||||||||||||
double | xsh_spline_hermite (double xp, const double *x, const double *y, int n, int *istart) | ||||||||||||||||||
Spline interpolation based on Hermite polynomials. | |||||||||||||||||||
double | xsh_spline_hermite_table (double xp, const cpl_table *t, const char *column_x, const char *column_y, int *istart) | ||||||||||||||||||
Spline interpolation based on Hermite polynomials. | |||||||||||||||||||
static int | xsh_wavecal_find_nearest (const cpl_table *line_refer, const char *col_ref, double lambda, int lo, int hi) | ||||||||||||||||||
Find best matching catalogue wavelength. | |||||||||||||||||||
static cpl_error_code | xsh_wavecal_qclog_compute (cpl_table *temp, cpl_propertylist **header_check, const char *element) | ||||||||||||||||||
computes intmon QC log | |||||||||||||||||||
static cpl_table * | xsh_table_select_matching_waves (cpl_table *table_intmon, const char *col_wave_intmon, cpl_table *table_check, const char *col_wave_intcheck, const double exptime) | ||||||||||||||||||
Match reference and actual table via wavelength column. | |||||||||||||||||||
static cpl_error_code | xsh_wavecal_qclog_element (cpl_table *table_intmon, cpl_table *table_check, const double exptime, const char *atom_name, cpl_propertylist **header_check) | ||||||||||||||||||
computes intmon QC log | |||||||||||||||||||
cpl_error_code | xsh_wavecal_qclog_intmon (cpl_frame *line_check, const cpl_frame *line_intmon, const double exptime, xsh_instrument *inst) | ||||||||||||||||||
computes intmon QC log | |||||||||||||||||||
cpl_error_code | xsh_get_table_value (const cpl_table *table, const char *colname, cpl_type coltype, int i, void *result) | ||||||||||||||||||
Read a table value from a fits table. | |||||||||||||||||||
cpl_error_code | xsh_sort_table_1 (cpl_table *t, const char *column, cpl_boolean reverse) | ||||||||||||||||||
Sort a table by one column. | |||||||||||||||||||
cpl_error_code | xsh_sort_table_2 (cpl_table *t, const char *column1, const char *column2, cpl_boolean reverse1, cpl_boolean reverse2) | ||||||||||||||||||
Sort a table by two columns. | |||||||||||||||||||
double | xsh_data_interpolate (double wav, int nrow, double *pw, double *pe) | ||||||||||||||||||
Interpolate data points. | |||||||||||||||||||
double | xsh_table_interpolate (cpl_table *tbl, double wav, const char *colx, const char *coly) | ||||||||||||||||||
Interpolate table columns. | |||||||||||||||||||
static cpl_error_code | xsh_table_monitor_flux_qc (cpl_table *table, const double ws, const double we, const char *prefix, const int index, cpl_propertylist **header) | ||||||||||||||||||
Computes statistics on spectrum for QC. | |||||||||||||||||||
static cpl_propertylist * | xsh_frame_table_monitor_flux_qc_ext (cpl_table *table, const char *colw, const char *colf, const char *prefix, xsh_instrument *instrument) | ||||||||||||||||||
Computes statistics on spectrum for QC. | |||||||||||||||||||
cpl_error_code | xsh_frame_table_monitor_flux_qc (cpl_frame *frm, const char *colw, const char *colf, const char *prefix, xsh_instrument *instrument) | ||||||||||||||||||
Computes statistics on spectrum for QC. | |||||||||||||||||||
cpl_error_code | xsh_table_merge_clean_and_resid_tabs (cpl_frame *frm_resid, cpl_frame *frm_clean) | ||||||||||||||||||
cpl_table * | xsh_table_shift_rv (cpl_table *orig, const char *col_wave, const double offset) | ||||||||||||||||||
Variables | |||||||||||||||||||
static char ** | TempFiles = NULL | ||||||||||||||||||
static int | NbTemp = 0 | ||||||||||||||||||
static char ** | ProdFiles = NULL | ||||||||||||||||||
static int | NbProducts = 0 | ||||||||||||||||||
int | FRAME_DATE_IDX::frame_idx | ||||||||||||||||||
cpl_frame * | FRAME_DATE_IDX::frame | ||||||||||||||||||
const char * | FRAME_DATE_IDX::frame_name | ||||||||||||||||||
double * | data::y | ||||||||||||||||||
double * | data::x | ||||||||||||||||||
int | data::deg | ||||||||||||||||||
xsh_image_to_vector() | |||||||||||||||||||
converts a fits image to a spectral vector
| |||||||||||||||||||
cpl_vector * | xsh_image_to_vector (cpl_image *spectrum) | ||||||||||||||||||
cpl_image * | xsh_vector_to_image (const cpl_vector *vector, cpl_type type) | ||||||||||||||||||
Convert a vector to a 1d image. | |||||||||||||||||||
cpl_frame * | xsh_util_multiply_by_response (cpl_frame *merged_sci, cpl_frame *response, const char *tag_o) | ||||||||||||||||||
Multiply input frame by response frame. | |||||||||||||||||||
cpl_frame * | xsh_util_multiply_by_response_ord (cpl_frame *extracted_sci, cpl_frame *response, const char *tag_o) | ||||||||||||||||||
Multiply input frame by response frame. | |||||||||||||||||||
static cpl_error_code | xsh_util_get_infsup (double *piw, double w, int i_start, int i_end, int *i_inf, int *i_sup) | ||||||||||||||||||
static double | xsh_spectrum_integrate (double *pif, double *piw, int i1_inf, int i1_sup, int i2_inf, int i2_sup, double wave, double wstep) | ||||||||||||||||||
cpl_frame * | xsh_spectrum_resample (cpl_frame *frame_inp, const double wstep, const double wmin, const double wmax, xsh_instrument *instr) | ||||||||||||||||||
resample a spectrum | |||||||||||||||||||
cpl_frame * | xsh_util_frameset_collapse_mean (cpl_frameset *set, xsh_instrument *instrument) | ||||||||||||||||||
Compute mean frame from a list of (IMAGE) framesets. | |||||||||||||||||||
cpl_error_code | xsh_normalize_spectrum_image_slice (const char *name_s, const char *tag_o, const int ext, const int binx, const double gain, const double exptime, const double airmass, const cpl_table *tbl_atm_ext) | ||||||||||||||||||
Normalize spectrum slice. | |||||||||||||||||||
cpl_frame * | xsh_normalize_spectrum (const cpl_frame *obj_frame, const cpl_frame *atm_ext_frame, cpl_boolean correct_binning, xsh_instrument *instrument, const char *tag_o) | ||||||||||||||||||
Normalize a spectrum. | |||||||||||||||||||
cpl_frame * | xsh_normalize_spectrum_ord (const cpl_frame *obj_frame, const cpl_frame *atm_ext_frame, cpl_boolean correct_binning, xsh_instrument *instrument, const char *tag_o) | ||||||||||||||||||
Normalize a spectrum. | |||||||||||||||||||
cpl_image * | xsh_normalize_spectrum_image (const cpl_image *spectrum, const cpl_image *spectrum_error, const cpl_propertylist *spectrum_header, const int binx, const double gain, const double exptime, const double airmass, const int n_traces, const cpl_table *atm_extinction, cpl_image **scaled_error) | ||||||||||||||||||
Normalize a spectrum. | |||||||||||||||||||
static double | xsh_iterpol_linear (double *data_x, double *data_y, int ndata, double x, int *i_inf, int *i_sup) | ||||||||||||||||||
cpl_frame * | xsh_spectrum_interpolate_linear (cpl_frame *table_frame, const double wstep, const double wmin, const double wmax) | ||||||||||||||||||
spectra interpolation | |||||||||||||||||||
cpl_frame * | xsh_spectrum_interpolate (cpl_frame *table_frame, const double wstep, const double wmin, const double wmax) | ||||||||||||||||||
spectra interpolation | |||||||||||||||||||
void | xsh_array_clip_mean (cpl_array *array, double kappa, int niter, double frac_min, double *mean, double *stdev) | ||||||||||||||||||
mean clip of an array | |||||||||||||||||||
void | xsh_array_clip_median (cpl_array *array, double kappa, int niter, double frac_min, double *median, double *stdev) | ||||||||||||||||||
median clip of an array | |||||||||||||||||||
void | xsh_array_clip_poly1d (cpl_vector *pos_vect, cpl_vector *val_vect, double kappa, int niter, double frac_min, int deg, cpl_polynomial **polyp, double *chisq, int **flagsp) | ||||||||||||||||||
clip outliers from a 1D poly fit | |||||||||||||||||||
cpl_error_code | xsh_rectify_params_set_defaults (cpl_parameterlist *pars, const char *rec_id, xsh_instrument *inst, xsh_rectify_param *rectify_par) | ||||||||||||||||||
static int | expb_f (const gsl_vector *x, void *data, gsl_vector *f) | ||||||||||||||||||
static int | expb_df (const gsl_vector *x, void *data, gsl_matrix *J) | ||||||||||||||||||
static int | expb_fdf (const gsl_vector *x, void *data, gsl_vector *f, gsl_matrix *J) | ||||||||||||||||||
void | xsh_gsl_init_gaussian_fit (cpl_vector *xpos_vect, cpl_vector *ypos_vect, double *init_par) | ||||||||||||||||||
void | xsh_gsl_fit_gaussian (cpl_vector *xpos_vect, cpl_vector *ypos_vect, int deg, double *params, double *errs, int *status) | ||||||||||||||||||
xsh_xcorrelate | |||||||||||||||||||
Cross-correlation of two 1d signals.
Two signals are expected in input of this function: a reference signal (line_i) and a candidate signal (line_t) . They are expected to be roughly the same signal up to an offset (delta) A cross-correlation is computed on 2*half_search+1 values. The maximum of likelihood is the maximum cross-correlation value between signals. The offset 'delta' corresponding to this position is returned. Returns -100.0 in case of error. Normally, the cross-sinfo_correlation coefficient is normalized so it should stay between -1 and +1. | |||||||||||||||||||
double * | xsh_function1d_xcorrelate (double *line_i, int width_i, double *line_t, int width_t, int half_search, int normalise, double *xcorr_max, double *delta) |
This module is for the stuff that don't fit anywhere else. It should be kept as small as possible.
#define CPL_IMAGE_GET_DATA cpl_image_get_data_float |
Definition at line 100 of file xsh_utils.c.
Referenced by xsh_imagelist_collapse_sigclip_iter_create().
#define CPL_IMAGE_GET_DATA_CONST cpl_image_get_data_float_const |
Definition at line 101 of file xsh_utils.c.
Referenced by xsh_imagelist_collapse_sigclip_iter_create().
#define CPL_IMAGE_GET_MEDIAN cpl_tools_get_median_float |
Definition at line 102 of file xsh_utils.c.
#define CPL_TYPE float |
Definition at line 98 of file xsh_utils.c.
#define CPL_TYPE_T CPL_TYPE_FLOAT |
Definition at line 99 of file xsh_utils.c.
Referenced by xsh_imagelist_collapse_sigclip_iter_create().
#define XSH_DOUBLE_SWAP | ( | a, | |||
b | ) | { register double t=(a);(a)=(b);(b)=t; } |
Definition at line 2336 of file xsh_utils.c.
Referenced by xsh_tools_sort_double().
#define XSH_FLOAT_SWAP | ( | a, | |||
b | ) | { register float t=(a);(a)=(b);(b)=t; } |
Definition at line 2337 of file xsh_utils.c.
Referenced by xsh_tools_sort_float().
#define XSH_INT_SWAP | ( | a, | |||
b | ) | { register int t=(a);(a)=(b);(b)=t; } |
Definition at line 2338 of file xsh_utils.c.
Referenced by xsh_tools_sort_int().
#define XSH_PIX_STACK_SIZE 50 |
Definition at line 2340 of file xsh_utils.c.
Referenced by xsh_tools_sort_double(), xsh_tools_sort_float(), and xsh_tools_sort_int().
static int compare_frame_date | ( | const void * | one, | |
const void * | two | |||
) | [static] |
Definition at line 3217 of file xsh_utils.c.
References first, and FRAME_DATE_IDX::frame_date.
Referenced by xsh_order_frameset_by_date().
double convert_bin_to_data | ( | double | bin_data, | |
int | binning | |||
) |
Definition at line 3161 of file xsh_utils.c.
Referenced by xsh_dispersol_list_eval(), and xsh_order_list_eval().
double convert_data_to_bin | ( | double | data, | |
int | binning | |||
) |
Definition at line 3179 of file xsh_utils.c.
Referenced by fill_rectified(), xsh_order_list_eval(), xsh_order_list_get_endy(), xsh_order_list_get_starty(), xsh_wavesol_eval_polx(), and xsh_wavesol_eval_poly().
static double date_to_double | ( | const char * | the_date | ) | [static] |
Definition at line 3188 of file xsh_utils.c.
References mm, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_order_frameset_by_date().
static int expb_df | ( | const gsl_vector * | x, | |
void * | data, | |||
gsl_matrix * | J | |||
) | [static] |
Definition at line 6635 of file xsh_utils.c.
References data::deg, M_PI, n, and sigma.
Referenced by expb_fdf(), and xsh_gsl_fit_gaussian().
static int expb_f | ( | const gsl_vector * | x, | |
void * | data, | |||
gsl_vector * | f | |||
) | [static] |
Definition at line 6604 of file xsh_utils.c.
References M_PI, n, sigma, and y.
Referenced by expb_fdf(), and xsh_gsl_fit_gaussian().
static int expb_fdf | ( | const gsl_vector * | x, | |
void * | data, | |||
gsl_vector * | f, | |||
gsl_matrix * | J | |||
) | [static] |
Definition at line 6697 of file xsh_utils.c.
References expb_df(), and expb_f().
Referenced by xsh_gsl_fit_gaussian().
void xsh_add_product_file | ( | const char * | name | ) |
Add temporary file to temprary files list.
[in] | name | The name of the file |
Definition at line 1413 of file xsh_utils.c.
References NbProducts, and ProdFiles.
Referenced by xsh_add_product(), xsh_add_product_bpmap(), xsh_add_product_image(), xsh_add_product_imagelist(), xsh_add_product_pre(), xsh_add_product_pre_3d(), xsh_add_product_spectrum(), and xsh_add_product_vector().
void xsh_add_temporary_file | ( | const char * | name | ) |
Add temporary file to temprary files list.
[in] | name | The name of the file |
Definition at line 1374 of file xsh_utils.c.
References NbTemp, and TempFiles.
Referenced by xsh_2dmap(), xsh_add_product_image(), xsh_add_product_imagelist(), xsh_afcthetab_create(), xsh_badpixelmap_coadd(), xsh_badpixelmap_crea_master_from_bpmap(), xsh_badpixelmap_extract(), xsh_build_ifu_cube(), xsh_build_ifu_map(), xsh_check_load_master_bpmap(), xsh_check_remove_crh_single(), xsh_check_subtract_dark(), xsh_check_subtract_sky_single(), xsh_combine_nod(), xsh_compute_absorp(), xsh_compute_noise_map(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), xsh_compute_shift_ifu_slitlet(), xsh_compute_wavelength_resampling_accuracy(), xsh_create_dispersol_physmod(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_extract(), xsh_extract_clean(), xsh_flux_calibrate1D(), xsh_flux_calibrate2D(), xsh_follow_arclines(), xsh_frame_abs(), xsh_frame_build_sky_map(), xsh_frame_image_div_by_fct(), xsh_frame_image_mult_by_fct(), xsh_frameset_crh_single(), xsh_frameset_mflat_divide(), xsh_get_crh_frame(), xsh_get_master_dark_nir_via_noise(), xsh_linear(), xsh_linetilt_list_save(), xsh_localize_ifu_slitlet(), xsh_localize_obj(), xsh_model_maps_create(), xsh_model_temperature_update_frame(), xsh_nod_group_by_reloff(), xsh_nod_group_by_reloff2(), xsh_nod_median_correct_list_per_wavelength(), xsh_nod_rectify_and_shift_with_key(), xsh_opt_extract_orders(), xsh_order_split_qth_d2(), xsh_pre_frame_subtract(), xsh_pre_save(), xsh_predict(), xsh_preoverscan_corr(), xsh_rec_list_save_table(), xsh_rectify_orders(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_response_calculate(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod_accurate(), xsh_scired_slit_nod_fast(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_shift(), xsh_shift_tab_save(), xsh_slit_stare_correct_crh_and_sky(), xsh_spectrum_correct(), xsh_spectrum_interpolate(), xsh_spectrum_interpolate_linear(), xsh_spectrum_resample(), xsh_subtract_background(), xsh_subtract_nir_on_off(), xsh_subtract_sky_nod(), xsh_subtract_sky_single(), xsh_telluric_model_eval(), and xsh_util_frameset_collapse_mean().
void xsh_array_clip_mean | ( | cpl_array * | array, | |
double | kappa, | |||
int | niter, | |||
double | frac_min, | |||
double * | mean, | |||
double * | stdev | |||
) |
mean clip of an array
array | array of values to be clipped | |
kappa | kappa value of kappa sigma clip | |
niter | number of iterations | |
frac_min | minimum accepable fraction of good pixels | |
[out] | mean | mean of values after clipping |
[out] | stdev | sigma of values after clipping |
Definition at line 6289 of file xsh_utils.c.
References check, sigma, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, xsh_msg, and xsh_msg_dbg_medium.
void xsh_array_clip_median | ( | cpl_array * | array, | |
double | kappa, | |||
int | niter, | |||
double | frac_min, | |||
double * | median, | |||
double * | stdev | |||
) |
median clip of an array
array | array of values to be clipped | |
kappa | kappa value of kappa sigma clip | |
niter | number of iterations | |
frac_min | minimum accepable fraction of good pixels | |
[out] | median | median of values after clipping |
[out] | stdev | sigma of values after clipping |
Definition at line 6367 of file xsh_utils.c.
References check, sigma, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, and xsh_msg.
Referenced by compute_specres().
void xsh_array_clip_poly1d | ( | cpl_vector * | pos_vect, | |
cpl_vector * | val_vect, | |||
double | kappa, | |||
int | niter, | |||
double | frac_min, | |||
int | deg, | |||
cpl_polynomial ** | polyp, | |||
double * | chisq, | |||
int ** | flagsp | |||
) |
clip outliers from a 1D poly fit
pos_vect | vector with positions | |
val_vect | vector with values | |
kappa | kappa value of kappa sigma clip | |
niter | number of iterations | |
frac_min | minimum accepable fraction of good pixels | |
deg | degree of polynomial | |
polyp | polynomial | |
chisq | chi square | |
flagsp | flag parameter |
Definition at line 6442 of file xsh_utils.c.
References check, sigma, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, xsh_free_polynomial(), xsh_msg, xsh_msg_dbg_medium, xsh_polynomial_fit_1d_create(), and xsh_unwrap_vector().
Referenced by find_tilt(), and xsh_image_create_model_image().
cpl_error_code xsh_begin | ( | cpl_frameset * | frames, | |
const cpl_parameterlist * | parameters, | |||
xsh_instrument ** | instrument, | |||
cpl_frameset ** | raws, | |||
cpl_frameset ** | calib, | |||
const char * | tag_list[], | |||
int | tag_list_size, | |||
const char * | recipe_id, | |||
unsigned int | binary_version, | |||
const char * | short_descr | |||
) |
Recipe initialization.
frames | The input frame set | |
parameters | The input parameter list | |
instrument | Pointer to the instrument structure pointer | |
raws | Pointer to RAW Frameset | |
calib | Pointer to CALIB Frameset | |
tag_list | List of valid tags for the recipe | |
tag_list_size | size of List of valid tags for the recipe | |
recipe_id | Name of the recipe, e.g. xsh_mbias | |
binary_version | Recipe version (possibly different from pipeline version) | |
short_descr | A short description of what the recipe does |
This function should be called at the beginning of every recipe. It takes care of the mandatory tasks that are common for all recipes before the beginning of the data reduction.
xsh_dfs_set_groups()
), andSee also xsh_end()
.
Definition at line 1186 of file xsh_utils.c.
References assure, check, MAXIMUM, XSH_ARM_NIR, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, xsh_calib_nir_corr_if_JH(), xsh_debug_level_tostring(), xsh_dfs_files_dont_exist(), xsh_dfs_filter(), xsh_dfs_set_groups(), xsh_dfs_split_in_group(), xsh_instrument_get_arm(), xsh_instrument_nir_corr_if_JH(), xsh_instrument_nir_corr_if_spectral_format_is_JH(), xsh_instrument_set_decode_bp(), xsh_instrument_set_recipe_id(), xsh_msg, XSH_NEW_FRAMESET, xsh_parameters_debug_level_get(), xsh_parameters_find(), xsh_parameters_get_temporary(), xsh_print_cpl_frameset(), and xsh_stringcat_4().
Referenced by xsh_2dmap(), xsh_absorp(), xsh_cfg_recover_driver(), xsh_flexcomp(), xsh_geom_ifu(), xsh_linear(), xsh_lingain(), xsh_mbias(), xsh_mdark(), xsh_mflat(), xsh_orderpos(), xsh_predict(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_util_afc(), xsh_util_apply_response(), xsh_util_bpmap_coadd(), xsh_util_bpmap_nl_raw2pre(), xsh_util_compute_response(), xsh_util_crh_single(), xsh_util_efficiency1d(), xsh_util_efficiency2d(), xsh_util_guess_xy(), xsh_util_ifu_build_cube(), xsh_util_ima_arith(), xsh_util_integrate(), xsh_util_physmod(), and xsh_wavecal().
cpl_error_code xsh_check_input_is_unbinned | ( | cpl_frame * | in | ) |
Check if an input frame is not binned.
in | input frame |
Definition at line 317 of file xsh_utils.c.
References binx, biny, xsh_free_propertylist(), xsh_msg_error, xsh_pfits_get_binx(), and xsh_pfits_get_biny().
Referenced by xsh_2dmap(), xsh_orderpos(), and xsh_predict().
double xsh_data_interpolate | ( | double | wav, | |
int | nrow, | |||
double * | pw, | |||
double * | pe | |||
) |
Interpolate data points.
wav | value at which is desired an interpolated value | |
nrow | number of data points | |
pw | pointer to wave array | |
pe | pointer to efficiency array |
Definition at line 495 of file xsh_utils_table.c.
References y.
Referenced by fill_rectified(), xsh_compute_shift_ifu_slitlet(), xsh_interpolate_atm_ext(), xsh_localize_ifu_slitlet(), and xsh_table_interpolate().
int xsh_debug_level_get | ( | void | ) |
get debug level
Definition at line 3075 of file xsh_utils.c.
References XshDebugLevel.
Referenced by create_resid_tab(), detect_centroid(), fill_rectified(), fit_spline(), flag_noisy_pixels(), xsh_compute_flat_edges(), xsh_create_dispersol_physmod(), xsh_create_order_table(), xsh_create_poly_wavemap(), xsh_detect_arclines(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_fit_gaussian(), xsh_image_extract_optimal(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_opt_extract_orders(), xsh_optextract_produce_model(), xsh_order_frameset_by_date(), xsh_order_table_from_fmtchk(), xsh_response_calculate(), xsh_vector_integrate(), xsh_wavelist_subtract_sky(), and xsh_wavemap_list_build_sky().
int xsh_debug_level_set | ( | int | level | ) |
set debug level
level | error level |
Definition at line 3058 of file xsh_utils.c.
References XshDebugLevel.
Referenced by HandleOptions(), main(), xsh_model_reduce(), and xsh_parameters_debug_level_get().
const char* xsh_debug_level_tostring | ( | void | ) |
set debug level
Definition at line 3088 of file xsh_utils.c.
References XSH_DEBUG_LEVEL_HIGH, XSH_DEBUG_LEVEL_LOW, XSH_DEBUG_LEVEL_MEDIUM, XSH_DEBUG_LEVEL_NONE, and XshDebugLevel.
Referenced by xsh_begin().
cpl_error_code xsh_end | ( | const char * | recipe_id, | |
cpl_frameset * | frames, | |||
cpl_parameterlist * | parameters | |||
) |
Recipe termination.
recipe_id | Name of calling recipe | |
frames | The output frame set | |
parameters | The input parameter list |
This function is called at the end of every recipe. The output frame set is printed, and the number of warnings produced by the recipe is summarized.
See also xsh_begin()
.
Definition at line 1460 of file xsh_utils.c.
References NbTemp, TempFiles, xsh_free_product_files(), xsh_free_temporary_files(), xsh_msg, xsh_msg_get_warnings(), xsh_msg_warning, xsh_parameters_get_temporary(), and xsh_print_cpl_frame().
Referenced by xsh_2dmap(), xsh_absorp(), xsh_cfg_recover_last_step(), xsh_flexcomp(), xsh_geom_ifu(), xsh_linear(), xsh_mbias(), xsh_mdark(), xsh_mflat(), xsh_orderpos(), xsh_predict(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_util_ifu_build_cube(), and xsh_wavecal().
int xsh_erase_table_rows | ( | cpl_table * | t, | |
const char * | column, | |||
cpl_table_select_operator | operator, | |||
double | value | |||
) |
Erase table rows.
t | Table | |
column | Column name | |
operator | Logical operator | |
value | Value used for comparison |
A table row is erased if and only if the value in column is in the relation operator to the specified value. The specified column must have type CPL_TYPE_DOUBLE or CPL_TYPE_INT. If integer, the integer nearest to value is used for the comparison.
The table selection flags are reset.
Also see cpl_table_and_selected_<type>()
.
Definition at line 3782 of file xsh_utils.c.
References assure, check_msg, and xsh_select_table_rows().
Referenced by xsh_polynomial_regression_2d().
int xsh_fileutils_copy | ( | const char * | srcpath, | |
const char * | dstpath | |||
) |
Definition at line 371 of file xsh_utils.c.
References DEV_BLOCKSIZE.
Referenced by xsh_fileutils_move().
int xsh_fileutils_move | ( | const char * | srcpath, | |
const char * | dstpath | |||
) |
Definition at line 476 of file xsh_utils.c.
References xsh_fileutils_copy().
Referenced by xsh_add_product_table().
cpl_frame* xsh_frame_abs | ( | cpl_frame * | in, | |
xsh_instrument * | instr, | |||
cpl_frame ** | sign | |||
) |
Computes absolute value of a frame.
in | input frame | |
instr | instrument setting | |
sign | input frame |
Definition at line 3844 of file xsh_utils.c.
References check, xsh_add_temporary_file(), XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_image(), xsh_pre_abs(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().
Referenced by xsh_abs_remove_crh_single().
void xsh_frame_image_save | ( | cpl_frame * | frm, | |
const char * | name_o | |||
) |
save an image frame
frm | frame | |
name_o | output filename |
Definition at line 3890 of file xsh_utils.c.
References xsh_free_image().
cpl_frame* xsh_frame_inv | ( | cpl_frame * | in, | |
const char * | filename, | |||
xsh_instrument * | instr | |||
) |
Inverse the flux of a PRE frame.
in | The pre frame to inverse | |
filename | filename | |
instr | instrument setting |
Definition at line 3811 of file xsh_utils.c.
References check, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_pre_free(), xsh_pre_load(), xsh_pre_multiply_scalar(), and xsh_pre_save().
cpl_frame* xsh_frame_mult | ( | cpl_frame * | in, | |
xsh_instrument * | instr, | |||
cpl_frame * | sign | |||
) |
Computes product of two input frames.
in | input frame | |
instr | instrument structure | |
sign | input frame |
Definition at line 3956 of file xsh_utils.c.
References check, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_image(), xsh_pre_free(), xsh_pre_load(), xsh_pre_multiply_image(), and xsh_pre_save().
Referenced by xsh_abs_remove_crh_single().
cpl_error_code xsh_frame_table_monitor_flux_qc | ( | cpl_frame * | frm, | |
const char * | colw, | |||
const char * | colf, | |||
const char * | prefix, | |||
xsh_instrument * | instrument | |||
) |
Computes statistics on spectrum for QC.
[in] | frm | spectrum frame |
[in] | colw | wavelength column name |
[in] | colf | flux column name |
[in] | prefix | prefix of QC parameter |
[in] | instrument | instrument arm setting |
Definition at line 702 of file xsh_utils_table.c.
References check, XSH_ASSURE_NOT_NULL_MSG, xsh_frame_table_monitor_flux_qc_ext(), xsh_free_propertylist(), and xsh_free_table().
Referenced by xsh_compute_efficiency(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_util_compute_response(), and xsh_util_efficiency1d().
static cpl_propertylist* xsh_frame_table_monitor_flux_qc_ext | ( | cpl_table * | table, | |
const char * | colw, | |||
const char * | colf, | |||
const char * | prefix, | |||
xsh_instrument * | instrument | |||
) | [static] |
Computes statistics on spectrum for QC.
[in] | table | input table describing spectrum |
[in] | colw | wavelength column name |
[in] | colf | flux column name |
[in] | prefix | prefix of QC parameter |
[in] | instrument | instrument arm setting |
Definition at line 645 of file xsh_utils_table.c.
References check, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL_MSG, xsh_instrument_get_arm(), and xsh_table_monitor_flux_qc().
Referenced by xsh_frame_table_monitor_flux_qc().
void xsh_frame_table_save | ( | cpl_frame * | frame, | |
const char * | name_o | |||
) |
Save a table frame.
frame | input table frame | |
name_o | file name |
Definition at line 3912 of file xsh_utils.c.
References check, xsh_free_propertylist(), and xsh_free_table().
cpl_frame* xsh_frameset_add | ( | cpl_frameset * | set, | |
xsh_instrument * | instr, | |||
const int | decode_bp | |||
) |
coadd frames in a frameset
set | input frameset | |
instr | instrument arm setting |
Definition at line 863 of file xsh_utils.c.
References check, xsh_pre::nx, nx, xsh_pre::ny, ny, QFLAG_GOOD_PIXEL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, xsh_free_frame(), xsh_pre_duplicate(), xsh_pre_free(), xsh_pre_get_data(), xsh_pre_get_errs(), xsh_pre_get_qual(), xsh_pre_load(), and xsh_pre_save().
cpl_frame* xsh_frameset_average | ( | cpl_frameset * | set, | |
const char * | tag | |||
) |
Dump propertylist.
set | the input frameset | |
tag | the output frame tag |
Definition at line 817 of file xsh_utils.c.
References check, size, xsh_frame_product(), xsh_free_image(), xsh_free_imagelist(), and xsh_free_propertylist().
cpl_error_code xsh_frameset_dump | ( | cpl_frameset * | set | ) |
Dump frameset.
set | the input frameset |
Definition at line 996 of file xsh_utils.c.
cpl_error_code xsh_frameset_dump_nod_info | ( | cpl_frameset * | set | ) |
Dump frameset nod info.
set | the input frameset |
Definition at line 1030 of file xsh_utils.c.
References n, xsh_free_propertylist(), xsh_msg, xsh_msg_warning, XSH_NOD_CUMULATIVE_OFFSETY, XSH_NOD_JITTER_BOX, XSH_NOD_THROW, xsh_pfits_get_cumoffsety(), xsh_pfits_get_nod_jitterwidth(), and xsh_pfits_get_nodthrow().
void xsh_free | ( | const void * | mem | ) |
Deallocate memory.
mem | to deallocate |
Definition at line 2035 of file xsh_utils.c.
Referenced by xsh_add_product_bpmap(), xsh_add_product_image(), xsh_add_product_imagelist(), xsh_add_product_table(), xsh_polynomial_delete_const(), and xsh_util_bpmap_nl_raw2pre().
void xsh_free_array | ( | cpl_array ** | m | ) |
Deallocate an array and set the pointer to NULL.
m | Array to deallocate |
Definition at line 2232 of file xsh_utils.c.
Referenced by compute_specres(), xsh_cfg_recover_pattern_match(), xsh_image_mflat_detect_blemishes(), xsh_rec_list_save(), xsh_rec_list_save2(), and xsh_rec_list_save_table().
void xsh_free_frame | ( | cpl_frame ** | f | ) |
Deallocate a frame and set the pointer to NULL.
f | Frame to deallocate |
Definition at line 2202 of file xsh_utils.c.
Referenced by analyse_localization(), calculate_qc_parameters(), create_resid_tab(), create_zero_rectify(), main(), save_pre_frame(), shift_with_kw(), xsh_2dmap(), xsh_abs_remove_crh_single(), xsh_absorp(), xsh_add_product_pre(), xsh_add_product_pre_3d(), xsh_add_product_spectrum(), xsh_add_product_vector(), xsh_afcthetab_create(), xsh_badpixelmap_extract(), xsh_blaze_image(), xsh_build_ifu_cube(), xsh_cfg_recover_last_step(), xsh_cfg_recover_measure_line_xy(), xsh_check_load_master_bpmap(), xsh_combine_nod(), xsh_compute_absorp(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), xsh_compute_slice_dist(), xsh_compute_wavelength_resampling_accuracy(), xsh_create_dispersol_physmod(), xsh_create_master_bias2(), xsh_create_master_dark(), xsh_create_master_dark_bpmap(), xsh_cube(), xsh_dfs_split_nir(), xsh_dfs_split_offset(), xsh_dfs_split_qth_d2(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_divide_by_blaze(), xsh_divide_flat(), xsh_flexcomp(), xsh_flexcor(), xsh_flux_calibrate1D(), xsh_flux_calibrate2D(), xsh_frame_abs(), xsh_frame_inv(), xsh_frame_mult(), xsh_frame_product(), xsh_frame_qual_update(), xsh_frameset_add(), xsh_frameset_average_pre(), xsh_frameset_mflat_divide(), xsh_gain(), xsh_geom_ifu(), xsh_image_mflat_detect_blemishes(), xsh_linear(), xsh_lingain(), xsh_localize_obj(), xsh_mark_tell(), xsh_mbias(), xsh_mdark(), xsh_mflat(), xsh_model_first_anneal_save(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), xsh_model_THE_create(), xsh_monitor_spectrum1D_flux(), xsh_multiply_flat(), xsh_nod_rectify_and_shift_with_key(), xsh_opt_extract_orders(), xsh_orderpos(), xsh_phys_spectrum_save(), xsh_pre_3d_save(), xsh_pre_save(), xsh_pre_save_product(), xsh_predict(), xsh_preframe_extract(), xsh_prepare(), xsh_rectify_and_shift(), xsh_remove_cosmics(), xsh_resid_order_save(), xsh_resid_tab_save(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_response_calculate(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_nod_accurate(), xsh_scired_slit_nod_fast(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_scired_util_spectra_flux_calibrate(), xsh_shift(), xsh_shift_tab_save(), xsh_slit_stare_correct_crh_and_sky(), xsh_spectrum1D_save(), xsh_spectrum_correct(), xsh_spectrum_save(), xsh_spectrum_save_order(), xsh_subtract_background(), xsh_subtract_bias(), xsh_subtract_dark(), xsh_subtract_nir_on_off(), xsh_subtract_sky_single(), xsh_util_afc(), xsh_util_apply_response(), xsh_util_compute_response(), xsh_util_crh_single(), xsh_util_efficiency1d(), xsh_util_ifu_build_cube(), xsh_util_integrate(), xsh_util_model_SPF_create(), xsh_util_physmod(), xsh_util_physmod_model_THE_create(), xsh_wavecal(), and xsh_wavemap_list_save_poly().
void xsh_free_frameset | ( | cpl_frameset ** | f | ) |
Deallocate a frame set and set the pointer to NULL.
f | Frame set to deallocate |
Definition at line 2187 of file xsh_utils.c.
Referenced by main(), sof_to_frameset(), xsh_2dmap(), xsh_absorp(), xsh_cfg_recover_driver(), xsh_cfg_recover_last_step(), xsh_check_load_master_bpmap(), xsh_compute_shift_ifu(), xsh_correct_calib(), xsh_dfs_split_nir(), xsh_dfs_split_qth_d2(), xsh_ensure_raws_input_offset_recipe_is_proper(), xsh_extract_nod_pairs(), xsh_extract_obj_and_sky_pairs(), xsh_find_offset_tab_ifu(), xsh_flexcomp(), xsh_follow_arclines_ifu(), xsh_gain(), xsh_geom_ifu(), xsh_ifu_wavetab_create(), xsh_linear(), xsh_lingain(), xsh_localize_ifu(), xsh_localize_obj_ifu(), xsh_mbias(), xsh_mdark(), xsh_merge_ord_ifu(), xsh_mflat(), xsh_mflat_combine_flats(), xsh_model_first_anneal_save(), xsh_nod_group_by_reloff(), xsh_nod_group_by_reloff2(), xsh_order_frameset_by_date(), xsh_orderpos(), xsh_predict(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_nod_accurate(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_shift_offsettab(), xsh_subtract_nir_on_off(), xsh_subtract_on_off(), xsh_subtract_sky_nod(), xsh_subtract_sky_offset(), xsh_util_afc(), xsh_util_apply_response(), xsh_util_bpmap_coadd(), xsh_util_bpmap_nl_raw2pre(), xsh_util_compute_response(), xsh_util_efficiency1d(), xsh_util_efficiency2d(), xsh_util_guess_xy(), xsh_util_ifu_build_cube(), xsh_util_ima_arith(), xsh_util_ima_shift(), xsh_util_integrate(), xsh_util_physmod(), and xsh_wavecal().
void xsh_free_image | ( | cpl_image ** | i | ) |
Deallocate an image and set the pointer to NULL.
i | Image to deallocate |
Definition at line 2049 of file xsh_utils.c.
Referenced by compute_specres(), create_frame(), createFakeFrames(), fill_rectified(), get_masterbias_qc_structure_col_region(), get_masterbias_qc_structure_row_region(), main(), make_data_cube(), set_masterbias_qc_xsh_structure_region(), xsh_add_afc_info(), xsh_add_product(), xsh_add_product_bpmap(), xsh_add_product_image(), xsh_add_sky_model(), xsh_badpixelmap_coadd(), xsh_badpixelmap_crea_master_from_bpmap(), xsh_badpixelmap_extract(), xsh_badpixelmap_fill_bp_pattern_holes(), xsh_blaze_image(), xsh_build_ifu_cube(), xsh_build_ifu_map(), xsh_cfg_recover_linear_ext(), xsh_cfg_recover_measure_line_xy(), xsh_cfg_recover_measure_line_xy_fit(), xsh_check_load_master_bpmap(), xsh_combine_flats(), xsh_compute_flat_edges(), xsh_compute_linearity(), xsh_compute_noise_map(), xsh_compute_resampling_accuracy(), xsh_compute_ron(), xsh_compute_wavelength_resampling_accuracy(), xsh_crea_grid_from_mask(), xsh_create_blaze(), xsh_create_dispersol_physmod(), xsh_create_master_bias2(), xsh_create_master_dark2(), xsh_create_master_flat_with_mask(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_divide_by_blaze(), xsh_efficiency_compute(), xsh_extract_local_clean(), xsh_fixed_pattern_noise(), xsh_fixed_pattern_noise_bias(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_frame_abs(), xsh_frame_build_sky_area(), xsh_frame_build_sky_map(), xsh_frame_force_pro_catg(), xsh_frame_image_add_double(), xsh_frame_image_div_by_fct(), xsh_frame_image_ext_qc_trace_window(), xsh_frame_image_get_step(), xsh_frame_image_mult_by_fct(), xsh_frame_image_qc_trace_window(), xsh_frame_image_save(), xsh_frame_image_save2ext(), xsh_frame_mult(), xsh_frame_qual_update(), xsh_frameset_average(), xsh_frameset_average_pre(), xsh_gain(), xsh_get_master_dark_nir_via_noise(), xsh_gfit_tests(), xsh_ifu_trace_object_calibrate(), xsh_image_clean_badpixel(), xsh_image_compute_geom_corr(), xsh_image_create_gaussian_image(), xsh_image_create_model_image(), xsh_image_divide_1D(), xsh_image_flag_bptype_with_crox(), xsh_image_get_hot_cold_pixs(), xsh_image_get_stdev_clean(), xsh_image_get_stdev_robust(), xsh_image_mflat_detect_blemishes(), xsh_image_smooth_fft(), xsh_image_smooth_mean_y(), xsh_linear(), xsh_lingain(), xsh_mdark(), xsh_mdark_get_median_stdev(), xsh_mflat_normalize(), xsh_model_maps_create(), xsh_monitor_flux(), xsh_normalize_spectrum_image(), xsh_normalize_spectrum_image_slice(), xsh_object_localize(), xsh_opt_extract_orders(), xsh_optextract_produce_model(), xsh_pre_create(), xsh_pre_extract(), xsh_pre_free(), xsh_pre_multiply_image(), xsh_preoverscan_corr(), xsh_rec_list_load_eso(), xsh_rec_list_save2(), xsh_remove_cosmics(), xsh_remove_crh_single(), xsh_spectrum1D_free(), xsh_spectrum_free(), xsh_subtract_background(), xsh_subtract_sky_single(), xsh_test_create_frame(), xsh_update_pheader_in_image_multi(), xsh_util_afc(), xsh_util_bpmap2rp(), xsh_util_bpmap_coadd(), xsh_util_efficiency(), xsh_util_efficiency2d(), xsh_util_frameset_collapse_mean(), xsh_util_ifu_build_cube(), xsh_util_ima_arith(), xsh_util_ima_getextno(), xsh_util_ima_oversample(), xsh_util_ima_rebin(), xsh_util_ima_shift(), xsh_util_ima_subsample(), xsh_util_multiply_by_response(), xsh_util_multiply_by_response_ord(), xsh_vector_to_image(), xsh_wavemap_lambda_range(), xsh_wavemap_list_save(), xsh_wavemap_list_save2(), and xsh_wavemap_qc().
void xsh_free_imagelist | ( | cpl_imagelist ** | i | ) |
Deallocate an image list and set the pointer to NULL.
i | Image list to deallocate |
Definition at line 2097 of file xsh_utils.c.
Referenced by main(), xsh_add_product(), xsh_add_product_imagelist(), xsh_build_ifu_cube(), xsh_compute_linearity(), xsh_create_master_bias2(), xsh_create_master_dark2(), xsh_cube_3d_save_float(), xsh_cube_3d_save_int(), xsh_cube_qc_trace_window(), xsh_frame_force_pro_catg(), xsh_frameset_average(), xsh_frameset_average_pre(), xsh_gain(), xsh_linear(), xsh_mdark(), xsh_preoverscan_corr(), xsh_remove_cosmics(), and xsh_util_ifu_build_cube().
void xsh_free_mask | ( | cpl_mask ** | m | ) |
Deallocate an image mask and set the pointer to NULL.
m | Mask to deallocate |
Definition at line 2082 of file xsh_utils.c.
Referenced by reject_lo_hi(), xsh_get_master_dark_nir_via_noise(), xsh_image_flag_bp(), xsh_image_get_hot_cold_pixs(), xsh_image_get_stdev_clean(), xsh_image_get_stdev_robust(), and xsh_remove_cosmics().
void xsh_free_matrix | ( | cpl_matrix ** | m | ) |
Deallocate a matrix and set the pointer to NULL.
m | Matrix to deallocate |
Definition at line 2142 of file xsh_utils.c.
Referenced by xsh_atrous(), xsh_cfg_recover_pattern_match(), xsh_image_mflat_detect_blemishes(), xsh_localize_ifu_slitlet(), xsh_model_maps_create(), xsh_polynomial_fit_1d(), xsh_polynomial_fit_2d(), and xsh_remove_crh_single().
void xsh_free_parameter | ( | cpl_parameter ** | p | ) |
Deallocate a parameter and set the pointer to NULL.
p | Parameter to deallocate |
Definition at line 2172 of file xsh_utils.c.
void xsh_free_parameterlist | ( | cpl_parameterlist ** | p | ) |
Deallocate a parameter list and set the pointer to NULL.
p | Parameter list to deallocate |
Definition at line 2157 of file xsh_utils.c.
Referenced by destroy(), main(), xsh_2dmap_destroy(), xsh_absorp_destroy(), xsh_cfg_recover_destroy(), xsh_cfg_recover_exec(), xsh_flexcomp_destroy(), xsh_geom_ifu_destroy(), xsh_lingain_destroy(), xsh_mbias_destroy(), xsh_mdark_destroy(), xsh_mflat_destroy(), xsh_orderpos_destroy(), xsh_predict_destroy(), xsh_respon_slit_nod_destroy(), xsh_respon_slit_offset_destroy(), xsh_respon_slit_stare_destroy(), xsh_scired_ifu_offset_destroy(), xsh_scired_ifu_stare_destroy(), xsh_scired_slit_nod_destroy(), xsh_scired_slit_offset_destroy(), xsh_scired_slit_stare_destroy(), xsh_util_ifu_build_cube_destroy(), and xsh_wavecal_destroy().
void xsh_free_polynomial | ( | cpl_polynomial ** | p | ) |
Deallocate a polynomial and set the pointer to NULL.
p | Polynomial to deallocate |
Definition at line 2127 of file xsh_utils.c.
Referenced by fill_rectified(), find_tilt(), main(), xsh_array_clip_poly1d(), xsh_combine_flats(), xsh_compute_flat_edges(), xsh_create_blaze(), xsh_cube_trace_fit(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_dispersol_list_free(), xsh_image_create_model_image(), xsh_image_gaussian_fit_y(), xsh_localization_free(), xsh_localize_obj_auto(), xsh_model_maps_create(), xsh_optextract_produce_model(), xsh_order_list_free(), xsh_polynomial_add_2d(), xsh_polynomial_collapse(), xsh_polynomial_convert_from_table(), xsh_polynomial_fit_1d(), xsh_polynomial_fit_2d(), xsh_polynomial_new_zero(), xsh_std_star_spectra_correlate(), xsh_vector_fit_slope(), xsh_vector_integrate(), xsh_wavemap_list_free(), and xsh_wavesol_free().
void xsh_free_product_files | ( | void | ) |
Free temprary files list.
Definition at line 1432 of file xsh_utils.c.
References NbProducts, and ProdFiles.
Referenced by xsh_end().
void xsh_free_propertylist | ( | cpl_propertylist ** | p | ) |
Deallocate a property list and set the pointer to NULL.
p | Property list to deallocate |
Definition at line 2112 of file xsh_utils.c.
Referenced by create_frame(), create_instrument(), createFakeFrames(), main(), save_pre_frame(), shift_with_kw(), verify_order_table(), xsh_2dmap(), xsh_abs_remove_crh_single(), xsh_absorp(), xsh_add_afc_info(), xsh_add_product(), xsh_add_product_bpmap(), xsh_add_product_image(), xsh_add_product_imagelist(), xsh_add_product_pre(), xsh_add_product_table(), xsh_add_product_vector(), xsh_add_qc_tab(), xsh_arclist_free(), xsh_badpixelmap_coadd(), xsh_badpixelmap_crea_master_from_bpmap(), xsh_badpixelmap_extract(), xsh_badpixelmap_fill_bp_pattern_holes(), xsh_build_ifu_cube(), xsh_build_ifu_map(), xsh_cfg_recover_gen_xyg_frame(), xsh_cfg_recover_measure_tab_xy_peaks(), xsh_check_input_is_unbinned(), xsh_check_load_master_bpmap(), xsh_combine_flats(), xsh_compute_flat_edges(), xsh_compute_linearity(), xsh_compute_noise_map(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), xsh_compute_ron(), xsh_compute_shift_ifu_slitlet(), xsh_compute_wavelength_resampling_accuracy(), xsh_convert_seeing(), xsh_correct_calib(), xsh_correct_frameset_calib_bin(), xsh_correct_frameset_raws_bin(), xsh_crea_correct_coeff(), xsh_create_master_dark2(), xsh_cube_qc_trace_window(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_dfs_check_binning(), xsh_dfs_check_mflat_is_proper(), xsh_dispersol_list_free(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_efficiency_compute(), xsh_ensure_raws_number_is_even(), xsh_extract_clean_with_tag(), xsh_extract_local_clean(), xsh_extract_nod_pairs(), xsh_extract_obj_and_sky_pairs(), xsh_extract_with_tag(), xsh_flexcor(), xsh_frame_build_sky_area(), xsh_frame_build_sky_map(), xsh_frame_check_is_right_afcatt(), xsh_frame_check_model_cfg_is_afc_corrected(), xsh_frame_check_model_cfg_is_proper_for_sci(), xsh_frame_force_pro_catg(), xsh_frame_image_add_double(), xsh_frame_image_div_by_fct(), xsh_frame_image_ext_qc_trace_window(), xsh_frame_image_mult_by_fct(), xsh_frame_image_qc_trace_window(), xsh_frame_image_save2ext(), xsh_frame_nir_tab_chop_Kband(), xsh_frame_pre_subsample(), xsh_frame_sci_get_gain_airmass_exptime_naxis1_biny(), xsh_frame_sci_get_ra_dec_airmass(), xsh_frame_set_shift_ref(), xsh_frame_set_shiftifu_ref(), xsh_frame_table_monitor_flux_qc(), xsh_frame_table_resid_merge(), xsh_frame_table_save(), xsh_frameset_average(), xsh_frameset_average_pre(), xsh_frameset_check_uniform_exptime(), xsh_frameset_drl_frames(), xsh_frameset_dump_nod_info(), xsh_frameset_ext_image_frames(), xsh_frameset_ext_table_frames(), xsh_frameset_extract_offsety_matches(), xsh_frameset_extract_offsety_mismatches(), xsh_frameset_uniform_bin(), xsh_gain(), xsh_geom_ifu(), xsh_get_binning(), xsh_get_exptimes(), xsh_get_master_dark_nir_via_noise(), xsh_get_shift_ref(), xsh_get_slit_edges(), xsh_ifu_trace_object_calibrate(), xsh_image_clean_badpixel(), xsh_image_get_hot_cold_pixs(), xsh_instrument_nir_is_JH(), xsh_linear_group_by_exptime(), xsh_linetilt_list_free(), xsh_lingain(), xsh_localization_free(), xsh_localization_load(), xsh_localize_ifu(), xsh_localize_ifu_slitlet(), xsh_mbias(), xsh_mdark(), xsh_merge_ord_slitlet(), xsh_merge_ord_with_tag(), xsh_mflat(), xsh_model_first_anneal_save(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_spectralformat_create(), xsh_model_temperature_update_frame(), xsh_model_temperature_update_structure(), xsh_model_THE_create(), xsh_monitor_flux(), xsh_nod_group_by_reloff(), xsh_nod_group_by_reloff2(), xsh_normalize_spectrum(), xsh_normalize_spectrum_image_slice(), xsh_normalize_spectrum_ord(), xsh_obs_std_correct(), xsh_opt_extract_orders(), xsh_order_frameset_by_date(), xsh_order_list_free(), xsh_order_list_load(), xsh_order_split_qth_d2(), xsh_params_bin_scale(), xsh_pre_3d_free(), xsh_pre_create(), xsh_pre_free(), xsh_predict(), xsh_preoverscan_corr(), xsh_rec_get_nod_kw(), xsh_rec_list_duplicate(), xsh_rec_list_free(), xsh_rec_list_load(), xsh_rec_list_load_eso(), xsh_rec_list_save2(), xsh_rectify_and_shift(), xsh_resid_order_free(), xsh_resid_tab_erase_flagged(), xsh_resid_tab_free(), xsh_respon_slit_nod(), xsh_response_merge_obj_std_info(), xsh_scired_slit_stare(), xsh_set_recipe_file_prefix(), xsh_shift_offsettab(), xsh_shift_tab_free(), xsh_slice_offset_free(), xsh_slice_offset_load(), xsh_sort_table_1(), xsh_sort_table_2(), xsh_spectralformat_list_free(), xsh_spectralformat_list_load(), xsh_spectrum1D_free(), xsh_spectrum_free(), xsh_spectrum_interpolate(), xsh_spectrum_interpolate_linear(), xsh_spectrum_resample(), xsh_star_flux_list_free(), xsh_stare_params_bin_scale(), xsh_subtract_background(), xsh_table_merge_clean_and_resid_tabs(), xsh_telluric_model_eval(), xsh_test_create_bias_image(), xsh_test_create_frame(), xsh_the_map_free(), xsh_the_map_load(), xsh_update_pheader_in_image_multi(), xsh_util_afc(), xsh_util_bpmap2rp(), xsh_util_bpmap_coadd(), xsh_util_compute_response(), xsh_util_efficiency(), xsh_util_efficiency2d(), xsh_util_frameset_collapse_mean(), xsh_util_ifu_build_cube(), xsh_util_ima_arith(), xsh_util_ima_getextno(), xsh_util_ima_oversample(), xsh_util_ima_rebin(), xsh_util_ima_shift(), xsh_util_ima_subsample(), xsh_util_integrate(), xsh_util_multiply_by_response(), xsh_util_multiply_by_response_ord(), xsh_util_physmod_model_THE_create(), xsh_utils_compute_airm_eff(), xsh_utils_efficiency(), xsh_wavecal_qclog_intmon(), xsh_wavemap_list_free(), xsh_wavemap_list_save(), xsh_wavemap_list_save2(), xsh_wavemap_qc(), xsh_wavesol_free(), and xsh_wavetab_qc().
void xsh_free_stats | ( | cpl_stats ** | s | ) |
Deallocate a stats object and set the pointer to NULL.
s | Stats object to deallocate |
Definition at line 2247 of file xsh_utils.c.
Referenced by xsh_pre_dump().
void xsh_free_table | ( | cpl_table ** | t | ) |
Deallocate a table and set the pointer to NULL.
t | table to deallocate |
Definition at line 2066 of file xsh_utils.c.
Referenced by fit_spline(), main(), xsh_2dmap(), xsh_add_product(), xsh_add_product_table(), xsh_add_qc_tab(), xsh_align_model_to_spectrum(), xsh_bspline_fit(), xsh_bspline_fit_data(), xsh_bspline_fit_data2(), xsh_build_ifu_cube(), xsh_calib_nir_respon_corr_if_JH(), xsh_cfg_recover_extend_xy_pos_frm(), xsh_cfg_recover_gen_xyg_frame(), xsh_cfg_recover_guess_tab_corr_by_ordpos(), xsh_cfg_recover_guess_tab_corr_by_user(), xsh_cfg_recover_last_step(), xsh_cfg_recover_linear_ext(), xsh_cfg_recover_measure_line_xy(), xsh_cfg_recover_measure_line_xy_fit(), xsh_cfg_recover_measure_tab_xy_peaks(), xsh_cfg_recover_pattern_match(), xsh_cfg_recover_prepare_pm_set(), xsh_cfg_recover_remove_blends(), xsh_cfg_recover_select_peaks(), xsh_combine_flats(), xsh_compute_flat_edges(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), xsh_compute_wavelength_resampling_accuracy(), xsh_crea_correct_coeff(), xsh_create_order_table(), xsh_cube_qc_trace_window(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_detect_order_edge(), xsh_dispersol_list_load(), xsh_dispersol_list_save(), xsh_efficiency_compute(), xsh_evaluate_tell_model(), xsh_extract_local_clean(), xsh_extract_points_to_fit(), xsh_extract_ranges_to_fit(), xsh_fill_high_abs_regions(), xsh_fill_tell_compute_resid_regions(), xsh_fill_tell_fit_regions(), xsh_flexcor(), xsh_frame_force_pro_catg(), xsh_frame_image_ext_qc_trace_window(), xsh_frame_image_qc_trace_window(), xsh_frame_nir_tab_chop_Kband(), xsh_frame_table_monitor_flux_qc(), xsh_frame_table_resid_merge(), xsh_frame_table_save(), xsh_gain(), xsh_get_central_xy(), xsh_get_xcorrel_peak(), xsh_ifu_wavetab_create(), xsh_linetilt_list_save(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_mflat(), xsh_model_compute_residuals(), xsh_model_first_anneal(), xsh_model_maps_create(), xsh_model_pipe_anneal(), xsh_model_readfits(), xsh_model_spectralformat_create(), xsh_model_temperature_update_frame(), xsh_model_THE_create(), xsh_monitor_flux(), xsh_normalize_spectrum(), xsh_normalize_spectrum_ord(), xsh_obs_std_correct(), xsh_order_list_save(), xsh_order_split_qth_d2(), xsh_pre_median_mean_stdev_window(), xsh_predict(), xsh_resid_tab_erase_flagged(), xsh_response_calculate(), xsh_response_merge_obj_std_info(), xsh_spectrum_correct(), xsh_spectrum_interpolate(), xsh_spectrum_interpolate_linear(), xsh_spectrum_resample(), xsh_subtract_background(), xsh_table_merge_clean_and_resid_tabs(), xsh_table_monitor_flux_qc(), xsh_telluric_model_eval(), xsh_util_afc(), xsh_util_compute_qc_residuals(), xsh_util_efficiency(), xsh_util_efficiency2d(), xsh_util_ifu_build_cube(), xsh_util_multiply_by_response(), xsh_util_multiply_by_response_ord(), xsh_util_physmod_model_THE_create(), xsh_utils_efficiency(), xsh_utils_efficiency_internal(), xsh_verify_2dmap_poly_input(), xsh_wavecal_qclog_element(), xsh_wavecal_qclog_intmon(), xsh_wavemap_qc(), and xsh_wavetab_qc().
void xsh_free_temporary_files | ( | void | ) |
Free temprary files list.
Definition at line 1393 of file xsh_utils.c.
References NbTemp, and TempFiles.
Referenced by xsh_end().
void xsh_free_vector | ( | cpl_vector ** | v | ) |
Deallocate a vector and set the pointer to NULL.
v | Vector to deallocate |
Definition at line 2217 of file xsh_utils.c.
Referenced by clean_arclist_data(), compute_specres(), create_gaussian_profile(), data_wavesol_fit_with_sigma(), detect_centroid(), fill_rectified(), find_tilt(), lambda_fit(), main(), test_tech_eval_perf(), theo_tab_model(), xsh_add_product_vector(), xsh_afcthetab_create(), xsh_align_model_to_spectrum(), xsh_atrous(), xsh_build_ifu_cube(), xsh_center_cube(), xsh_cfg_recover_measure_line_xy(), xsh_cfg_recover_measure_tab_xy_peaks(), xsh_compute_absorp(), xsh_compute_shift_ifu_slitlet(), xsh_correl_spectra(), xsh_detect_continuum(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_efficiency_compute(), xsh_extract_clean_slice(), xsh_fit_gaussian(), xsh_flexcor(), xsh_image_extract_optimal(), xsh_image_extract_standard(), xsh_image_fit_gaussian_max_pos_x_window(), xsh_image_fit_gaussian_max_pos_y_window(), xsh_image_gaussian_fit_y(), xsh_interpolate_high_abs_regions2(), xsh_interpolate_spectrum(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_mark_tell(), xsh_model_maps_create(), xsh_normalize_spectrum_image_slice(), xsh_opt_extract_orders(), xsh_phys_spectrum_save(), xsh_polynomial_fit_1d(), xsh_pre_median_mean_stdev(), xsh_pre_median_mean_stdev_window(), xsh_preoverscan_corr(), xsh_remove_crh_single(), xsh_spectralformat_list_get_orders(), xsh_spectrum_load(), xsh_spectrum_load_order(), xsh_spectrum_save(), xsh_spectrum_save_order(), xsh_star_flux_list_filter_lowpass(), xsh_star_flux_list_filter_median(), xsh_std_star_spectra_correlate(), xsh_telluric_model_eval(), xsh_tools_get_statistics(), xsh_tools_tchebitchev_poly_eval(), xsh_util_efficiency(), xsh_util_efficiency2d(), xsh_util_ifu_build_cube(), xsh_util_multiply_by_response(), xsh_util_multiply_by_response_ord(), xsh_vector_fit_slope(), xsh_vector_integrate(), xsh_wavemap_list_eval_lambda(), xsh_wavemap_list_new(), xsh_wavesol_eval_polx(), xsh_wavesol_eval_poly(), xsh_wavesol_free(), and xsh_wavetab_qc().
double* xsh_function1d_xcorrelate | ( | double * | line_i, | |
int | width_i, | |||
double * | line_t, | |||
int | width_t, | |||
int | half_search, | |||
int | normalise, | |||
double * | xcorr_max, | |||
double * | delta | |||
) |
Definition at line 6934 of file xsh_utils.c.
References step.
Referenced by main(), and xsh_correl_spectra().
char* xsh_get_basename | ( | const char * | filename | ) |
Return base filename.
filename | input filename |
Definition at line 1117 of file xsh_utils.c.
Referenced by xsh_frame_image_div_by_fct(), xsh_frame_image_mult_by_fct(), xsh_frame_nir_tab_chop_Kband(), xsh_frame_pre_subsample(), xsh_preoverscan_corr(), and xsh_util_ima_rebin().
const char* xsh_get_license | ( | void | ) |
Get the pipeline copyright and license.
The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.
Definition at line 1135 of file xsh_utils.c.
Referenced by cpl_plugin_get_info().
cpl_error_code xsh_get_property_value | ( | const cpl_propertylist * | plist, | |
const char * | keyword, | |||
cpl_type | keywordtype, | |||
void * | result | |||
) |
Read a property value from a property list.
plist | Propertylist to read | |
keyword | Name of property to read | |
keywordtype | Type of keyword | |
result | The value read |
This function wraps cpl_propertylist_get_int()
, cpl_propertylist_get_bool()
, cpl_propertylist_get_double()
and cpl_propertylist_get_string()
. It checks existence and type of the requested keyword before reading and describes what went wrong if the property could not be read.
Definition at line 1541 of file xsh_utils.c.
References assure, check_msg, and xsh_tostring_cpl_type().
Referenced by verify_order_table(), xsh_key_bin_div_by_fct(), xsh_key_bin_mult_by_fct(), xsh_key_scan_div_by_fct(), xsh_key_scan_mult_by_fct(), xsh_pfits_get_airm_end(), xsh_pfits_get_airm_start(), xsh_pfits_get_arcfile(), xsh_pfits_get_b_dec_cumoffset(), xsh_pfits_get_b_dec_reloffset(), xsh_pfits_get_b_ra_cumoffset(), xsh_pfits_get_b_ra_reloffset(), xsh_pfits_get_bias_down_median(), xsh_pfits_get_bias_down_stdev(), xsh_pfits_get_bias_left_median(), xsh_pfits_get_bias_left_stdev(), xsh_pfits_get_bias_right_median(), xsh_pfits_get_bias_right_stdev(), xsh_pfits_get_bias_up_median(), xsh_pfits_get_bias_up_stdev(), xsh_pfits_get_bunit(), xsh_pfits_get_cd11(), xsh_pfits_get_cd12(), xsh_pfits_get_cd13(), xsh_pfits_get_cd21(), xsh_pfits_get_cd22(), xsh_pfits_get_cd23(), xsh_pfits_get_cd31(), xsh_pfits_get_cd32(), xsh_pfits_get_cd33(), xsh_pfits_get_cdelt1(), xsh_pfits_get_cdelt2(), xsh_pfits_get_cdelt3(), xsh_pfits_get_crpix1(), xsh_pfits_get_crpix2(), xsh_pfits_get_crpix3(), xsh_pfits_get_crval1(), xsh_pfits_get_crval2(), xsh_pfits_get_crval3(), xsh_pfits_get_cumoffsetx(), xsh_pfits_get_cumoffsety(), xsh_pfits_get_cunit1(), xsh_pfits_get_cunit2(), xsh_pfits_get_cunit3(), xsh_pfits_get_date(), xsh_pfits_get_date_obs(), xsh_pfits_get_dec(), xsh_pfits_get_dec_cumoffset(), xsh_pfits_get_dec_reloffset(), xsh_pfits_get_det_gain(), xsh_pfits_get_det_pxspace(), xsh_pfits_get_det_win1_uit1(), xsh_pfits_get_dit(), xsh_pfits_get_dpr_catg(), xsh_pfits_get_dpr_tech(), xsh_pfits_get_dpr_type(), xsh_pfits_get_exptime(), xsh_pfits_get_extname(), xsh_pfits_get_extract_slit_max(), xsh_pfits_get_extract_slit_min(), xsh_pfits_get_FOCU1ENC(), xsh_pfits_get_lamp_on_off(), xsh_pfits_get_mjdobs(), xsh_pfits_get_ndit(), xsh_pfits_get_nod_cumoffset(), xsh_pfits_get_nod_jitterwidth(), xsh_pfits_get_nod_reloffset(), xsh_pfits_get_nodthrow(), xsh_pfits_get_obs_id(), xsh_pfits_get_obs_targ_name(), xsh_pfits_get_pcatg(), xsh_pfits_get_posang(), xsh_pfits_get_pszx(), xsh_pfits_get_pszy(), xsh_pfits_get_qc_mbiasavg(), xsh_pfits_get_qc_mbiasmed(), xsh_pfits_get_qc_mbiasrms(), xsh_pfits_get_qc_mbiasslope(), xsh_pfits_get_qc_ncrh(), xsh_pfits_get_qc_nhpix(), xsh_pfits_get_qc_ron(), xsh_pfits_get_qc_structx(), xsh_pfits_get_qc_structy(), xsh_pfits_get_ra(), xsh_pfits_get_ra_cumoffset(), xsh_pfits_get_ra_reloffset(), xsh_pfits_get_raw1catg(), xsh_pfits_get_raw1name(), xsh_pfits_get_rectify_bin_lambda(), xsh_pfits_get_rectify_bin_space(), xsh_pfits_get_rectify_lambda_max(), xsh_pfits_get_rectify_lambda_min(), xsh_pfits_get_rectify_space_max(), xsh_pfits_get_rectify_space_min(), xsh_pfits_get_shiftifu_lambdaref(), xsh_pfits_get_shiftifu_slitref(), xsh_pfits_get_slitmap_median_cen(), xsh_pfits_get_slitmap_median_edglo(), xsh_pfits_get_slitmap_median_edgup(), xsh_pfits_get_slitmap_median_sliclo(), xsh_pfits_get_slitmap_median_slicup(), xsh_pfits_get_tel_targ_alpha(), xsh_pfits_get_tel_targ_delta(), xsh_pfits_get_telescop(), xsh_pfits_get_temp2(), xsh_pfits_get_temp5(), xsh_pfits_get_temp82(), xsh_pfits_get_wavesol_lambda_max(), xsh_pfits_get_wavesol_lambda_min(), xsh_pfits_get_wavesol_order_max(), xsh_pfits_get_wavesol_order_min(), xsh_pfits_get_wavesol_slit_max(), xsh_pfits_get_wavesol_slit_min(), xsh_pfits_get_wavesol_x_max(), xsh_pfits_get_wavesol_x_min(), xsh_pfits_get_wavesol_y_max(), xsh_pfits_get_wavesol_y_min(), xsh_pfits_get_wavesoltype(), and xsh_pfits_get_win1_dit1().
cpl_error_code xsh_get_table_value | ( | const cpl_table * | table, | |
const char * | colname, | |||
cpl_type | coltype, | |||
int | i, | |||
void * | result | |||
) |
Read a table value from a fits table.
table | table to read | |
colname | Name of column to read | |
coltype | Type of column | |
i | row to read | |
result | The value read |
Definition at line 366 of file xsh_utils_table.c.
References assure, check_msg, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_arclist_load(), xsh_atmos_ext_list_load(), xsh_dispersol_list_load(), xsh_localization_load(), xsh_order_list_load(), xsh_order_split_qth_d2(), xsh_rec_list_load(), xsh_resid_order_load(), xsh_resid_tab_load(), xsh_shift_tab_load(), xsh_slice_offset_load(), xsh_spectralformat_list_load(), xsh_star_flux_list_load(), xsh_the_map_load(), and xsh_wavesol_load().
void xsh_gsl_fit_gaussian | ( | cpl_vector * | xpos_vect, | |
cpl_vector * | ypos_vect, | |||
int | deg, | |||
double * | params, | |||
double * | errs, | |||
int * | status | |||
) |
Definition at line 6782 of file xsh_utils.c.
References data::deg, expb_df(), expb_f(), expb_fdf(), data::n, n, s, sigma, data::x, x, XSH_ASSURE_NOT_NULL, xsh_msg_dbg_high, and data::y.
Referenced by main(), and xsh_localize_ifu_slitlet().
void xsh_gsl_init_gaussian_fit | ( | cpl_vector * | xpos_vect, | |
cpl_vector * | ypos_vect, | |||
double * | init_par | |||
) |
Definition at line 6709 of file xsh_utils.c.
References M_PI, XSH_ASSURE_NOT_NULL, and xsh_msg_dbg_high.
Referenced by main(), and xsh_localize_ifu_slitlet().
double xsh_hms2deg | ( | const double | hms | ) |
Convert a double from hours minute seconds to deg:.
hms | angle in hours minute second units |
Definition at line 254 of file xsh_utils.c.
Referenced by xsh_build_ifu_map(), and xsh_cube_set_wcs().
void xsh_image_fit_spline | ( | cpl_image * | img, | |
xsh_grid * | grid | |||
) |
perform spline fit
img | input image | |
grid | input grid specifying evaluation points |
Definition at line 2913 of file xsh_utils.c.
References check, nx, ny, xsh_grid_point::v, xsh_grid_point::x, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_FREE, xsh_grid_get_index(), xsh_grid_point_get(), XSH_MALLOC, xsh_msg, and xsh_grid_point::y.
cpl_vector* xsh_image_to_vector | ( | cpl_image * | spectrum | ) |
Definition at line 4565 of file xsh_utils.c.
References XSH_ASSURE_NOT_NULL_MSG, and xsh_msg_error.
Referenced by xsh_normalize_spectrum_image_slice(), xsh_util_multiply_by_response(), and xsh_util_multiply_by_response_ord().
cpl_image* xsh_imagelist_collapse_sigclip_iter_create | ( | const cpl_imagelist * | imlist, | |
double | sigma_low, | |||
double | sigma_upp, | |||
const int | niter | |||
) |
Average with sigma-clipping rejection an imagelist to a single image.
imlist | the input images list | |
sigma_low | the sigma value to clip low signal pixels | |
sigma_upp | the sigma value to clip high signal pixels | |
niter | the number of clipping iterations |
The returned image has to be deallocated with cpl_image_delete().
The bad pixel maps of the input frames are not taken into account, and the one of the created image is empty.
For each pixel position the pixels whose value is higher than mean+sigma_upp*stdev or lower than mean-sigma_low*stdev are discarded for the average computation. If all pixels are discarde, the reslting pixel is 0. Where mean is the average of the pixels at that position, and stdev is the standard deviation of the pixels at that position.
The input image list can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
Definition at line 135 of file xsh_utils.c.
References check, CPL_IMAGE_GET_DATA, CPL_IMAGE_GET_DATA_CONST, CPL_TYPE, CPL_TYPE_T, n, nx, and ny.
void xsh_init | ( | void | ) |
Reset library state.
This function must be called from the recipe initializer function to make sure that the recipe is re-entrant (i.e. behaves identical on successive invocations)
Successive plugin invocations share their memory, so it is important that all static memory is reset to a well defined state.
Definition at line 1102 of file xsh_utils.c.
References xsh_error_reset, and xsh_msg_init().
Referenced by create(), xsh_2dmap_create(), xsh_absorp_create(), xsh_cfg_recover_create(), xsh_flexcomp_create(), xsh_geom_ifu_create(), xsh_lingain_create(), xsh_mbias_create(), xsh_mdark_create(), xsh_mflat_create(), xsh_model_anneal_create(), xsh_model_create(), xsh_model_first_anneal_create(), xsh_orderpos_create(), xsh_predict_create(), xsh_respon_slit_nod_create(), xsh_respon_slit_offset_create(), xsh_respon_slit_stare_create(), xsh_scired_ifu_offset_create(), xsh_scired_ifu_stare_create(), xsh_scired_slit_nod_create(), xsh_scired_slit_offset_create(), xsh_scired_slit_stare_create(), xsh_util_afc_create(), xsh_util_apply_response_create(), xsh_util_bpmap2rp_create(), xsh_util_bpmap_coadd_create(), xsh_util_bpmap_nl_raw2pre_create(), xsh_util_compute_response_create(), xsh_util_crh_single_create(), xsh_util_efficiency1d_create(), xsh_util_efficiency2d_create(), xsh_util_efficiency_create(), xsh_util_guess_xy_create(), xsh_util_ifu_build_cube_create(), xsh_util_ima_arith_create(), xsh_util_ima_getextno_create(), xsh_util_ima_oversample_create(), xsh_util_ima_rebin_create(), xsh_util_ima_shift_create(), xsh_util_ima_subsample_create(), xsh_util_integrate_create(), xsh_util_physmod_create(), xsh_util_ronbias_create(), and xsh_wavecal_create().
static double xsh_iterpol_linear | ( | double * | data_x, | |
double * | data_y, | |||
int | ndata, | |||
double | x, | |||
int * | i_inf, | |||
int * | i_sup | |||
) | [static] |
Definition at line 6044 of file xsh_utils.c.
References y.
Referenced by xsh_spectrum_interpolate_linear().
double xsh_max_double | ( | double | x, | |
double | y | |||
) |
Maximum of two numbers.
x | First number | |
y | Second number |
See also xsh_round_double()
.
Definition at line 4334 of file xsh_utils.c.
int xsh_max_int | ( | int | x, | |
int | y | |||
) |
Maximum of two numbers.
x | First number | |
y | Second number |
See also xsh_round_double()
.
Definition at line 4300 of file xsh_utils.c.
Referenced by xsh_polynomial_add_2d().
void xsh_mem_dump | ( | const char * | prompt | ) |
Debugging utility. A call to this function dumps the memory usage to stderr.
prompt | A string output to stderr before memory dump |
Definition at line 3141 of file xsh_utils.c.
double xsh_min_double | ( | double | x, | |
double | y | |||
) |
Minimum of two numbers.
x | First number | |
y | Second number |
See also xsh_round_double()
.
Definition at line 4317 of file xsh_utils.c.
int xsh_min_int | ( | int | x, | |
int | y | |||
) |
Minimum of two numbers.
x | First number | |
y | Second number |
See also xsh_round_double()
.
Definition at line 4284 of file xsh_utils.c.
cpl_error_code xsh_monitor_flux | ( | cpl_frame * | frm_ima, | |
const cpl_frame * | frm_tab, | |||
xsh_instrument * | instrument | |||
) |
Monitor Flux level along the orders traces given by an input table.
frm_ima | The input frame image whose flux is to be monitored | |
frm_tab | input frame table with order traces | |
instrument | instrument (arm setting) |
Definition at line 4002 of file xsh_utils.c.
References binx, biny, check, XSH_ARM_NIR, xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_get_arm(), xsh_pfits_get_binx(), xsh_pfits_get_biny(), XSH_QC_FLUX, XSH_QC_FLUX_MAX_C, XSH_QC_FLUX_MIN_C, and xsh_update_pheader_in_image_multi().
Referenced by xsh_combine_flats_and_detect_edges(), and xsh_orderpos().
cpl_frame* xsh_normalize_spectrum | ( | const cpl_frame * | obj_frame, | |
const cpl_frame * | atm_ext_frame, | |||
cpl_boolean | correct_binning, | |||
xsh_instrument * | instrument, | |||
const char * | tag_o | |||
) |
Normalize a spectrum.
obj_frame | The 1d (merged) or 2d (non-merged or 2d extracted+merged) spectrum to be normalized | |
atm_ext_frame | The frame of atmospheric extinction spectrum | |
correct_binning | Flag to divide or not by the x-binning factor | |
instrument | Instrument setting (XSH ARM..) | |
tag_o | pro catg of output frame |
The spectrum is divided by exposure time, gain and (optionally) binning. Also corrected for atmospheric extinction using the provided table of extinction coefficients.
Bad pixels are propagated.xsh_utils.h
Definition at line 5684 of file xsh_utils.c.
References binx, check, exptime, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL_MSG, XSH_ATMOS_EXT_LIST_COLNAME_K, xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_get_arm(), xsh_msg_dbg_medium, xsh_normalize_spectrum_image_slice(), xsh_pfits_get_airm_mean(), xsh_pfits_get_biny(), xsh_pfits_get_exptime(), and xsh_pfits_get_gain().
Referenced by xsh_scired_util_spectra_flux_calibrate().
cpl_image* xsh_normalize_spectrum_image | ( | const cpl_image * | spectrum, | |
const cpl_image * | spectrum_error, | |||
const cpl_propertylist * | spectrum_header, | |||
const int | binx, | |||
const double | gain, | |||
const double | exptime, | |||
const double | airmass, | |||
const int | n_traces, | |||
const cpl_table * | atm_extinction, | |||
cpl_image ** | scaled_error | |||
) |
Normalize a spectrum.
spectrum | The 1d (merged) or 2d (non-merged or 2d extracted+merged) spectrum to be normalized | |
spectrum_error | Error (1 sigma) of spectrum, or NULL. | |
spectrum_header | Header describing the geometry of the input spectrum | |
binx | x bin | |
gain | detector's gain | |
exptime | observed object's exposure time | |
airmass | observed object's airmass | |
n_traces | Number of spatial bins (1 unless 2d extracted) | |
atm_extinction | The table of extinction coefficients | |
scaled_error | (output) If non-NULL, error of output spectrum |
The spectrum is divided by exposure time, gain and (optionally) binning. Also corrected for atmospheric extinction using the provided table of extinction coefficients.
Bad pixels are propagated.xsh_utils.h
Definition at line 5870 of file xsh_utils.c.
References assure, check_msg, nx, ny, order, x, XSH_ASSURE_NOT_NULL_MSG, xsh_free_image(), xsh_msg_dbg_medium, xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), and xsh_spline_hermite_table().
Referenced by xsh_normalize_spectrum_image_slice().
cpl_error_code xsh_normalize_spectrum_image_slice | ( | const char * | name_s, | |
const char * | tag_o, | |||
const int | ext, | |||
const int | binx, | |||
const double | gain, | |||
const double | exptime, | |||
const double | airmass, | |||
const cpl_table * | tbl_atm_ext | |||
) |
Normalize spectrum slice.
name_s | spectrum filename | |
tag_o | output frame pro catg | |
ext | extension value | |
binx | X bin size | |
gain | detector's gain | |
exptime | exposure time | |
airmass | airmass | |
tbl_atm_ext | atmospheric extinction table |
The spectrum is divided by exposure time, gain and (optionally) binning. Also corrected for atmospheric extinction using the provided table of extinction coefficients.
Bad pixels are propagated.xsh_utils.h
Definition at line 5527 of file xsh_utils.c.
References check, xsh_free_image(), xsh_free_propertylist(), xsh_free_vector(), xsh_image_to_vector(), xsh_normalize_spectrum_image(), xsh_pfits_get_naxis(), xsh_pfits_set_pcatg(), XSH_PRE_DATA_BPP, XSH_PRE_DATA_TYPE, XSH_PRE_ERRS_BPP, XSH_PRE_ERRS_TYPE, XSH_PRE_QUAL_BPP, XSH_PRE_QUAL_TYPE, XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, and xsh_vector_to_image().
Referenced by xsh_normalize_spectrum(), and xsh_normalize_spectrum_ord().
cpl_frame* xsh_normalize_spectrum_ord | ( | const cpl_frame * | obj_frame, | |
const cpl_frame * | atm_ext_frame, | |||
cpl_boolean | correct_binning, | |||
xsh_instrument * | instrument, | |||
const char * | tag_o | |||
) |
Normalize a spectrum.
obj_frame | The 1d (merged) or 2d (non-merged or 2d extracted+merged) spectrum to be normalized | |
atm_ext_frame | The frame with atmospheric extinction spectrum | |
correct_binning | Flag indicating whether or not to divide by the x-binning factor | |
instrument | instrument arm | |
tag_o | output product tag |
The spectrum is divided by exposure time, gain and (optionally) binning. Also corrected for atmospheric extinction using the provided table of extinction coefficients.
Bad pixels are propagated.xsh_utils.h
Definition at line 5770 of file xsh_utils.c.
References binx, check, exptime, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL_MSG, XSH_ATMOS_EXT_LIST_COLNAME_K, XSH_ATMOS_EXT_LIST_COLNAME_OLD, xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_get_arm(), xsh_msg_dbg_medium, xsh_msg_warning, xsh_normalize_spectrum_image_slice(), xsh_pfits_get_airm_mean(), xsh_pfits_get_biny(), xsh_pfits_get_exptime(), and xsh_pfits_get_gain().
Referenced by xsh_flux_calibrate1D(), xsh_flux_calibrate2D(), and xsh_util_apply_response().
cpl_frameset* xsh_order_frameset_by_date | ( | cpl_frameset * | frameset | ) |
Order frameset by date.
frameset | input frameset |
Definition at line 3239 of file xsh_utils.c.
References check, compare_frame_date(), date_to_double(), FRAME_DATE_IDX::frame, FRAME_DATE_IDX::frame_date, FRAME_DATE_IDX::frame_idx, FRAME_DATE_IDX::frame_name, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_debug_level_get(), XSH_DEBUG_LEVEL_NONE, XSH_FREE, xsh_free_frameset(), xsh_free_propertylist(), xsh_msg, and xsh_pfits_get_date_obs().
Referenced by xsh_respon_slit_nod(), xsh_scired_slit_nod(), and xsh_subtract_sky_offset().
cpl_parameterlist* xsh_parameterlist_duplicate | ( | const cpl_parameterlist * | pin | ) |
Extract frames with given tag from frameset.
pin | input parameterlist |
Definition at line 713 of file xsh_utils.c.
Referenced by xsh_lingain().
void xsh_plist_dump | ( | cpl_propertylist * | plist | ) |
Dump propertylist.
plist | the input propertylist |
Definition at line 968 of file xsh_utils.c.
References xsh_property_dump().
polynomial* xsh_polynomial_regression_2d | ( | cpl_table * | t, | |
const char * | X1, | |||
const char * | X2, | |||
const char * | Y, | |||
const char * | sigmaY, | |||
int | degree1, | |||
int | degree2, | |||
const char * | polynomial_fit, | |||
const char * | residual_square, | |||
const char * | variance_fit, | |||
double * | mse, | |||
double * | red_chisq, | |||
polynomial ** | variance, | |||
double | kappa, | |||
double | min_reject | |||
) |
Fit a 2d polynomial to three table columns.
t | The table | |
X1 | Name of table column containing 1st independent variable | |
X2 | Name of table column containing 2nd independent variable | |
Y | Name of table column containing dependent variable | |
sigmaY | Uncertainty of dependent variable. If NULL, constant uncertainties are assumed. | |
degree1 | Degree of polynomial fit (1st variable) | |
degree2 | Degree of polynomial fit (2nd variable) | |
polynomial_fit | If non-NULL, name of column to add. The fitted value. | |
residual_square | If non-NULL, name of column to add. The squared residual of the fit. | |
variance_fit | If non-NULL, name of column to add. Variance of the fitted value. | |
[out] | mse | Mean squared error of the residuals. May be NULL. |
[out] | red_chisq | Reduced chi square of the fit. May be NULL. |
[out] | variance | Variance of the fit-polynomial (which is in itself a polynomial; see also xsh_polynomial_fit_2d() ). May be NULL. |
kappa | If positive, the value of kappa used in a kappa sigma-clipping. Ignored if negative. | |
min_reject | Minimum number of outliers worth rejecting. Stop iterating (for efficiency) if less than this relative number of outliers (e.g. 0.001) are detected. Negative to disable |
This function fits column Y (must be of type CPL_TYPE_DOUBLE) as function of X1 (CPL_TYPE_DOUBLE or CPL_TYPE_INT) and X2 (CPL_TYPE_DOUBLE or CPL_TYPE_INT). The column sigmaY contains the Y-uncertainties. If NULL, constant uncertainty equal to 1 is assumed.
If non-NULL the columns specified by the parameters polynomial_fit, residual_square and variance_fit are added to the table (containing the fitted value, the squared residual and the variance of the fitted value, for each point).
If non-NULL, the mean_squared_error and red_chisq (reduced chi square) are calculated.
If non-NULL the parameter variance will contain the polynomial that defines the variance of the fit (i.e. as function of x1 and x2 ).
To calculate variances or reduced chi square, the parameter sigmaY must be non-NULL.
If kappa is positive, a kappa-sigma clipping is performed (iteratively, until there are no points with residuals worse than kappa*sigma). The rejected points (rows) are physically removed from the table.
Also see xsh_polynomial_regression_1d()
.
Definition at line 3356 of file xsh_utils.c.
References assure, check_msg, N, xsh_erase_table_rows(), xsh_msg_debug, xsh_polynomial_delete(), xsh_polynomial_evaluate_2d(), xsh_polynomial_fit_2d(), xsh_tostring_cpl_type(), xsh_unwrap_bivector_vectors(), xsh_unwrap_vector(), and y.
Referenced by xsh_background_poly().
double xsh_pow_int | ( | double | x, | |
int | y | |||
) |
Computes x^y.
x | base | |
y | order |
Definition at line 4348 of file xsh_utils.c.
Referenced by xsh_polynomial_fit_1d().
static void xsh_property_dump | ( | cpl_property * | property | ) | [static] |
Dump property.
property | property to be dumped |
Definition at line 739 of file xsh_utils.c.
References size.
Referenced by xsh_plist_dump().
cpl_error_code xsh_rectify_params_set_defaults | ( | cpl_parameterlist * | pars, | |
const char * | rec_id, | |||
xsh_instrument * | inst, | |||
xsh_rectify_param * | rectify_par | |||
) |
Definition at line 6555 of file xsh_utils.c.
References check, xsh_rectify_param::rectif_bin_lambda, xsh_rectify_param::rectif_bin_space, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_instrument_get_arm(), xsh_parameters_find(), XSH_SLIT_BIN_SIZE_PIPE_NIR, XSH_SLIT_BIN_SIZE_PIPE_UVB, XSH_SLIT_BIN_SIZE_PIPE_VIS, XSH_WAVE_BIN_SIZE_PIPE_NIR, XSH_WAVE_BIN_SIZE_PIPE_UVB, and XSH_WAVE_BIN_SIZE_PIPE_VIS.
Referenced by xsh_params_set_defaults(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_nod_get_parameters(), xsh_scired_slit_offset(), and xsh_scired_slit_stare().
void xsh_reindex | ( | double * | data, | |
int * | idx, | |||
int | size | |||
) |
TO BE DESCRIBED.
data | ||
idx | ||
size |
Definition at line 1941 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_create_order_table().
void xsh_reindex_float | ( | float * | data, | |
int * | idx, | |||
int | size | |||
) |
TO BE DESCRIBED.
data | ||
idx | ||
size |
Definition at line 1971 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
void xsh_reindex_int | ( | int * | data, | |
int * | idx, | |||
int | size | |||
) |
TO BE DESCRIBED.
data | ||
idx | ||
size |
Definition at line 2003 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
long xsh_round_double | ( | double | x | ) |
Computes round(x).
x | input |
Definition at line 4268 of file xsh_utils.c.
Referenced by create_sky_mask(), deg2hms(), detect_centroid(), find_tilt(), get_lambda(), shift_with_kw(), xsh_compute_slit_index(), xsh_follow_arclines(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_merge_ord_with_tag(), xsh_rectify_and_shift(), xsh_rectify_orders(), xsh_select_table_rows(), and xsh_vector_integrate().
char* xsh_sdate_utc | ( | time_t * | now | ) |
From the time in seconds, create a string in the format: YYYYMMDD-HHMMSS The date is UTC. The function uses cpl_malloc to allocate memory for the string. The space allocated must be freed with cpl_free
now | Date in Unix/Linux format (seconds since 1970) |
Definition at line 1632 of file xsh_utils.c.
References XSH_CALLOC.
Referenced by xsh_add_product_pre(), xsh_add_product_pre_3d(), xsh_add_product_spectrum(), xsh_create_final_name(), and xsh_pre_save_product().
int xsh_select_table_rows | ( | cpl_table * | t, | |
const char * | column, | |||
cpl_table_select_operator | operator, | |||
double | value | |||
) |
Select table rows.
t | Table | |
column | Column name | |
operator | Logical operator | |
value | Value used for comparison |
A row is selected if and only if the value in column is in the relation operator to the specified value. The specified column must have type CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT. If integer, the integer nearest to value is used for the comparison.
Also see cpl_table_and_selected_<type>()
.
Definition at line 3717 of file xsh_utils.c.
References assure, check_msg, passure, xsh_round_double(), and xsh_tostring_cpl_type().
Referenced by xsh_background_poly(), and xsh_erase_table_rows().
double xsh_sess2deg | ( | const double | sess | ) |
Convert a double from ssessagesimal to deg: 203049.197= 20:30:49.197 = 20.5136658333.
sess | angle in seesagesimal units (see above) |
Definition at line 287 of file xsh_utils.c.
Referenced by xsh_build_ifu_map(), and xsh_cube_set_wcs().
cpl_error_code xsh_set_cd_matrix | ( | cpl_propertylist * | plist | ) |
Set CD matrix.
plist | input propertylist |
Definition at line 618 of file xsh_utils.c.
References xsh_msg_error, xsh_pfits_get_naxis(), xsh_set_cd_matrix1d(), xsh_set_cd_matrix2d(), and xsh_set_cd_matrix3d().
cpl_error_code xsh_set_cd_matrix1d | ( | cpl_propertylist * | plist | ) |
Set CD matrix.
plist | input propertylist |
Definition at line 643 of file xsh_utils.c.
References xsh_pfits_get_cdelt1(), and xsh_pfits_set_cd1().
Referenced by xsh_set_cd_matrix().
cpl_error_code xsh_set_cd_matrix2d | ( | cpl_propertylist * | plist | ) |
Set CD matrix.
plist | input propertylist |
Definition at line 660 of file xsh_utils.c.
References check, xsh_pfits_get_cdelt1(), xsh_pfits_get_cdelt2(), xsh_pfits_set_cd11(), xsh_pfits_set_cd12(), xsh_pfits_set_cd21(), and xsh_pfits_set_cd22().
Referenced by xsh_set_cd_matrix(), and xsh_spectrum_2D_create().
cpl_error_code xsh_set_cd_matrix3d | ( | cpl_propertylist * | plist | ) |
Set CD matrix.
plist | input propertylist |
Definition at line 686 of file xsh_utils.c.
References check, xsh_pfits_get_cdelt3(), xsh_pfits_set_cd13(), xsh_pfits_set_cd23(), xsh_pfits_set_cd31(), xsh_pfits_set_cd32(), and xsh_pfits_set_cd33().
Referenced by xsh_cube(), xsh_format(), and xsh_set_cd_matrix().
char* xsh_set_recipe_file_prefix | ( | cpl_frameset * | raw, | |
const char * | recipe | |||
) |
Set recipe frames prefix.
raw | input frameset | |
recipe | input recipe name |
Definition at line 543 of file xsh_utils.c.
References check, xsh_free_propertylist(), xsh_msg_warning, xsh_pfits_get_dpr_catg(), xsh_pfits_get_dpr_type(), and xsh_stringcat_any().
Referenced by xsh_absorp(), xsh_geom_ifu(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), and xsh_util_ifu_build_cube().
const char* xsh_set_recipe_sky_file_prefix | ( | char * | rec_prefix | ) |
Set recipe sky frames prefix.
rec_prefix | input recipe name |
Definition at line 518 of file xsh_utils.c.
Referenced by xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_slit_offset(), and xsh_scired_slit_stare().
void xsh_show_time | ( | const char * | comment | ) |
show time
comment | comment to print |
Definition at line 2322 of file xsh_utils.c.
References xsh_msg.
int* xsh_sort | ( | void * | base, | |
size_t | nmemb, | |||
size_t | size, | |||
int(*)(const void *, const void *) | compar | |||
) |
Sort an array and give is index table.
base | ||
nmemb | ||
size | ||
compar |
Definition at line 1899 of file xsh_utils.c.
References xsh_sort_data::data, xsh_sort_data::idx, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_FREE, and XSH_MALLOC.
Referenced by xsh_create_order_table().
cpl_error_code xsh_sort_table_1 | ( | cpl_table * | t, | |
const char * | column, | |||
cpl_boolean | reverse | |||
) |
Sort a table by one column.
t | Table | |
column | Column name | |
reverse | Flag indicating if column values are sorted descending (CPL_TRUE) or ascending (CPL_FALSE) |
This is a wrapper of cpl_table_sort()
.
Definition at line 424 of file xsh_utils_table.c.
References assure, check_msg, and xsh_free_propertylist().
Referenced by create_sky_mask(), xsh_cfg_recover_prepare_pm_set(), xsh_compute_absorp(), xsh_localize_ifu_slitlet(), and xsh_localize_obj_auto().
cpl_error_code xsh_sort_table_2 | ( | cpl_table * | t, | |
const char * | column1, | |||
const char * | column2, | |||
cpl_boolean | reverse1, | |||
cpl_boolean | reverse2 | |||
) |
Sort a table by two columns.
t | Table | |
column1 | 1st column name | |
column2 | 2nd column name | |
reverse1 | Flag indicating if 1st column values are sorted descending (true) or ascending (CPL_FALSE) | |
reverse2 | Flag indicating if 2nd column values are sorted descending (true) or ascending (CPL_TRUE) |
This is a wrapper of cpl_table_sort()
. column1 is the more significant column (i.e. values in column2 are compared, only if the values in column1 are equal).
Definition at line 462 of file xsh_utils_table.c.
References assure, check_msg, and xsh_free_propertylist().
static double xsh_spectrum_integrate | ( | double * | pif, | |
double * | piw, | |||
int | i1_inf, | |||
int | i1_sup, | |||
int | i2_inf, | |||
int | i2_sup, | |||
double | wave, | |||
double | wstep | |||
) | [static] |
Definition at line 5159 of file xsh_utils.c.
Referenced by xsh_spectrum_resample().
cpl_frame* xsh_spectrum_interpolate | ( | cpl_frame * | table_frame, | |
const double | wstep, | |||
const double | wmin, | |||
const double | wmax | |||
) |
spectra interpolation
table_frame | table frame containing the spectrum | |
wstep | wave step | |
wmin | wave min | |
wmax | wave max |
Definition at line 6180 of file xsh_utils.c.
References check, check_msg, xsh_add_temporary_file(), XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL_MSG, xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_msg_dbg_medium, xsh_pfits_set_pcatg(), and xsh_spline_hermite_table().
Referenced by xsh_compute_response(), and xsh_compute_response_ord().
cpl_frame* xsh_spectrum_interpolate_linear | ( | cpl_frame * | table_frame, | |
const double | wstep, | |||
const double | wmin, | |||
const double | wmax | |||
) |
spectra interpolation
table_frame | table frame containing the spectrum | |
wstep | wave step | |
wmin | wave min | |
wmax | wave max |
Definition at line 6087 of file xsh_utils.c.
References check, xsh_add_temporary_file(), XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL_MSG, xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_iterpol_linear(), and xsh_pfits_set_pcatg().
Referenced by xsh_compute_response2().
cpl_frame* xsh_spectrum_resample | ( | cpl_frame * | frame_inp, | |
const double | wstep, | |||
const double | wmin, | |||
const double | wmax, | |||
xsh_instrument * | instr | |||
) |
resample a spectrum
[in] | frame_inp | input spectrum |
[in] | wstep | output spectrum wavelength step |
[in] | wmin | min wave on the given arm |
[in] | wmax | max wave on the given arm |
[in] | instr | instrument setting |
Definition at line 5213 of file xsh_utils.c.
References check, xsh_add_temporary_file(), XSH_ARM_UVB, XSH_ATM_EXT_UVB_WAV_MIN, xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), xsh_msg, xsh_spectrum_integrate(), and xsh_util_get_infsup().
Referenced by xsh_compute_response().
double xsh_spline_hermite | ( | double | xp, | |
const double * | x, | |||
const double * | y, | |||
int | n, | |||
int * | istart | |||
) |
Spline interpolation based on Hermite polynomials.
xp | x-value to interpolate | |
x | x-values | |
y | y-values | |
n | array length | |
istart | (input/output) initial row (set to 0 to search all row) |
The x column must be sorted (ascending or descending) and all x column values must be different.
Adopted from: Cristian Levin - ESO La Silla, 1-Apr-1991
Definition at line 4462 of file xsh_utils.c.
Referenced by xsh_spline_hermite_table().
double xsh_spline_hermite_table | ( | double | xp, | |
const cpl_table * | t, | |||
const char * | column_x, | |||
const char * | column_y, | |||
int * | istart | |||
) |
Spline interpolation based on Hermite polynomials.
xp | x-value to interpolate | |
t | Table containing the columns to interpolate | |
column_x | Column of x-values | |
column_y | Column of y-values | |
istart | (input/output) initial row (set to 0 to search all row) |
Definition at line 4533 of file xsh_utils.c.
References check_msg, n, x, xsh_spline_hermite(), and y.
Referenced by xsh_normalize_spectrum_image(), xsh_spectrum_interpolate(), xsh_util_multiply_by_response(), and xsh_util_multiply_by_response_ord().
const char* xsh_string_tolower | ( | char * | s | ) |
Convert all uppercase characters in a string into lowercase characters.
s | The string to convert. |
Walks through the given string and turns uppercase characters into lowercase characters using tolower().
Definition at line 4393 of file xsh_utils.c.
const char* xsh_string_toupper | ( | char * | s | ) |
Convert all lowercase characters in a string into uppercase characters.
s | The string to convert. |
Walks through the given string and turns lowercase characters into uppercase characters using toupper().
Definition at line 4427 of file xsh_utils.c.
Referenced by xsh_parameters_subtract_sky_single_get().
char* xsh_stringcat | ( | const char * | s1, | |
const char * | s2 | |||
) |
String concatenation.
s1 | First string | |
s2 | Second string |
cpl_free()
Definition at line 1660 of file xsh_utils.c.
References assure.
char* xsh_stringcat_3 | ( | const char * | s1, | |
const char * | s2, | |||
const char * | s3 | |||
) |
String concatenation.
s1 | First string | |
s2 | Second string | |
s3 | Third string |
cpl_free()
Definition at line 1694 of file xsh_utils.c.
References assure.
Referenced by xsh_find_frame().
char* xsh_stringcat_4 | ( | const char * | s1, | |
const char * | s2, | |||
const char * | s3, | |||
const char * | s4 | |||
) |
String concatenation.
s1 | First string | |
s2 | Second string | |
s3 | Third string | |
s4 | Fourth string |
cpl_free()
Definition at line 1732 of file xsh_utils.c.
References assure.
Referenced by xsh_begin(), and xsh_unique_filename().
char* xsh_stringcat_5 | ( | const char * | s1, | |
const char * | s2, | |||
const char * | s3, | |||
const char * | s4, | |||
const char * | s5 | |||
) |
String concatenation.
s1 | First string | |
s2 | Second string | |
s3 | Third string | |
s4 | Fourth string | |
s5 | Fifth string |
cpl_free()
Definition at line 1772 of file xsh_utils.c.
References assure.
char* xsh_stringcat_6 | ( | const char * | s1, | |
const char * | s2, | |||
const char * | s3, | |||
const char * | s4, | |||
const char * | s5, | |||
const char * | s6 | |||
) |
String concatenation.
s1 | First string | |
s2 | Second string | |
s3 | Third string | |
s4 | Fourth string | |
s5 | Fifth string | |
s6 | Sixth string |
cpl_free()
Definition at line 1816 of file xsh_utils.c.
References assure.
Referenced by xsh_unique_filename().
char* xsh_stringcat_any | ( | const char * | s, | |
... | ||||
) |
Concatenate an arbitrary number of strings.
s | First string | |
... | Other strings (at least 1 more) |
cpl_free()
Definition at line 1858 of file xsh_utils.c.
Referenced by irplib_paf_init(), main(), save_centers(), xsh_2dmap(), xsh_add_product_pre(), xsh_add_product_pre_3d(), xsh_add_product_spectrum(), xsh_add_product_table(), xsh_cfg_recover_last_step(), xsh_combine_nod(), xsh_create_final_name(), xsh_create_final_tag(), xsh_extract_clean_with_tag(), xsh_extract_with_tag(), xsh_find_calpro_model_config(), xsh_find_calpro_model_meas_coord(), xsh_find_model_config_open(), xsh_find_model_testpar(), xsh_find_model_wavelist(), xsh_find_raw_arc_slit_nir_off(), xsh_find_raw_arc_slit_nir_on(), xsh_find_raw_arc_slit_uvb_vis(), xsh_find_raw_orderdef_nir(), xsh_find_raw_orderdef_nir_off(), xsh_find_raw_orderdef_vis_uvb(), xsh_find_spectral_format(), xsh_linear(), xsh_merge_ord_with_tag(), xsh_model_first_anneal(), xsh_parameters_new_string(), xsh_parameters_stack_create(), xsh_predict(), xsh_remove_crh_single(), xsh_scired_ifu_offset(), xsh_set_recipe_file_prefix(), xsh_shift(), xsh_wavemap_list_save(), and xsh_wavemap_list_save2().
char* xsh_stringdup | ( | const char * | s | ) |
String duplication.
s | String to duplicate |
cpl_free()
Definition at line 1599 of file xsh_utils.c.
References assure.
Referenced by xsh_arclist_load(), and xsh_find_frame().
double xsh_table_interpolate | ( | cpl_table * | tbl, | |
double | wav, | |||
const char * | colx, | |||
const char * | coly | |||
) |
Interpolate table columns.
tbl | Table | |
wav | value at which is desired to get an interpolated value | |
colx | 1st column name | |
coly | 2nd column name |
Definition at line 561 of file xsh_utils_table.c.
References check, xsh_data_interpolate(), and y.
Referenced by xsh_utils_efficiency_internal().
cpl_error_code xsh_table_merge_clean_and_resid_tabs | ( | cpl_frame * | frm_resid, | |
cpl_frame * | frm_clean | |||
) |
Definition at line 761 of file xsh_utils_table.c.
References check, XSH_ARCLIST_TABLE_COLNAME_WAVELENGTH, XSH_ASSURE_NOT_NULL_MSG, xsh_free_propertylist(), xsh_free_table(), and XSH_RESID_TAB_TABLE_COLNAME_WAVELENGTH.
Referenced by xsh_2dmap().
static cpl_error_code xsh_table_monitor_flux_qc | ( | cpl_table * | table, | |
const double | ws, | |||
const double | we, | |||
const char * | prefix, | |||
const int | index, | |||
cpl_propertylist ** | header | |||
) | [static] |
Computes statistics on spectrum for QC.
[in] | table | input table |
[in] | ws | wavelength start value |
[in] | we | wavelength end value |
[in] | prefix | prefix of QC parameter |
[in] | index | index to specify QC parameter name |
[out] | header | header containing computed QC key |
Definition at line 593 of file xsh_utils_table.c.
References check, and xsh_free_table().
Referenced by xsh_frame_table_monitor_flux_qc_ext().
static cpl_table* xsh_table_select_matching_waves | ( | cpl_table * | table_intmon, | |
const char * | col_wave_intmon, | |||
cpl_table * | table_check, | |||
const char * | col_wave_intcheck, | |||
const double | exptime | |||
) | [static] |
Match reference and actual table via wavelength column.
table_intmon | table on which QC log is computed | |
col_wave_intmon | intmon table wavelength column | |
table_check | table on which QC log is computed | |
col_wave_check | check table wavelength column |
Definition at line 171 of file xsh_utils_table.c.
References check, tolerance, and xsh_wavecal_find_nearest().
Referenced by xsh_wavecal_qclog_element().
cpl_table* xsh_table_shift_rv | ( | cpl_table * | orig, | |
const char * | col_wave, | |||
const double | offset | |||
) |
Definition at line 823 of file xsh_utils_table.c.
References XSH_ASSURE_NOT_NULL_MSG.
Referenced by xsh_compute_response2().
int xsh_time_stamp_get | ( | void | ) |
get timestamp
Definition at line 3129 of file xsh_utils.c.
References XshTimeStamp.
Referenced by xsh_add_product_pre(), xsh_add_product_pre_3d(), xsh_add_product_spectrum(), xsh_create_final_name(), and xsh_pre_save_product().
int xsh_time_stamp_set | ( | int | ts | ) |
set timestamp
ts | time stamp index |
Definition at line 3112 of file xsh_utils.c.
References XshTimeStamp.
Referenced by xsh_parameters_time_stamp_get().
double xsh_tools_get_median_double | ( | double * | array, | |
int | size | |||
) |
Calculates the median value of an array of double.
array | The input array | |
size | The size of the array |
The first step is to sort in ascending ordre. Then the median is calculated: if size is an odd number, the median is the value of the size/2+1-th element. If size is an even number, the median is the average of the 2 elements size/2 and size/2+1. The input array is MODIFIED.
Definition at line 2654 of file xsh_utils.c.
References xsh_tools_sort_double().
Referenced by flag_noisy_pixels(), and xsh_tools_running_median_1d_get_max().
void xsh_tools_get_statistics | ( | double * | tab, | |
int | size, | |||
double * | median, | |||
double * | mean, | |||
double * | stdev | |||
) |
Compute median, stdev and mean for the tab.
[in] | tab | the input array |
[in] | size | the size of input array |
[out] | median | the median of array |
[out] | mean | the mean of array |
[out] | stdev | the stdev of array |
Definition at line 2354 of file xsh_utils.c.
References check, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, and xsh_free_vector().
void xsh_tools_min_max | ( | int | size, | |
double * | tab, | |||
double * | min, | |||
double * | max | |||
) |
computes min & max in ab array
size | size of array | |
tab | array | |
min | minimum | |
max | maximum |
Definition at line 2732 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
Referenced by lambda_fit(), and xsh_wavesol_compute().
int xsh_tools_running_median_1d_get_max | ( | double * | tab, | |
int | size, | |||
int | wsize | |||
) |
get max of a list of doubles after running median
tab | list of values | |
size | number of values | |
wsize | window size for running median |
Definition at line 2681 of file xsh_utils.c.
References XSH_ASSURE_NOT_NULL, XSH_FREE, XSH_MALLOC, and xsh_tools_get_median_double().
Referenced by xsh_fit_gaussian().
cpl_error_code xsh_tools_sort_double | ( | double * | pix_arr, | |
int | n | |||
) |
Sort a double array.
pix_arr | the array to sort | |
n | the array size |
From the cpl_tools_sort_double. Possible _cpl_error_code_ set in this function:
Definition at line 2394 of file xsh_utils.c.
References XSH_DOUBLE_SWAP, and XSH_PIX_STACK_SIZE.
Referenced by xsh_tools_get_median_double().
cpl_error_code xsh_tools_sort_float | ( | float * | pix_arr, | |
int | n | |||
) |
Sort a float array.
pix_arr | the array to sort | |
n | the array size |
From the cpl_tools_sort_double. Possible _cpl_error_code_ set in this function:
Definition at line 2481 of file xsh_utils.c.
References XSH_FLOAT_SWAP, and XSH_PIX_STACK_SIZE.
cpl_error_code xsh_tools_sort_int | ( | int * | pix_arr, | |
int | n | |||
) |
Sort an integer array.
pix_arr | the array to sort | |
n | the array size |
Possible _cpl_error_code_ set in this function:
Definition at line 2566 of file xsh_utils.c.
References XSH_INT_SWAP, and XSH_PIX_STACK_SIZE.
cpl_vector* xsh_tools_tchebitchev_poly_eval | ( | int | n, | |
double | X | |||
) |
Compute tchebitchev Tn(X) first coefficient for tchebitchev polynomial.
n | index of the last term to be computed (0 to n) | |
X | value of X in evaluation of the polynomial |
Definition at line 2769 of file xsh_utils.c.
References check, XSH_ASSURE_NOT_ILLEGAL, and xsh_free_vector().
Referenced by lambda_fit(), test_tech_eval_perf(), xsh_wavemap_list_eval_lambda(), xsh_wavesol_eval_polx(), and xsh_wavesol_eval_poly().
double xsh_tools_tchebitchev_reverse_transform | ( | double | pos, | |
double | min, | |||
double | max | |||
) |
computes reverse Tchebitchev transformation
pos | position | |
min | minimum | |
max | maximum |
Definition at line 2887 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL.
Referenced by xsh_wavemap_list_eval_lambda(), xsh_wavesol_eval_polx(), and xsh_wavesol_eval_poly().
double xsh_tools_tchebitchev_transform | ( | double | pos, | |
double | min, | |||
double | max | |||
) |
computes Tchebitchev transformation
pos | position | |
min | minimum | |
max | maximum |
Definition at line 2850 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and xsh_msg_dbg_medium.
Referenced by xsh_wavemap_list_eval_lambda(), xsh_wavesol_eval_polx(), and xsh_wavesol_eval_poly().
void xsh_tools_tchebitchev_transform_tab | ( | int | size, | |
double * | pos, | |||
double | min, | |||
double | max, | |||
double * | tcheb_pos | |||
) |
computes Tchebitchev transformation
size | saze of array | |
pos | position array | |
min | minimum | |
max | maximum | |
tcheb_pos | transformed position array |
Definition at line 2814 of file xsh_utils.c.
References XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
Referenced by lambda_fit(), xsh_wavesol_compute(), and xsh_wavesol_residual().
void xsh_unwrap_array | ( | cpl_array ** | a | ) |
Unwrap an array and set the pointer to NULL.
a | Array to unwrap |
Definition at line 2294 of file xsh_utils.c.
Referenced by set_qc_parameters(), and xsh_detect_arclines_dan().
void xsh_unwrap_bivector_vectors | ( | cpl_bivector ** | b | ) |
Unwrap a bi-vector and set the pointer to NULL.
b | Bi-vector to deallocate |
Definition at line 2309 of file xsh_utils.c.
Referenced by xsh_polynomial_regression_2d().
void xsh_unwrap_image | ( | cpl_image ** | i | ) |
Unwrap an image and set the pointer to NULL.
i | Image to unwrap |
Definition at line 2263 of file xsh_utils.c.
Referenced by xsh_opt_extract_orders().
void xsh_unwrap_vector | ( | cpl_vector ** | v | ) |
Unwrap a vector and set the pointer to NULL.
v | Vector to unwrap |
Definition at line 2278 of file xsh_utils.c.
Referenced by find_tilt(), main(), xsh_array_clip_poly1d(), xsh_atrous(), xsh_bpmap_collapse_mean(), xsh_bpmap_collapse_median(), xsh_center_cube(), xsh_compute_absorp(), xsh_create_blaze(), xsh_detect_arclines(), xsh_detect_order_edge(), xsh_follow_arclines(), xsh_image_create_model_image(), xsh_image_extract_optimal(), xsh_image_gaussian_fit_y(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_opt_extract_orders(), xsh_order_edge_list_fit(), xsh_order_list_fit(), xsh_polynomial_regression_2d(), xsh_pre_data_window_median_flux_pa(), xsh_rec_list_add(), xsh_spectrum_load(), and xsh_spectrum_load_order().
cpl_error_code xsh_update_pheader_in_image_multi | ( | cpl_frame * | frame, | |
const cpl_propertylist * | pheader | |||
) |
Update FITS header.
frame | The frame whose frame need to be updated | |
pheader | The primary header to copy to the frame |
Definition at line 4143 of file xsh_utils.c.
References check, XSH_ASSURE_NOT_NULL, xsh_free_image(), xsh_free_propertylist(), and xsh_msg_dbg_medium.
Referenced by xsh_monitor_flux(), and xsh_wavemap_qc().
cpl_frame* xsh_util_frameset_collapse_mean | ( | cpl_frameset * | set, | |
xsh_instrument * | instrument | |||
) |
Compute mean frame from a list of (IMAGE) framesets.
set | The input frameset | |
instrument | The instrument structure |
Definition at line 5415 of file xsh_utils.c.
References check, xsh_add_temporary_file(), xsh_frame_product(), xsh_free_image(), xsh_free_propertylist(), xsh_instrument_arm_tostring(), XSH_PRE_DATA_BPP, XSH_PRE_DATA_TYPE, XSH_PRE_ERRS_BPP, XSH_PRE_ERRS_TYPE, XSH_PRE_QUAL_BPP, and XSH_PRE_QUAL_TYPE.
Referenced by xsh_scired_ifu_offset().
static cpl_error_code xsh_util_get_infsup | ( | double * | piw, | |
double | w, | |||
int | i_start, | |||
int | i_end, | |||
int * | i_inf, | |||
int * | i_sup | |||
) | [static] |
Definition at line 5138 of file xsh_utils.c.
Referenced by xsh_spectrum_resample().
cpl_frame* xsh_util_multiply_by_response | ( | cpl_frame * | merged_sci, | |
cpl_frame * | response, | |||
const char * | tag_o | |||
) |
Multiply input frame by response frame.
merged_sci | The input object frame | |
response | The input response | |
tag_o | The output frame pro catg |
Definition at line 4683 of file xsh_utils.c.
References check, check_msg, lambda_step, XSH_ASSURE_NOT_NULL_MSG, XSH_BUNIT_FLUX_ABS_C, xsh_frame_product(), xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_image_to_vector(), xsh_msg, xsh_msg_dbg_medium, xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_get_naxis(), xsh_pfits_set_bunit(), xsh_pfits_set_extname(), xsh_pfits_set_pcatg(), xsh_plist_set_extra_keys(), XSH_PRE_DATA_BPP, XSH_PRE_DATA_TYPE, XSH_PRE_ERRS_BPP, XSH_PRE_ERRS_TYPE, XSH_PRE_QUAL_BPP, XSH_PRE_QUAL_TYPE, XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, xsh_spline_hermite_table(), and xsh_vector_to_image().
Referenced by xsh_scired_util_spectra_flux_calibrate().
cpl_frame* xsh_util_multiply_by_response_ord | ( | cpl_frame * | extracted_sci, | |
cpl_frame * | response, | |||
const char * | tag_o | |||
) |
Multiply input frame by response frame.
extracted_sci | The input object frame | |
response | The input response | |
tag_o | the output frame pro.catg |
Definition at line 4901 of file xsh_utils.c.
References check, check_msg, lambda_step, order, XSH_ASSURE_NOT_NULL_MSG, XSH_BUNIT_FLUX_ABS_C, xsh_frame_product(), xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_image_to_vector(), xsh_msg, xsh_msg_dbg_medium, xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_get_naxis(), xsh_pfits_set_bunit(), xsh_pfits_set_extname(), xsh_pfits_set_pcatg(), xsh_plist_set_extra_keys(), XSH_PRE_DATA_BPP, XSH_PRE_DATA_TYPE, XSH_PRE_ERRS_BPP, XSH_PRE_ERRS_TYPE, XSH_PRE_QUAL_BPP, XSH_PRE_QUAL_TYPE, XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, xsh_spline_hermite_table(), and xsh_vector_to_image().
Referenced by xsh_flux_calibrate1D(), xsh_flux_calibrate2D(), and xsh_util_apply_response().
void xsh_vector_fit_gaussian | ( | cpl_vector * | x, | |
cpl_vector * | y, | |||
XSH_GAUSSIAN_FIT * | result | |||
) |
set debug level
x | vector with independent variable | |
y | vector with dependent variable | |
result | structure containing results (peakpos,sigma,area,offset,mse) |
cpl_vector_fit_gaussian
(assumes no errors on X,Y); Definition at line 3034 of file xsh_utils.c.
References XSH_GAUSSIAN_FIT::area, XSH_GAUSSIAN_FIT::mse, XSH_GAUSSIAN_FIT::offset, XSH_GAUSSIAN_FIT::peakpos, XSH_GAUSSIAN_FIT::sigma, and XSH_ASSURE_NOT_NULL.
Referenced by detect_centroid(), xsh_image_fit_gaussian_max_pos_x_window(), and xsh_image_fit_gaussian_max_pos_y_window().
double xsh_vector_get_err_mean | ( | cpl_vector * | vect | ) |
Computes mean error on a data set.
vect | input data |
Definition at line 4239 of file xsh_utils.c.
References check, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_rec_list_add().
double xsh_vector_get_err_median | ( | cpl_vector * | vect | ) |
Computes median error on a data set.
vect | input data |
Definition at line 4204 of file xsh_utils.c.
References check, M_PI, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_rec_list_add().
cpl_image* xsh_vector_to_image | ( | const cpl_vector * | vector, | |
cpl_type | type | |||
) |
Convert a vector to a 1d image.
vector | to convert | |
type | of image |
Definition at line 4630 of file xsh_utils.c.
References assure, and xsh_free_image().
Referenced by xsh_normalize_spectrum_image_slice(), xsh_util_multiply_by_response(), and xsh_util_multiply_by_response_ord().
static int xsh_wavecal_find_nearest | ( | const cpl_table * | line_refer, | |
const char * | col_ref, | |||
double | lambda, | |||
int | lo, | |||
int | hi | |||
) | [static] |
Find best matching catalogue wavelength.
line_refer | Table to search | |
lambda | Find catalogue wavelength nearest to this wavelength | |
lo | First row (inclusive, counting from 0) of table to search | |
hi | Last row (inclusive, counting from 0) of table to search |
This function returns the index of the nearest wavelength in the range {lo, ..., hi} The input table must be sorted according to the column "Wave" which is the column that is searched.
Definition at line 81 of file xsh_utils_table.c.
References check.
Referenced by xsh_table_select_matching_waves().
static cpl_error_code xsh_wavecal_qclog_compute | ( | cpl_table * | temp, | |
cpl_propertylist ** | header_check, | |||
const char * | element | |||
) | [static] |
computes intmon QC log
table | table on which QC log is computed | |
header | frame header of bright lines | |
element | atomic element the line refers to |
Definition at line 127 of file xsh_utils_table.c.
References check, QC_WAVECAL_INTAVG, QC_WAVECAL_INTAVG_C, QC_WAVECAL_NLININT, QC_WAVECAL_NLININT_C, and xsh_msg_warning.
Referenced by xsh_wavecal_qclog_element().
static cpl_error_code xsh_wavecal_qclog_element | ( | cpl_table * | table_intmon, | |
cpl_table * | table_check, | |||
const double | exptime, | |||
const char * | atom_name, | |||
cpl_propertylist ** | header_check | |||
) | [static] |
computes intmon QC log
table_intmon | table of bright lines | |
table_check | line detection table on which QC log is computed | |
exptime | frame exposure time | |
atom_name | atom name | |
header_check | frame header where to loh QC |
Definition at line 264 of file xsh_utils_table.c.
References check, xsh_free_table(), xsh_table_select_matching_waves(), and xsh_wavecal_qclog_compute().
Referenced by xsh_wavecal_qclog_intmon().
cpl_error_code xsh_wavecal_qclog_intmon | ( | cpl_frame * | line_check, | |
const cpl_frame * | line_intmon, | |||
const double | exptime, | |||
xsh_instrument * | inst | |||
) |
computes intmon QC log
table_check | frame line detection table on which QC log is computed | |
line_intmon | frame table of bright lines | |
exptime | frame exposure time | |
inst | X-shooter instrument arm/lamp setting |
Definition at line 303 of file xsh_utils_table.c.
References check, XSH_ARM_NIR, xsh_free_propertylist(), xsh_free_table(), xsh_instrument_get_arm(), and xsh_wavecal_qclog_element().
Referenced by xsh_2dmap(), and xsh_predict().
int data::deg [inherited] |
Definition at line 6600 of file xsh_utils.c.
Referenced by expb_df(), and xsh_gsl_fit_gaussian().
cpl_frame* FRAME_DATE_IDX::frame [inherited] |
Definition at line 3212 of file xsh_utils.c.
Referenced by xsh_order_frameset_by_date().
int FRAME_DATE_IDX::frame_idx [inherited] |
Definition at line 3211 of file xsh_utils.c.
Referenced by xsh_order_frameset_by_date().
const char* FRAME_DATE_IDX::frame_name [inherited] |
Definition at line 3213 of file xsh_utils.c.
Referenced by xsh_order_frameset_by_date().
int NbProducts = 0 [static] |
Definition at line 1364 of file xsh_utils.c.
Referenced by xsh_add_product_file(), and xsh_free_product_files().
int NbTemp = 0 [static] |
Definition at line 1362 of file xsh_utils.c.
Referenced by xsh_add_temporary_file(), xsh_end(), and xsh_free_temporary_files().
char** ProdFiles = NULL [static] |
Definition at line 1363 of file xsh_utils.c.
Referenced by xsh_add_product_file(), and xsh_free_product_files().
char** TempFiles = NULL [static] |
Definition at line 1361 of file xsh_utils.c.
Referenced by xsh_add_temporary_file(), xsh_end(), and xsh_free_temporary_files().
double* data::x [inherited] |
Definition at line 6599 of file xsh_utils.c.
Referenced by xsh_gsl_fit_gaussian().
double* data::y [inherited] |
Definition at line 6598 of file xsh_utils.c.
Referenced by xsh_gsl_fit_gaussian().