X-shooter Pipeline Reference Manual 3.8.15
xsh_detmon_utils.c File Reference
#include "xsh_detmon_utils.h"
#include "irplib_utils.h"
#include <cpl.h>
#include <assert.h>

Go to the source code of this file.

Functions

const char * xsh_detmon_get_license (void)
 Get the pipeline copyright and license.
 
static void expand_region (const cpl_image *ref, cpl_size *llx, cpl_size *lly, cpl_size *urx, cpl_size *ury)
 utility to convert negative region to full image
 
cpl_imagelist * xsh_detmon_load_frameset_window (const cpl_frameset *fset, cpl_type type, cpl_size pnum, cpl_size xtnum, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, cpl_size nx, cpl_size ny)
 load data in frameset into an imagelist
 
cpl_image * xsh_detmon_subtract_create_window (const cpl_image *a, const cpl_image *b, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 subtract window two images creating new image of window size
 
cpl_image * xsh_detmon_subtracted_avg (const cpl_image *on1, const cpl_image *off1, const cpl_image *on2, const cpl_image *off2, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 return absolute average of subtracted images
 

Function Documentation

◆ expand_region()

static void expand_region ( const cpl_image *  ref,
cpl_size *  llx,
cpl_size *  lly,
cpl_size *  urx,
cpl_size *  ury 
)
static

utility to convert negative region to full image

Parameters
refreference image, region set to image size
llxlower left X coordinate
llylower left Y coordinate
urxupper right X coordinate
uryupper right Y coordinate

Definition at line 95 of file xsh_detmon_utils.c.

References llx, lly, ref, urx, and ury.

Referenced by xsh_detmon_subtracted_avg().

◆ xsh_detmon_get_license()

const char * xsh_detmon_get_license ( void  )

Get the pipeline copyright and license.

Returns
The copyright and license string

The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.

Definition at line 59 of file xsh_detmon_utils.c.

◆ xsh_detmon_load_frameset_window()

cpl_imagelist * xsh_detmon_load_frameset_window ( const cpl_frameset *  fset,
cpl_type  type,
cpl_size  pnum,
cpl_size  xtnum,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
cpl_size  nx,
cpl_size  ny 
)

load data in frameset into an imagelist

Parameters
fsetframeset to load from
typetype to convert data to
pnumplane number in cube to load (0 for first)
xtnumextension in file to load (0 for first, -1 for all)
llxlower left x
llylower left y
urxupper right x
uryupper right y
nxoutput image size x
nyoutput image size y
Returns
imagelist of loaded images padded to nx/ny
Note
pads images with zeros to output image size unlike cpl_imagelist_frameset_load no support for loading multiple planes

Definition at line 134 of file xsh_detmon_utils.c.

References llx, lly, n, nx, ny, urx, and ury.

Referenced by irplib_load_fset_wrp(), and xsh_detmon_lg_lamp_stab().

◆ xsh_detmon_subtract_create_window()

cpl_image * xsh_detmon_subtract_create_window ( const cpl_image *  a,
const cpl_image *  b,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

subtract window two images creating new image of window size

Parameters
aimage
bimage
llxlower left X coordinate
llylower left Y coordinate
urxupper right X coordinate
uryupper right Y coordinate
Returns
image of window size

Definition at line 210 of file xsh_detmon_utils.c.

References llx, lly, urx, and ury.

Referenced by xsh_detmon_gain_prepare_table(), and xsh_detmon_gain_table_fill_row().

◆ xsh_detmon_subtracted_avg()

cpl_image * xsh_detmon_subtracted_avg ( const cpl_image *  on1,
const cpl_image *  off1,
const cpl_image *  on2,
const cpl_image *  off2,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

return absolute average of subtracted images

Parameters
on1first on image
off1first off image
on2second on image
off2second off image
off2second off image
llxlower left X coordinate
llylower left Y coordinate
urxupper right X coordinate
uryupper right Y coordinate
Returns
abs(avg((on1 - off1), (on2 - off2)))

Definition at line 243 of file xsh_detmon_utils.c.

References expand_region(), llx, lly, urx, and ury.

Referenced by xsh_detmon_lin_table_fill_row(), and xsh_detmon_opt_contamination().