Defines | |
#define | ERROR 1 |
#define | ERROR 1 |
#define | OK 0 |
#define | OK 0 |
Functions | |
static void | xsh_nullmatrix (mat A) |
static void | xsh_nullvector (vec a) |
static void | xsh_copyvector (vec a, vec b) |
static const char * | xsh_get_tag_opt_mod_cfg (xsh_xs_3 *p_xs_3, int rec_id) |
static cpl_error_code | xsh_model_compute_residuals (xsh_xs_3 *p_xs_3, coord *msp_coord, DOUBLE *p_wlarray, DOUBLE **ref_ind, const int size, const int annealed, cpl_propertylist *resid_header, cpl_frame *resid_frame, cpl_propertylist **result) |
void | xsh_3_init (struct xs_3 *p_xs_3) |
Pre-compute a number of non-wavelength dependent secondary parameters required by the model. | |
void | xsh_3_eval (DOUBLE lambda, int morder, DOUBLE **ref_ind, struct xs_3 *p_xs_3) |
Compute the physical x,y position at the detector array for a given wavelength, order and parameter configuration. | |
void | xsh_3_detpix (struct xs_3 *p_xs_3) |
Takes the physical x,y position at the detector array and converts this to a pixel position. | |
void | xsh_ref_ind_read_old (const char *ref_ind_file, DOUBLE **ref_ind, DOUBLE temper) |
Load the refractive index array for a given arm and temperature. This old routine is only retained to allow easy testing of new refractive index data. | |
void | xsh_ref_ind_read (int arm, DOUBLE **ref_ind_T, DOUBLE temper) |
Load the refractive index coeffs for a given arm and temperature. | |
int * | xsh_alloc1Darray_INT (int asize) |
allocates memory for an array of integers | |
DOUBLE * | xsh_alloc1Darray (int asize) |
allocates memory for an array of doubles | |
double ** | xsh_alloc2Darray (int asize, int bsize) |
allocates memory for a 2D array of doubles | |
float ** | xsh_alloc2Darray_f (int asize, int bsize) |
allocates memory for a 2D array of floats | |
int ** | xsh_alloc2Darray_i (int asize, int bsize) |
allocates memory for a 2D array of integers | |
int | xsh_free2Darray (double **ccdtemp, int asize) |
free memory for a 2D array of doubles | |
int | xsh_free2Darray_i (int **ccdtemp, int asize) |
free memory for a 2D array of integers | |
int | xsh_free2Darray_f (float **ccdtemp, int asize) |
free memory for a 2D array of floats | |
double * | xsh_copy2D_to_1D (double **ccdtemp, int asize, int bsize) |
copy 2D to 1D array | |
double ** | xsh_copy1D_to_2D (double *oneDccdtemp, int asize, int bsize) |
copy 1D to 2D array | |
double *** | xsh_alloc3Darray2 (int asize, int bsize, int csize) |
allocate 3D array | |
double *** | xsh_alloc3Darray (int asize, int bsize, int csize) |
allocate 3D array | |
int | xsh_free3Darray (double ***ccdtemp, int asize, int bsize) |
free 3D array | |
void | xsh_addvectors (vec a, vec b) |
add 2 vectors a+=b | |
void | xsh_addvectors3D (vec a, vec b) |
add 2 vectors a+=b | |
void | xsh_subtractvectors (vec a, vec b) |
subtract 2 vectors a-=b | |
DOUBLE | xsh_scalarproduct (vec a, vec b) |
implements scalar product | |
void | xsh_multiply (vec a, DOUBLE k) |
applies scalar product to vector | |
void | xsh_showvector (vec a) |
show vector content | |
void | xsh_normz (vec a) |
normalize vector | |
void | xsh_normall (vec a) |
normalize vector | |
void | xsh_multiplymatrix (mat A, mat B, mat C) |
multiply three matrixes A=B*C | |
void | xsh_multiplythreematrix (mat A, mat B, mat C, mat D) |
multiply three matrixes A=B*C*D | |
void | xsh_showmatrix (mat A) |
Show matrix. | |
void | xsh_initializematrix (mat A) |
initialize matrix A | |
void | xsh_matrixforvector (vec a, mat B, vec c) |
Realize a*B*c. | |
void | xsh_transpose (mat A, mat B) |
matrix transposal | |
void | xsh_rotationmatrix (mat A, const char axis, const DOUBLE angle) |
matrix rotation | |
void | xsh_rotin (mat A, const DOUBLE x_angle, const DOUBLE y_angle, const DOUBLE z_angle) |
matrix rotation | |
double | xsh_physmod_grating (vec in, int m, double sg, mat in_rot, mat exit_rot, vec out) |
Calculate the new vector after a given incident vector is reflected in a prism (i.e. exits from the same surface than it entered through). | |
void | xsh_refract (vec b, DOUBLE rind, vec a) |
Calculate the new vector after a given incident vector passes a boundary between two materials. | |
static cpl_error_code | xsh_model_compute_slitmap_kw (const double slit_min, const double slit_max, xsh_xs_3 *p_xs_3, xsh_instrument *instr, cpl_propertylist **plist) |
cpl_error_code | xsh_model_maps_create (xsh_xs_3 *p_xs_3, xsh_instrument *instr, const char *wtag, const char *stag, cpl_frame **wmap_frame, cpl_frame **smap_frame) |
Compute the wavelength and slit maps. | |
int | xsh_model_map_ifu (double xifu, double yifu, xsh_xs_3 *p_xs_3) |
Map the IFU position to spectrograph slit position using transformation provided by Ana for IFU2. | |
cpl_vector ** | xsh_model_locus (struct xs_3 *p_xs_3, xsh_instrument *instr, double ent_slit_pos) |
Compute the locus of the spectrum. | |
void | xsh_model_get_xy (xsh_xs_3 *p_xs_3, xsh_instrument *instr, double lambda_nm, int morder, double ent_slit_pos, double *x, double *y) |
Compute the detector location (floating point pixels) of a given wavelength/entrance slit position. | |
void | xsh_model_binxy (xsh_xs_3 *p_xs_3, int bin_X, int bin_Y) |
corrects model for detector's binning | |
cpl_frame * | xsh_model_spectralformat_create (xsh_xs_3 *p_xs_3, const char *tab_filename) |
creates the model spectral format table | |
cpl_frame * | xsh_model_THE_create (xsh_xs_3 *p_xs_3, xsh_instrument *instr, const char *line_list, int num_ph, double sep_ph, const char *THE_filename) |
Compute the THE table (centroid for each feature in lamp spectrum). | |
cpl_frame * | xsh_model_pipe_anneal (cpl_frame *cfg_frame, cpl_frame *resid_frame, int maxit, double ann_fac, int scenario, int rec_id) |
Run the annealing (optimisation) algoritm to improve the fit of the model parameter set to a given wavecal exposure. | |
int | xsh_model_open_param (char *listname, char *findname, int *ref, int setref, double *best, double setbest, double *min, double *max, double gfac, double fac, int counter) |
Open a parameter in the model config structure for annealing and set the limits. | |
double | xsh_model_sellmeier_ext (int arm, double temper, double lam_sqr) |
Get the refractive index for a given temperature and wavelength from the (hard coded) extended Sellmeier co-efficients for infrasil (NIR) and Silica (UVB). | |
double | xsh_model_ref_ind_air (double temper, double lam_sqr) |
Return the refractive index of air at a given wavelength and temperature. | |
cpl_vector * | xsh_model_refining_detect (const cpl_vector *in, int fwhm, double sigma, int display) |
Detect the brightest features in a spectrum. | |
int | xsh_model_first_anneal (cpl_parameterlist *parlist, cpl_frameset *frameset) |
Interpret the command line options and execute the data processing. | |
int | xsh_model_first_anneal_save (const cpl_table *out_table, xsh_instrument *instr, cpl_parameterlist *parlist, cpl_frameset *set) |
Save the product of the recipe. | |
int | xsh_model_offset (DOUBLE slit_pix_shift, DOUBLE disp_pix_shift, struct xs_3 *p_xs_3) |
convert a pixel shift measured on the detector to a shift in detector centroid | |
static int | comp_center2 (const void *one, const void *two) |
static void | save_centers (CENTER_ORDER *pcent, int fpos, int npos, const char *arm) |
void | xsh_order_edge_list_fit (xsh_order_list *list, int size, double *order, double *posx, double *posy, int deg_poly, int edge) |
Fit edge of an order. | |
static void | fit_order_edge_list (xsh_order_list *list, int npos, CENTER_ORDER *pcent, int degree, int edge) |
cpl_frame * | xsh_model_order_edges_tab_create (xsh_xs_3 *p_xs_3, const char *tab_filename) |
Create an order edges table using the phys mod. |
#define ERROR 1 |
Definition at line 1932 of file xsh_model_kernel.c.
#define ERROR 1 |
Definition at line 1932 of file xsh_model_kernel.c.
Referenced by xsh_free3Darray().
#define OK 0 |
Definition at line 1933 of file xsh_model_kernel.c.
#define OK 0 |
Definition at line 1933 of file xsh_model_kernel.c.
Referenced by xsh_free3Darray().
static int comp_center2 | ( | const void * | one, | |
const void * | two | |||
) | [static] |
Definition at line 5755 of file xsh_model_kernel.c.
References first, and CENTER_ORDER::order.
Referenced by xsh_model_order_edges_tab_create().
static void fit_order_edge_list | ( | xsh_order_list * | list, | |
int | npos, | |||
CENTER_ORDER * | pcent, | |||
int | degree, | |||
int | edge | |||
) | [static] |
Definition at line 5902 of file xsh_model_kernel.c.
References CENTER_ORDER::order, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, XSH_CALLOC, XSH_FREE, and xsh_order_edge_list_fit().
Referenced by xsh_model_order_edges_tab_create().
static void save_centers | ( | CENTER_ORDER * | pcent, | |
int | fpos, | |||
int | npos, | |||
const char * | arm | |||
) | [static] |
Definition at line 5766 of file xsh_model_kernel.c.
References CENTER_ORDER::flux, CENTER_ORDER::order, order, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, and xsh_stringcat_any().
Referenced by xsh_model_order_edges_tab_create().
void xsh_3_detpix | ( | struct xs_3 * | p_xs_3 | ) |
Takes the physical x,y position at the detector array and converts this to a pixel position.
p_xs_3 | model parameter structure |
Definition at line 879 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::ca_x0, xs_3::ca_x1, xs_3::ca_y0, xs_3::ca_y1, xs_3::chippix, xs_3::chipx, xs_3::chipxpix, xs_3::chipy, xs_3::chipypix, xs_3::d2_x1, xs_3::d2_x2, xs_3::d2_x3, xs_3::d2_y1x0, xs_3::d2_y1x1, xs_3::d2_y1x2, xs_3::d2_y1x3, xs_3::d2_y2x0, xs_3::d2_y2x1, xs_3::d2_y2x2, xs_3::d2_y2x3, xs_3::d2_y3x0, xs_3::d2_y3x1, xs_3::d2_y3x2, xs_3::d2_y3x3, xs_3::es_y_tot, xs_3::fdet, NIR_FIX, xs_3::pc4_x_x2y2, xs_3::pc4_x_x3y, xs_3::pc4_x_x4, xs_3::pc4_x_xy3, xs_3::pc4_x_y4, xs_3::pc4_y_x2y2, xs_3::pc4_y_x3y, xs_3::pc4_y_x4, xs_3::pc4_y_xy3, xs_3::pc4_y_y4, xs_3::pc_x_x1, xs_3::pc_x_x2y, xs_3::pc_x_x3, xs_3::pc_x_xx, xs_3::pc_x_xy, xs_3::pc_x_y1, xs_3::pc_x_y2x, xs_3::pc_x_y3, xs_3::pc_x_yy, xs_3::pc_y_x1, xs_3::pc_y_x2y, xs_3::pc_y_x3, xs_3::pc_y_xx, xs_3::pc_y_xy, xs_3::pc_y_y1, xs_3::pc_y_y2x, xs_3::pc_y_y3, xs_3::pc_y_yy, xs_3::pix_X, xs_3::pix_Y, xs_3::xdet, xs_3::xpospix, xs_3::xsize_corr, xs_3::ydet, xs_3::ypospix, and xs_3::ysize_corr.
Referenced by xsh_3_energy(), xsh_3_output_data(), xsh_model_anneal_reduce(), xsh_model_compute_residuals(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
Compute the physical x,y position at the detector array for a given wavelength, order and parameter configuration.
lambda | Wavelength in um (double) | |
morder | Spectral order (int) | |
ref_ind | pre-loaded refractive index array | |
p_xs_3 | model parameter structure |
Definition at line 471 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::config_mjd, xs_3::e_slit, xs_3::es_x, xs_3::es_y, xs_3::es_y_tot, xs_3::fcol, xs_3::fdet, xs_3::flipx, xs_3::flipy, xs_3::grat_alpha, xs_3::grat_beta, xs_3::grat_out, mm2um, xs_3::morder, xs_3::mud, xs_3::mup_ir_cor, xs_3::mup_ir_cor_out, xs_3::nud, xs_3::offx, xs_3::offy, xs_3::ret_prism1, xs_3::ret_prism2, xs_3::ret_prism3, xs_3::ret_prism4, xs_3::ret_prism5, xs_3::ret_prism6, xs_3::rind, xs_3::rind2, xs_3::rind3, xs_3::sg, xs_3::t_ir_p2, xs_3::t_ir_p3, xs_3::taud, xs_3::temper, xs_3::todetector, xs_3::tograt, xs_3::toprism1, xs_3::toprism2, xs_3::toprism3, xs_3::toprism4, xs_3::toprism5, xs_3::toprism6, xs_3::xdet, xsh_copyvector(), xsh_matrixforvector(), xsh_model_sellmeier_ext(), xsh_normall(), xsh_normz(), xsh_refract(), xsh_rotin(), xsh_subtractvectors(), XSH_TRACE_MSG, and xs_3::ydet.
Referenced by xsh_3_energy(), xsh_3_output_data(), xsh_model_anneal_reduce(), xsh_model_compute_residuals(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
void xsh_3_init | ( | struct xs_3 * | p_xs_3 | ) |
Pre-compute a number of non-wavelength dependent secondary parameters required by the model.
p_xs_3 | the model parameter structure |
Definition at line 374 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::chipx, xs_3::chipxdown, xs_3::chipxpix, xs_3::chipxup, xs_3::chipy, xs_3::chipydown, xs_3::chipypix, xs_3::chipyup, xs_3::cmup1, xs_3::e_slit, xs_3::grat_out, xs_3::mues, xs_3::mug, xs_3::mup1, xs_3::mup2, xs_3::mup3, xs_3::mup4, xs_3::mup5, xs_3::mup6, xs_3::mup_ir_cor, xs_3::mup_ir_cor_out, NIR_FIX, xs_3::nues, xs_3::nug, xs_3::nup1, xs_3::nup2, xs_3::nup3, xs_3::nup4, xs_3::nup5, xs_3::nup6, xs_3::pix_X, xs_3::pix_Y, xs_3::ret_prism1, xs_3::ret_prism2, xs_3::ret_prism3, xs_3::ret_prism4, xs_3::ret_prism5, xs_3::ret_prism6, xs_3::ret_prism_out1, xs_3::ret_prism_out2, xs_3::ret_prism_out3, xs_3::taues, xs_3::taug, xs_3::taup1, xs_3::taup2, xs_3::taup3, xs_3::taup4, xs_3::taup5, xs_3::taup6, xs_3::todetector, xs_3::tograt, xs_3::toprism1, xs_3::toprism2, xs_3::toprism3, xs_3::toprism4, xs_3::toprism5, xs_3::toprism6, xsh_multiplymatrix(), xsh_rotin(), and xsh_transpose().
Referenced by xsh_3_energy(), xsh_3_output_data(), xsh_model_anneal_reduce(), xsh_model_compute_residuals(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
add 2 vectors a+=b
a | vector1 | |
b | vector2 |
Definition at line 1583 of file xsh_model_kernel.c.
References vectordim.
add 2 vectors a+=b
a | vector1 | |
b | vector2 |
Definition at line 1595 of file xsh_model_kernel.c.
References vectordim.
DOUBLE* xsh_alloc1Darray | ( | int | asize | ) |
allocates memory for an array of doubles
asize | size of array |
Definition at line 1247 of file xsh_model_kernel.c.
Referenced by xsh_model_anneal_reduce(), xsh_model_first_anneal(), xsh_model_locus(), xsh_model_pipe_anneal(), and xsh_model_reduce().
int* xsh_alloc1Darray_INT | ( | int | asize | ) |
allocates memory for an array of integers
asize | size of array |
Definition at line 1231 of file xsh_model_kernel.c.
Referenced by xsh_model_locus(), and xsh_model_reduce().
double** xsh_alloc2Darray | ( | int | asize, | |
int | bsize | |||
) |
allocates memory for a 2D array of doubles
asize | size1 of array | |
bsize | size2 of array |
Definition at line 1265 of file xsh_model_kernel.c.
Referenced by xsh_alloc3Darray2(), xsh_copy1D_to_2D(), xsh_model_anneal_reduce(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
float** xsh_alloc2Darray_f | ( | int | asize, | |
int | bsize | |||
) |
allocates memory for a 2D array of floats
asize | size1 of array | |
bsize | size2 of array |
Definition at line 1293 of file xsh_model_kernel.c.
int** xsh_alloc2Darray_i | ( | int | asize, | |
int | bsize | |||
) |
allocates memory for a 2D array of integers
asize | size1 of array | |
bsize | size2 of array |
Definition at line 1322 of file xsh_model_kernel.c.
double*** xsh_alloc3Darray | ( | int | asize, | |
int | bsize, | |||
int | csize | |||
) |
allocate 3D array
asize | size1 | |
bsize | size2 | |
csize | size3 |
Definition at line 1514 of file xsh_model_kernel.c.
double*** xsh_alloc3Darray2 | ( | int | asize, | |
int | bsize, | |||
int | csize | |||
) |
allocate 3D array
asize | size1 | |
bsize | size2 | |
csize | size3 |
Definition at line 1491 of file xsh_model_kernel.c.
References xsh_alloc2Darray().
double** xsh_copy1D_to_2D | ( | double * | oneDccdtemp, | |
int | asize, | |||
int | bsize | |||
) |
copy 1D to 2D array
oneDccdtemp | 1D array | |
asize | size1 | |
bsize | size2 |
Definition at line 1465 of file xsh_model_kernel.c.
References xsh_alloc2Darray().
double* xsh_copy2D_to_1D | ( | double ** | ccdtemp, | |
int | asize, | |||
int | bsize | |||
) |
copy 2D to 1D array
ccdtemp | 2D array | |
asize | size1 | |
bsize | size2 |
Definition at line 1435 of file xsh_model_kernel.c.
Referenced by xsh_model_maps_create(), and xsh_model_reduce().
Definition at line 130 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_3_eval(), and xsh_matrixforvector().
int xsh_free2Darray | ( | double ** | ccdtemp, | |
int | asize | |||
) |
free memory for a 2D array of doubles
ccdtemp | array | |
asize | size of array |
Definition at line 1351 of file xsh_model_kernel.c.
Referenced by xsh_free3Darray(), xsh_model_anneal_reduce(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
int xsh_free2Darray_f | ( | float ** | ccdtemp, | |
int | asize | |||
) |
free memory for a 2D array of floats
ccdtemp | array | |
asize | size of array |
Definition at line 1408 of file xsh_model_kernel.c.
int xsh_free2Darray_i | ( | int ** | ccdtemp, | |
int | asize | |||
) |
free memory for a 2D array of integers
ccdtemp | array | |
asize | size of array |
Definition at line 1380 of file xsh_model_kernel.c.
int xsh_free3Darray | ( | double *** | ccdtemp, | |
int | asize, | |||
int | bsize | |||
) |
free 3D array
ccdtemp | free 3D array | |
asize | size1 | |
bsize | size2 |
Definition at line 1556 of file xsh_model_kernel.c.
References ERROR, OK, and xsh_free2Darray().
static const char* xsh_get_tag_opt_mod_cfg | ( | xsh_xs_3 * | p_xs_3, | |
int | rec_id | |||
) | [static] |
Definition at line 138 of file xsh_model_kernel.c.
References xs_3::arm, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_MOD_CFG_OPT_2D_NIR, XSH_MOD_CFG_OPT_2D_UVB, XSH_MOD_CFG_OPT_2D_VIS, XSH_MOD_CFG_OPT_AFC_NIR, XSH_MOD_CFG_OPT_AFC_UVB, XSH_MOD_CFG_OPT_AFC_VIS, XSH_MOD_CFG_OPT_FMT_NIR, XSH_MOD_CFG_OPT_FMT_UVB, XSH_MOD_CFG_OPT_FMT_VIS, XSH_MOD_CFG_OPT_REC_NIR, XSH_MOD_CFG_OPT_REC_UVB, XSH_MOD_CFG_OPT_REC_VIS, XSH_MOD_CFG_OPT_WAV_IFU_NIR, XSH_MOD_CFG_OPT_WAV_IFU_UVB, XSH_MOD_CFG_OPT_WAV_IFU_VIS, XSH_MOD_CFG_OPT_WAV_SLIT_NIR, XSH_MOD_CFG_OPT_WAV_SLIT_UVB, and XSH_MOD_CFG_OPT_WAV_SLIT_VIS.
Referenced by xsh_model_pipe_anneal().
void xsh_initializematrix | ( | mat | A | ) |
initialize matrix A
A | matrix to be initialized |
Definition at line 1754 of file xsh_model_kernel.c.
References vectordim.
Realize a*B*c.
a | vector | |
B | matrix | |
c | vector |
Definition at line 1772 of file xsh_model_kernel.c.
References vectordim, xsh_copyvector(), and xsh_nullvector().
Referenced by xsh_3_eval(), and xsh_physmod_grating().
void xsh_model_binxy | ( | xsh_xs_3 * | p_xs_3, | |
int | bin_X, | |||
int | bin_Y | |||
) |
corrects model for detector's binning
p_xs_3 | pointer to model structure | |
bin_X | X binning | |
bin_Y | Y binning |
Definition at line 2809 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::ASIZE, xs_3::BSIZE, xs_3::chipxpix, xs_3::chipypix, NIR_xsize_corr, NIR_ysize_corr, XSH_INSTRCONFIG::nx, XSH_INSTRCONFIG::ny, xs_3::pix, xs_3::pix_X, xs_3::pix_Y, xs_3::SIZE, UVB_xsize_corr, UVB_ysize_corr, VIS_xsize_corr, VIS_ysize_corr, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_instrument_free(), xsh_instrument_get_config(), xsh_instrument_new(), xsh_instrument_set_arm(), xs_3::xsize_corr, and xs_3::ysize_corr.
Referenced by clean_arclist_data(), main(), xsh_build_ifu_cube(), xsh_create_dispersol_physmod(), xsh_create_model_map(), xsh_model_reduce(), xsh_opt_extract_orders(), xsh_util_guess_xy(), xsh_util_ifu_build_cube(), and xsh_util_physmod_model_THE_create().
static cpl_error_code xsh_model_compute_residuals | ( | xsh_xs_3 * | p_xs_3, | |
coord * | msp_coord, | |||
DOUBLE * | p_wlarray, | |||
DOUBLE ** | ref_ind, | |||
const int | size, | |||
const int | annealed, | |||
cpl_propertylist * | resid_header, | |||
cpl_frame * | resid_frame, | |||
cpl_propertylist ** | result | |||
) | [static] |
Definition at line 224 of file xsh_model_kernel.c.
References check, xs_3::es_y, xs_3::es_y_tot, coord::order, xs_3::slit, coord::slit_pos, xs_3::slit_scale, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_free_table(), XSH_QC_MODEL_ANNEAL_RESX_AVG, XSH_QC_MODEL_ANNEAL_RESX_MAX, XSH_QC_MODEL_ANNEAL_RESX_MED, XSH_QC_MODEL_ANNEAL_RESX_MIN, XSH_QC_MODEL_ANNEAL_RESX_RMS, XSH_QC_MODEL_ANNEAL_RESY_AVG, XSH_QC_MODEL_ANNEAL_RESY_MAX, XSH_QC_MODEL_ANNEAL_RESY_MED, XSH_QC_MODEL_ANNEAL_RESY_MIN, XSH_QC_MODEL_ANNEAL_RESY_RMS, XSH_QC_MODEL_PREDICT_RESX_AVG, XSH_QC_MODEL_PREDICT_RESX_MAX, XSH_QC_MODEL_PREDICT_RESX_MED, XSH_QC_MODEL_PREDICT_RESX_MIN, XSH_QC_MODEL_PREDICT_RESX_RMS, XSH_QC_MODEL_PREDICT_RESY_AVG, XSH_QC_MODEL_PREDICT_RESY_MAX, XSH_QC_MODEL_PREDICT_RESY_MED, XSH_QC_MODEL_PREDICT_RESY_MIN, XSH_QC_MODEL_PREDICT_RESY_RMS, XSH_RESID_TAB_TABLE_COLNAME_RESIDXMODEL, XSH_RESID_TAB_TABLE_COLNAME_RESIDYMODEL, XSH_RESID_TAB_TABLE_COLNAME_XGAUSS, XSH_RESID_TAB_TABLE_COLNAME_XTHANNEAL, XSH_RESID_TAB_TABLE_COLNAME_YGAUSS, XSH_RESID_TAB_TABLE_COLNAME_YTHANNEAL, and xs_3::ypospix.
Referenced by xsh_model_pipe_anneal().
static cpl_error_code xsh_model_compute_slitmap_kw | ( | const double | slit_min, | |
const double | slit_max, | |||
xsh_xs_3 * | p_xs_3, | |||
xsh_instrument * | instr, | |||
cpl_propertylist ** | plist | |||
) | [static] |
Definition at line 1940 of file xsh_model_kernel.c.
References check, xs_3::es_s, IFU_HI, IFU_LOW, xs_3::morder_min, xs_3::slit_scale, xsh_instrument_get_mode(), XSH_MODE_IFU, xsh_pfits_set_slitmap_median_cen(), xsh_pfits_set_slitmap_median_edglo(), xsh_pfits_set_slitmap_median_edgup(), xsh_pfits_set_slitmap_median_sliclo(), xsh_pfits_set_slitmap_median_slicup(), xsh_pfits_set_slitmap_order_cen(), xsh_pfits_set_slitmap_order_edglo(), xsh_pfits_set_slitmap_order_edgup(), xsh_pfits_set_slitmap_order_sliclo(), and xsh_pfits_set_slitmap_order_slicup().
Referenced by xsh_model_maps_create().
int xsh_model_first_anneal | ( | cpl_parameterlist * | parlist, | |
cpl_frameset * | frameset | |||
) |
Interpret the command line options and execute the data processing.
parlist | the parameters list | |
frameset | the frames list |
Definition at line 5217 of file xsh_model_kernel.c.
References coord::arm, xs_3::arm, check, xs_3::chippix, xs_3::chipx, xs_3::chipy, cknull_msg, xs_3::cmup1, coord::counter, DEG2RAD, xs_3::e_slit, xs_3::es_y, xs_3::es_y_tot, xs_3::fcol, xs_3::fdet, coord::flux, instrument, MAXIT, xs_3::mug, xs_3::mup1, xs_3::mup3, xs_3::mup5, xs_3::nug, xs_3::nup1, xs_3::nup3, xs_3::nup5, coord::order, xs_3::sg, xs_3::slit, coord::slit_pos, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::taud, xs_3::temper, coord::wave, coord::x, x, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc1Darray(), xsh_alloc2Darray(), XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_CALLOC, xsh_find_frame_with_tag(), xsh_frame_product(), xsh_free2Darray(), xsh_free_table(), xsh_instrument_arm_tostring(), xsh_instrument_free(), xsh_instrument_new(), xsh_instrument_set_arm(), XSH_MEASCOORD, XSH_MOD_CFG, xsh_model_anneal_comp(), xsh_model_first_anneal_save(), xsh_model_readfits(), xsh_msg, xsh_msg_error, xsh_msg_warning, xsh_ref_ind_read(), xsh_showmatrix(), xsh_stringcat_any(), coord::y, y, and xs_3::ypospix.
Referenced by xsh_cfg_recover_driver(), and xsh_model_first_anneal_exec().
int xsh_model_first_anneal_save | ( | const cpl_table * | out_table, | |
xsh_instrument * | instr, | |||
cpl_parameterlist * | parlist, | |||
cpl_frameset * | set | |||
) |
Save the product of the recipe.
out_table | the table | |
instr | instrument arm setting | |
parlist | the input list of parameters | |
set | the input frame set |
Definition at line 5662 of file xsh_model_kernel.c.
References check, xsh_add_product_table_multi(), xsh_dfs_extract_raw_frames(), xsh_frame_product(), xsh_free_frame(), xsh_free_frameset(), xsh_free_propertylist(), xsh_get_tag_from_arm(), and XSH_MOD_CFG_FAN.
Referenced by xsh_model_first_anneal().
void xsh_model_get_xy | ( | xsh_xs_3 * | p_xs_3, | |
xsh_instrument * | instr, | |||
double | lambda_nm, | |||
int | morder, | |||
double | ent_slit_pos, | |||
double * | x, | |||
double * | y | |||
) |
Compute the detector location (floating point pixels) of a given wavelength/entrance slit position.
p_xs_3 | Model configuration structure | |
instr | The identifier of the XSH arm | |
lambda_nm | The wavelength in nm (double) | |
morder | The spectral order (int) | |
ent_slit_pos | Position on the slit in arcsec (double) | |
x | Takes the calculated x value (double) | |
y | Takes the calculated y value (double) |
cpl_vector_delete(returned_ptr) ;
Definition at line 2736 of file xsh_model_kernel.c.
References xs_3::arm, check, xs_3::es_y, xs_3::es_y_tot, mm2nm, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::temper, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc2Darray(), XSH_ARM_UNDEFINED, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, xsh_free2Darray(), xsh_instrument_get_arm(), xsh_ref_ind_read(), and xs_3::ypospix.
Referenced by clean_arclist_data(), fill_rectified(), main(), theo_tab_model(), xsh_afcthetab_create(), xsh_build_ifu_cube(), xsh_cfg_recover_gen_xyg(), xsh_cfg_recover_measure_line_xy(), xsh_create_dispersol_physmod(), xsh_flexcor(), xsh_model_reduce(), xsh_opt_extract_orders(), xsh_spectralformat_check_wlimit(), xsh_util_guess_xy(), and xsh_util_ifu_build_cube().
cpl_vector** xsh_model_locus | ( | struct xs_3 * | p_xs_3, | |
xsh_instrument * | instr, | |||
double | ent_slit_pos | |||
) |
Compute the locus of the spectrum.
p_xs_3 | Model configuration data structure | |
instr | The XSH arm | |
ent_slit_pos | Position on the slit (double) |
The returned pointer must be deallocated with for (i=0 ; i<n_orders ; i++) cpl_vector_delete(returned_ptr[i]) ; cpl_free(returned_ptr) ; here n_orders=16 for all 3 arms
Definition at line 2565 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::ASIZE, xs_3::blaze_pad, xs_3::BSIZE, check, xs_3::chippix, xs_3::es_y, xs_3::es_y_tot, mm2nm, xs_3::morder_min, xs_3::nug, xs_3::sg, xs_3::SIZE, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::temper, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc1Darray(), xsh_alloc1Darray_INT(), xsh_alloc2Darray(), XSH_ARM_NIR, XSH_ARM_UNDEFINED, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, xsh_free2Darray(), xsh_instrument_get_arm(), xsh_ref_ind_read(), and xs_3::ypospix.
Referenced by xsh_cfg_recover_measure_line_xy(), and xsh_model_reduce().
int xsh_model_map_ifu | ( | double | xifu, | |
double | yifu, | |||
xsh_xs_3 * | p_xs_3 | |||
) |
Map the IFU position to spectrograph slit position using transformation provided by Ana for IFU2.
xifu | dispersion axis co-ordinate in arcsec on IFU slitlet | |
yifu | X-dispersion axis co-ordinate in arcsec on IFU slitlet | |
p_xs_3 | Model configuration data structure |
(The es_x and es_y_tot parameters are updated inside p_xs_3)
Definition at line 2506 of file xsh_model_kernel.c.
References xs_3::es_x, xs_3::es_y, xs_3::es_y_tot, IFU_CEN_MIN, IFU_HI, IFU_LEFT_MIN, IFU_LOW, IFU_MAP_CEN_C0X, IFU_MAP_CEN_C0Y, IFU_MAP_CEN_C1X, IFU_MAP_CEN_C1Y, IFU_MAP_CEN_C2X, IFU_MAP_CEN_C2Y, IFU_MAP_LEFT_C0X, IFU_MAP_LEFT_C0Y, IFU_MAP_LEFT_C1X, IFU_MAP_LEFT_C1Y, IFU_MAP_LEFT_C2X, IFU_MAP_LEFT_C2Y, IFU_MAP_RIGHT_C0X, IFU_MAP_RIGHT_C0Y, IFU_MAP_RIGHT_C1X, IFU_MAP_RIGHT_C1Y, IFU_MAP_RIGHT_C2X, IFU_MAP_RIGHT_C2Y, IFU_RIGHT_MIN, IFU_SCALE, and xs_3::slit_scale.
Referenced by xsh_model_maps_create().
cpl_error_code xsh_model_maps_create | ( | xsh_xs_3 * | p_xs_3, | |
xsh_instrument * | instr, | |||
const char * | wtag, | |||
const char * | stag, | |||
cpl_frame ** | wmap_frame, | |||
cpl_frame ** | smap_frame | |||
) |
Compute the wavelength and slit maps.
p_xs_3 | Model configuration data structure | |
instr | the xshooter arm | |
wtag | wavemap pro catg | |
stag | slitmap pro catg | |
[out] | wmap_frame | wavemap pro catg |
[out] | smap_frame | slitmap pro catg |
Definition at line 2003 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::ASIZE, binx, biny, xs_3::blaze_pad, xs_3::BSIZE, check, xs_3::chippix, xs_3::es_s, xs_3::es_x, xs_3::es_y, xs_3::es_y_tot, IFU_CEN_MAX, IFU_CEN_MIN, IFU_HI, IFU_LEFT_MAX, IFU_LEFT_MIN, IFU_LOW, IFU_RIGHT_MAX, IFU_RIGHT_MIN, mm2nm, mode, xs_3::morder_min, NIR_FIX, xs_3::nug, xs_3::sg, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::temper, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc2Darray(), XSH_ARM_UNDEFINED, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, xsh_copy2D_to_1D(), xsh_frame_product(), xsh_free2Darray(), xsh_free_image(), xsh_free_matrix(), xsh_free_polynomial(), xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_instrument_get_arm(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_instrument_get_mode(), XSH_MODE_IFU, XSH_MODE_UNDEFINED, xsh_model_compute_slitmap_kw(), xsh_model_map_ifu(), xsh_msg, xsh_msg_dbg_low, xsh_pfits_set_pcatg(), xsh_ref_ind_read(), and xs_3::ypospix.
Referenced by main(), xsh_create_model_map(), and xsh_model_reduce().
convert a pixel shift measured on the detector to a shift in detector centroid
disp_pix_shift | The shift of the slit centre in dispersion pixels (new position - old position) | |
slit_pix_shift | The shift of the slit centre in slit pixels (new position - old position) | |
p_xs_3 | The phys mod parameter structure |
Otherwise this reduces to simple independent chipx and chipy shifts since for XSH (but not for eg. CRIRES) there is no rotation of the detector chip within the detector plane.
Definition at line 5738 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::chipx, xs_3::chipy, xs_3::pix_X, and xs_3::pix_Y.
Referenced by xsh_flexcor().
int xsh_model_open_param | ( | char * | listname, | |
char * | findname, | |||
int * | ref, | |||
int | setref, | |||
double * | best, | |||
double | setbest, | |||
double * | min, | |||
double * | max, | |||
double | gfac, | |||
double | fac, | |||
int | counter | |||
) |
Open a parameter in the model config structure for annealing and set the limits.
listname | (char) | |
findname | (char) | |
ref | (int*) | |
setref | (int) | |
best | (double*) | |
setbest | (doublle | |
min | (double*) | |
max | (double*) | |
gfac | (double) | |
fac | (double) | |
counter | (int) |
Definition at line 4949 of file xsh_model_kernel.c.
cpl_frame* xsh_model_order_edges_tab_create | ( | xsh_xs_3 * | p_xs_3, | |
const char * | tab_filename | |||
) |
Create an order edges table using the phys mod.
I have copied the method for fitting and creating the table from xsh_order_table_from_fmtchk.c, including variable names like res_list and centers that may have lost their context here.
p_xs_3 | Model configuration data structure | |
tab_filename | Name of the cpl_table to be created |
Definition at line 5950 of file xsh_model_kernel.c.
References xsh_order::absorder, xs_3::arm, xs_3::ASIZE, xs_3::BSIZE, check, xs_3::chippix, comp_center2(), xsh_order::endy, xs_3::es_s, xs_3::es_x, xs_3::es_y, xs_3::es_y_tot, fit_order_edge_list(), CENTER_ORDER::flux, xsh_order_list::list, mm2nm, xs_3::morder_max, xs_3::morder_min, xs_3::nug, CENTER_ORDER::order, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, save_centers(), xs_3::sg, xsh_order::starty, xs_3::t_ir_p2, xs_3::temper, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc2Darray(), XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, xsh_free2Darray(), xsh_free_propertylist(), xsh_instrument_arm_tostring(), xsh_instrument_new(), xsh_instrument_set_arm(), xsh_order_list_create(), xsh_order_list_save(), xsh_pfits_set_pcatg(), xsh_ref_ind_read(), and xs_3::ypospix.
Referenced by xsh_model_reduce().
cpl_frame* xsh_model_pipe_anneal | ( | cpl_frame * | cfg_frame, | |
cpl_frame * | resid_frame, | |||
int | maxit, | |||
double | ann_fac, | |||
int | scenario, | |||
int | rec_id | |||
) |
Run the annealing (optimisation) algoritm to improve the fit of the model parameter set to a given wavecal exposure.
cfg_frame | Model configuration frame (contains config file name) | |
resid_frame | Frame containing resid table - absolute x,y positions can be calculated from thpre_x,y and diff_x,y | |
maxit | The numer of iterations of the annealing algorithm to be performed (int) | |
ann_fac | Multiplier applied to the automatic parameter ranges (i.e. when scenario!=0). For routine operations should be 1.0 | |
scenario | selects preset flag and range combinations appropriate to common scenarios: -1- Only the position across the slit and camera focal length are open 0 - No scenario, input cfg flags and limits used. 1 - scenario appropriate for the startup recipe (large ranges for parameters affecting single ph exposures, dist coeff fixed) 2 - Like 1, but includes parameters affecting all ph positions 3 - Scenario for use in fine tuning cfg to match routine wavecal exposures. All parameters affecting 1ph exposures except dist coeffs are included and parameter ranges are small. (For use by predict in 1ph case). 4 - Like 3 but includes parameters affecting all ph positions (Standard for use by predict in 9ph case and 2dmap). 5 - Like 4 but includes also dist coeffs 6 - Just dist coeffs (and chipx, chipy) 7 - Just anneal the cross-slit position focal length of the camera for wavecal 8 - Optimised parameter set for QC | |
rec_id | recipe identifier |
The returned pointer must be deallocated with cpl_frame_delete(MODEL_CONF_OPT_frame);
Definition at line 3547 of file xsh_model_kernel.c.
References coord::arm, xs_3::arm, xs_3::ca_x0, xs_3::ca_x1, xs_3::ca_y0, xs_3::ca_y1, check, xs_3::chippix, xs_3::chipx, xs_3::chipy, coord::counter, xs_3::d2_x1, xs_3::d2_x2, xs_3::d2_x3, DEG2RAD, xs_3::es_x, xs_3::es_y, xs_3::es_y_tot, xs_3::fcol, xs_3::fdet, coord::flux, xsh_resid_tab::header, xs_3::mud, xs_3::mug, xs_3::mup1, xs_3::mup2, xs_3::mup3, xs_3::mup4, xs_3::mup5, xs_3::mup6, xs_3::nud, xs_3::nug, xs_3::nup1, xs_3::nup2, xs_3::nup3, xs_3::nup4, xs_3::nup5, xs_3::nup6, coord::order, xs_3::pc4_x_x2y2, xs_3::pc4_x_x3y, xs_3::pc4_x_x4, xs_3::pc4_x_xy3, xs_3::pc4_x_y4, xs_3::pc4_y_x2y2, xs_3::pc4_y_x4, xs_3::pc4_y_xy3, xs_3::pc4_y_y4, xs_3::pc_x_x1, xs_3::pc_x_x2y, xs_3::pc_x_x3, xs_3::pc_x_xx, xs_3::pc_x_xy, xs_3::pc_x_y1, xs_3::pc_x_y2x, xs_3::pc_x_y3, xs_3::pc_x_yy, xs_3::pc_y_x1, xs_3::pc_y_x2y, xs_3::pc_y_x3, xs_3::pc_y_xx, xs_3::pc_y_xy, xs_3::pc_y_y1, xs_3::pc_y_y2x, xs_3::pc_y_y3, xs_3::pc_y_yy, xs_3::sg, size, xs_3::slit, coord::slit_pos, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::taud, xs_3::taues, xs_3::taug, xs_3::temper, coord::wave, coord::x, xs_3::xdet, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc1Darray(), xsh_alloc2Darray(), XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_frame_product(), XSH_FREE, xsh_free2Darray(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_get_basename(), xsh_get_tag_opt_mod_cfg(), xsh_model_anneal_comp(), xsh_model_compute_residuals(), xsh_model_readfits(), xsh_msg, xsh_msg_dbg_medium, xsh_pfits_set_pcatg(), xsh_ref_ind_read(), xsh_resid_tab_free(), xsh_resid_tab_get_lambda_data(), xsh_resid_tab_get_order_data(), xsh_resid_tab_get_size(), xsh_resid_tab_get_slit_index(), xsh_resid_tab_get_thpre_x_data(), xsh_resid_tab_get_thpre_y_data(), xsh_resid_tab_get_xgauss_data(), xsh_resid_tab_get_ygauss_data(), xsh_resid_tab_load(), coord::y, xs_3::ydet, and xs_3::ypospix.
Referenced by xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_flexcor(), and xsh_predict().
double xsh_model_ref_ind_air | ( | double | temper, | |
double | lam_sqr | |||
) |
Return the refractive index of air at a given wavelength and temperature.
temper | the temperature (deg K) | |
lam_sqr | wavelength in micron, squared |
Definition at line 5041 of file xsh_model_kernel.c.
cpl_vector* xsh_model_refining_detect | ( | const cpl_vector * | in, | |
int | fwhm, | |||
double | sigma, | |||
int | display | |||
) |
Detect the brightest features in a spectrum.
in | the spectrum (cpl_vector) | |
fwhm | the FWHM used for the lines convolution in pixels (int) | |
sigma | No. of standard deviation for detection (double) | |
display | the flag to display (int) |
Definition at line 5060 of file xsh_model_kernel.c.
References check, and xsh_print_rec_status().
Referenced by xsh_cfg_recover_measure_line_xy(), and xsh_model_reduce().
double xsh_model_sellmeier_ext | ( | int | arm, | |
double | temper, | |||
double | lam_sqr | |||
) |
Get the refractive index for a given temperature and wavelength from the (hard coded) extended Sellmeier co-efficients for infrasil (NIR) and Silica (UVB).
arm | ram selector | |
temper | Temperature of Infrasil prism in K (double) | |
lam_sqr | Square of wavelength in um (double) |
Definition at line 4982 of file xsh_model_kernel.c.
Referenced by xsh_3_eval().
cpl_frame* xsh_model_spectralformat_create | ( | xsh_xs_3 * | p_xs_3, | |
const char * | tab_filename | |||
) |
creates the model spectral format table
p_xs_3 | pointer to physical model structure | |
tab_filename | name of spectral format table |
Definition at line 2867 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::ASIZE, xs_3::BSIZE, check, xs_3::chippix, xs_3::es_y, xs_3::es_y_tot, xs_3::grat_alpha, xs_3::grat_beta, M_PI, mm2nm, xs_3::morder_max, xs_3::morder_min, xs_3::nug, xs_3::sg, xs_3::SIZE, xs_3::t_ir_p2, xs_3::temper, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc2Darray(), XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, xsh_frame_product(), xsh_free2Darray(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_new(), xsh_instrument_set_arm(), xsh_msg, xsh_pfits_set_pcatg(), xsh_ref_ind_read(), XSH_SPECTRALFORMAT_DIST_ORDER, and xs_3::ypospix.
Referenced by main(), xsh_cfg_recover_measure_line_xy(), xsh_model_reduce(), and xsh_util_model_SPF_create().
cpl_frame* xsh_model_THE_create | ( | xsh_xs_3 * | p_xs_3, | |
xsh_instrument * | instr, | |||
const char * | line_list, | |||
int | num_ph, | |||
double | sep_ph, | |||
const char * | THE_filename | |||
) |
Compute the THE table (centroid for each feature in lamp spectrum).
p_xs_3 | Model configuration data structure | |
instr | The XSH arm | |
line_list | Calibration source line list file name | |
num_ph | Number of pinholes in mask (int) | |
sep_ph | Separation of pinholes (arcsec) or <0 to use values from the config file (double) | |
THE_filename | THE table filename |
The returned pointer must be deallocated with cpl_table_delete(returned_ptr);
Definition at line 3326 of file xsh_model_kernel.c.
References xs_3::arm, xs_3::blaze_pad, check, xs_3::chippix, xs_3::es_y, xs_3::es_y_tot, xs_3::morder_min, xs_3::nug, xs_3::sg, xs_3::slit, xs_3::slit_scale, xs_3::t_ir_p2, xs_3::temper, xs_3::xpospix, xsh_3_detpix(), xsh_3_eval(), xsh_3_init(), xsh_alloc2Darray(), XSH_ARCLIST_TABLE_COLNAME_FLUX, XSH_ARCLIST_TABLE_COLNAME_WAVELENGTH, XSH_ARM_NIR, XSH_ARM_UNDEFINED, XSH_ARM_UVB, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, xsh_frame_product(), xsh_free2Darray(), xsh_free_frame(), xsh_free_propertylist(), xsh_free_table(), xsh_instrument_get_arm(), xsh_msg, xsh_ref_ind_read(), XSH_THE_MAP_TABLE_COLNAME_DETECTORX, XSH_THE_MAP_TABLE_COLNAME_DETECTORY, XSH_THE_MAP_TABLE_COLNAME_ORDER, XSH_THE_MAP_TABLE_COLNAME_SLITINDEX, XSH_THE_MAP_TABLE_COLNAME_SLITPOSITION, XSH_THE_MAP_TABLE_COLNAME_WAVELENGTH, and xs_3::ypospix.
Referenced by xsh_cfg_recover_model_THE_create(), xsh_model_reduce(), and xsh_util_physmod_model_THE_create().
applies scalar product to vector
a | vector | |
k | scalar |
Definition at line 1633 of file xsh_model_kernel.c.
References vectordim.
multiply three matrixes A=B*C
A | matrix result | |
B | matrix factor | |
C | matrix factor |
Definition at line 1710 of file xsh_model_kernel.c.
References vectordim, and xsh_nullmatrix().
Referenced by xsh_3_init(), xsh_multiplythreematrix(), and xsh_rotin().
multiply three matrixes A=B*C*D
A | matrix result | |
B | matrix factor | |
C | matrix factor | |
D | matrix factor |
Definition at line 1729 of file xsh_model_kernel.c.
References xsh_multiplymatrix(), and xsh_nullmatrix().
void xsh_normall | ( | vec | a | ) |
normalize vector
a | vector |
Definition at line 1695 of file xsh_model_kernel.c.
Referenced by xsh_3_eval().
void xsh_normz | ( | vec | a | ) |
normalize vector
a | vector |
Definition at line 1656 of file xsh_model_kernel.c.
Referenced by xsh_3_eval(), and xsh_physmod_grating().
static void xsh_nullmatrix | ( | mat | A | ) | [static] |
Definition at line 94 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_multiplymatrix(), xsh_multiplythreematrix(), and xsh_rotationmatrix().
static void xsh_nullvector | ( | vec | a | ) | [static] |
Definition at line 121 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_matrixforvector().
void xsh_order_edge_list_fit | ( | xsh_order_list * | list, | |
int | size, | |||
double * | order, | |||
double * | posx, | |||
double * | posy, | |||
int | deg_poly, | |||
int | edge | |||
) |
Fit edge of an order.
[in] | list | structure containing order trace locations |
[in] | size | size of list |
[out] | order | order values |
[out] | posx | x edge position values |
[out] | posy | y edge position values |
deg_poly | degree of polynomial to be fit to edges | |
edge | parameter indicating edge to fit (up: -1, cen: 0, low=1) |
Definition at line 5827 of file xsh_model_kernel.c.
References xsh_order::absorder, xsh_order_list::absorder_max, xsh_order_list::absorder_min, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order_list::list, xsh_order::order, xsh_order_list::size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, xsh_msg, xsh_msg_dbg_low, xsh_polynomial_fit_1d_create(), and xsh_unwrap_vector().
Referenced by fit_order_edge_list().
Calculate the new vector after a given incident vector is reflected in a prism (i.e. exits from the same surface than it entered through).
in | incident vector | |
m | spectral order | |
sg | grating constant | |
in_rot | matrix describing the rotation in to the entrance surface | |
exit_rot | matrix describing the rotation out of the exit surface | |
out | output vector return alpha useful parameter for calculating blaze later... |
Definition at line 1881 of file xsh_model_kernel.c.
References xsh_matrixforvector(), and xsh_normz().
Load the refractive index coeffs for a given arm and temperature.
arm | Instrument arm | |
ref_ind_T | Refractive index coefficients | |
temper | Temperature in K |
Definition at line 1175 of file xsh_model_kernel.c.
References schott_sf6_manu, silica_zemax, and znse.
Referenced by xsh_model_anneal_reduce(), xsh_model_first_anneal(), xsh_model_get_xy(), xsh_model_locus(), xsh_model_maps_create(), xsh_model_order_edges_tab_create(), xsh_model_pipe_anneal(), xsh_model_reduce(), xsh_model_spectralformat_create(), and xsh_model_THE_create().
Load the refractive index array for a given arm and temperature. This old routine is only retained to allow easy testing of new refractive index data.
ref_ind_file | Filename for file conatining refractive index data | |
ref_ind | Refractive index coefficients | |
temper | Temperature in K |
Definition at line 1124 of file xsh_model_kernel.c.
Calculate the new vector after a given incident vector passes a boundary between two materials.
b | exit vector | |
rind | refractive index | |
a | incident vector |
Definition at line 1915 of file xsh_model_kernel.c.
Referenced by xsh_3_eval().
matrix rotation
A | matrix to be rotated | |
axis | axis around which rotation occurs | |
angle | rotation angle |
Definition at line 1807 of file xsh_model_kernel.c.
References xsh_nullmatrix().
Referenced by xsh_rotin().
matrix rotation
A | matrix to be rotated | |
x_angle | rotation angle around X axis | |
y_angle | rotation angle around Y axis | |
z_angle | rotation angle around Z axis |
Definition at line 1856 of file xsh_model_kernel.c.
References xsh_multiplymatrix(), and xsh_rotationmatrix().
Referenced by xsh_3_eval(), and xsh_3_init().
implements scalar product
a | vector1 | |
b | vector2 |
Definition at line 1620 of file xsh_model_kernel.c.
References vectordim.
void xsh_showmatrix | ( | mat | A | ) |
Show matrix.
A | matrix to be shown |
Definition at line 1741 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_model_anneal_reduce(), and xsh_model_first_anneal().
void xsh_showvector | ( | vec | a | ) |
show vector content
a | vector |
Definition at line 1643 of file xsh_model_kernel.c.
References vectordim.
subtract 2 vectors a-=b
a | vector1 | |
b | vector2 |
Definition at line 1608 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_3_eval().
matrix transposal
A | transposed matrix | |
B | matrix to be transposed |
Definition at line 1790 of file xsh_model_kernel.c.
References vectordim.
Referenced by xsh_3_init().