X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions | Variables
Tests Tools

Macros

#define NB_LAMBDA   100
 
#define FIRST_LAMBDA   500.0
 
#define LAST_LAMBDA   510.0
 
#define NB_SLIT   40
 
#define FIRST_SLIT   -5
 
#define LAST_SLIT   5
 
#define POS_PLUS   30
 
#define COEFF0_PLUS   30.
 
#define COEFF1_PLUS   0.03
 
#define POS_CENTER   30
 
#define POS_MINUS   5
 
#define COEFF0_MINUS   10.
 
#define COEFF1_MINUS   0.03
 
#define WIDTH   5
 
#define HALF_WIDTH   2
 

Functions

static int xsh_poisson_random (double expectedValue)
 generates random data with Poisson distribution
 
cpl_image * xsh_test_create_bias_image (const char *name, int nx, int ny, xsh_instrument *instrument)
 
cpl_frame * xsh_test_create_frame (const char *name, int nx, int ny, const char *tag, cpl_frame_group group, xsh_instrument *instrument)
 
void tests_set_defaults (cpl_parameterlist *parlist)
 Set unset parameters to default value.
 
cpl_propertylist * mkHeader (XSH_INSTRCONFIG *iconfig, int nx, int ny, double exptime)
 
void setHeader (cpl_propertylist *header, XSH_INSTRCONFIG *iconfig, int nx, int ny, double exptime)
 
cpl_image * create_order_image (xsh_order_list *list, int nx, int ny)
 
xsh_order_listcreate_order_list (int norder, xsh_instrument *instrument)
 
void add_to_order_list (xsh_order_list *list, int order, int absorder, cpl_polynomial *poly, int xdelta, int starty, int endy)
 
cpl_frame * create_rectify_nod_list (int sign, const char *fname, xsh_instrument *instr)
 
cpl_frameset * sof_to_frameset (const char *sof_name)
 
xsh_instrumentcreate_instrument (const char *filename)
 

Variables

static float Flux [WIDTH]
 
static cpl_polynomial * poly_plus = NULL
 
static cpl_polynomial * poly_minus = NULL
 

Detailed Description

Module including several functions used by various test programs.

Macro Definition Documentation

◆ COEFF0_MINUS

#define COEFF0_MINUS   10.

Definition at line 470 of file tests.c.

◆ COEFF0_PLUS

#define COEFF0_PLUS   30.

Definition at line 466 of file tests.c.

◆ COEFF1_MINUS

#define COEFF1_MINUS   0.03

Definition at line 471 of file tests.c.

◆ COEFF1_PLUS

#define COEFF1_PLUS   0.03

Definition at line 467 of file tests.c.

◆ FIRST_LAMBDA

#define FIRST_LAMBDA   500.0

Definition at line 458 of file tests.c.

◆ FIRST_SLIT

#define FIRST_SLIT   -5

Definition at line 462 of file tests.c.

◆ HALF_WIDTH

#define HALF_WIDTH   2

Definition at line 474 of file tests.c.

◆ LAST_LAMBDA

#define LAST_LAMBDA   510.0

Definition at line 459 of file tests.c.

◆ LAST_SLIT

#define LAST_SLIT   5

Definition at line 463 of file tests.c.

◆ NB_LAMBDA

#define NB_LAMBDA   100

Definition at line 457 of file tests.c.

◆ NB_SLIT

#define NB_SLIT   40

Definition at line 461 of file tests.c.

◆ POS_CENTER

#define POS_CENTER   30

Definition at line 468 of file tests.c.

◆ POS_MINUS

#define POS_MINUS   5

Definition at line 469 of file tests.c.

◆ POS_PLUS

#define POS_PLUS   30

Definition at line 465 of file tests.c.

◆ WIDTH

#define WIDTH   5

Definition at line 473 of file tests.c.

Function Documentation

◆ add_to_order_list()

void add_to_order_list ( xsh_order_list list,
int  order,
int  absorder,
cpl_polynomial *  poly,
int  xdelta,
int  starty,
int  endy 
)

◆ create_instrument()

xsh_instrument * create_instrument ( const char *  filename)

◆ create_order_image()

cpl_image * create_order_image ( xsh_order_list list,
int  nx,
int  ny 
)

◆ create_order_list()

xsh_order_list * create_order_list ( int  norder,
xsh_instrument instrument 
)

◆ create_rectify_nod_list()

cpl_frame * create_rectify_nod_list ( int  sign,
const char *  fname,
xsh_instrument instr 
)

◆ mkHeader()

cpl_propertylist * mkHeader ( XSH_INSTRCONFIG iconfig,
int  nx,
int  ny,
double  exptime 
)

Create a header and Set the Basic Keywords of xsh images according to the instrument configuration. Some parameters of the instrument are overrriden (nx, ny, exptime).

Parameters
iconfigStructure describing the instrument configuration
nxNb of pixels in X (overrides the default configuration)
nyNb of pixels in Y (overrides the default configuration)
exptimeExposure time
Returns
Pointer to the created propertylist

Definition at line 221 of file tests.c.

References check_msg, XSH_INSTRCONFIG::conad, exptime, nx, ny, XSH_INSTRCONFIG::ovscx, XSH_INSTRCONFIG::ovscy, XSH_INSTRCONFIG::prscx, XSH_INSTRCONFIG::prscy, XSH_INSTRCONFIG::ron, XSH_CONAD, XSH_CRPIX1, XSH_CRPIX2, XSH_CRVAL1, XSH_CRVAL2, XSH_DET_GAIN, XSH_DPR_CATG, XSH_DPR_TYPE, XSH_EXPTIME, XSH_OUT_NX, XSH_OUT_NY, XSH_OVSCX, XSH_OVSCY, XSH_PRSCX, XSH_PRSCY, XSH_PSZX, XSH_PSZY, XSH_RON, XSH_WIN_BINX, and XSH_WIN_BINY.

Referenced by createFakeFrames(), and main().

◆ setHeader()

void setHeader ( cpl_propertylist *  header,
XSH_INSTRCONFIG iconfig,
int  nx,
int  ny,
double  exptime 
)

Set the Basic Keywords of xsh images according to the instrument configuration. Some parameters of the instrument are overrriden (nx, ny, exptime).

Parameters
headerthe property list to update
iconfigStructure describing the instrument configuration
nxNb of pixels in X (overrides the default configuration)
nyNb of pixels in Y (overrides the default configuration)
exptimeExposure time

Definition at line 288 of file tests.c.

References XSH_INSTRCONFIG::bitpix, check_msg, XSH_INSTRCONFIG::conad, exptime, nx, ny, XSH_INSTRCONFIG::ovscx, XSH_INSTRCONFIG::ovscy, XSH_INSTRCONFIG::prscx, XSH_INSTRCONFIG::prscy, XSH_INSTRCONFIG::pxspace, XSH_INSTRCONFIG::ron, XSH_ASSURE_NOT_NULL, XSH_CHIP_NX, XSH_CHIP_NY, XSH_CONAD, XSH_DET_GAIN, XSH_DET_PXSPACE, XSH_DPR_CATG, XSH_DPR_TYPE, XSH_EXPTIME, XSH_OUT_NX, XSH_OUT_NY, XSH_OVSCX, XSH_OVSCY, XSH_PRSCX, XSH_PRSCY, XSH_PSZX, XSH_PSZY, XSH_RON, XSH_WIN_BINX, and XSH_WIN_BINY.

Referenced by create_frame(), xsh_test_create_bias_image(), and xsh_test_create_frame().

◆ sof_to_frameset()

cpl_frameset * sof_to_frameset ( const char *  sof_name)

Definition at line 576 of file tests.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_frameset(), and xsh_msg.

Referenced by main().

◆ tests_set_defaults()

void tests_set_defaults ( cpl_parameterlist *  parlist)

Set unset parameters to default value.

Parameters
parlistA parameter list
Returns
0 iff success

The function initializes the provided parameter list by setting the current parameter values to the default parameter values.

Definition at line 173 of file tests.c.

References assure.

◆ xsh_poisson_random()

static int xsh_poisson_random ( double  expectedValue)
static

generates random data with Poisson distribution

AMO added (useful in unit tests)

Parameters
expectedValuerandom generator goal value
Returns
random value

Definition at line 72 of file tests.c.

References n, and x.

Referenced by xsh_test_create_frame().

◆ xsh_test_create_bias_image()

cpl_image * xsh_test_create_bias_image ( const char *  name,
int  nx,
int  ny,
xsh_instrument instrument 
)

◆ xsh_test_create_frame()

cpl_frame * xsh_test_create_frame ( const char *  name,
int  nx,
int  ny,
const char *  tag,
cpl_frame_group  group,
xsh_instrument instrument 
)

Variable Documentation

◆ Flux

float Flux[WIDTH]
static
Initial value:
= {
20., 40., 100., 40., 20. }

Definition at line 476 of file tests.c.

Referenced by create_rectify_nod_list().

◆ poly_minus

cpl_polynomial * poly_minus = NULL
static

Definition at line 479 of file tests.c.

Referenced by create_rectify_nod_list().

◆ poly_plus

cpl_polynomial* poly_plus = NULL
static

Definition at line 479 of file tests.c.

Referenced by create_rectify_nod_list().