ERIS Pipeline Reference Manual 1.8.10
Modules | Functions
IFU Miscellaneous Utilities

Modules

 IFU Error Macros
 

Functions

cpl_vector * eris_ifu_idl_where (const cpl_vector *data, double val, int op)
 Implements the where-function knownm from IDL.
 
cpl_vector * eris_ifu_idl_values_at_indices (const cpl_vector *data, const cpl_vector *indices)
 Returns a vector of given indices.
 
cpl_error_code eris_ifu_cut_endings (cpl_vector **vec, int *begin, int *end, int cut)
 Cut leading and trailing -1 of a vector.
 
hdrl_imagelist * eris_ifu_get_hdrlimagelist_by_tag (cpl_frameset *frameset, const char *tag, int exposureCorrectionMode)
 Return HDRL imagelist by searching tagged frames in frameset.
 
cpl_frameset * eris_ifu_get_frameset_by_tag (const cpl_frameset *frameset, const char *tag)
 Get frames with given tag from frameset.
 
cpl_error_code eris_ifu_parameterlist_append_list (cpl_parameterlist *p1, const cpl_parameterlist *p2)
 Append a parameterlist to another one.
 
void eris_ifu_free_hdrl_image (hdrl_image **item)
 free memory and set pointer to null
 
void eris_ifu_free_hdrl_imagelist (hdrl_imagelist **item)
 free memory and set pointer to null
 
void eris_ifu_free_image (cpl_image **item)
 free memory and set pointer to null
 
void eris_ifu_free_imagelist (cpl_imagelist **item)
 free memory and set pointer to null
 
void eris_ifu_free_mask (cpl_mask **item)
 free memory and set pointer to null
 
void eris_ifu_free_matrix (cpl_matrix **item)
 free memory and set pointer to null
 
void eris_ifu_free_propertylist (cpl_propertylist **item)
 free memory and set pointer to null
 
void eris_ifu_free_vector (cpl_vector **item)
 free memory and set pointer to null
 
void eris_ifu_free_ifu_vector (eris_ifu_vector **item)
 free memory and set pointer to null
 
void eris_ifu_free_string (char **item)
 free memory and set pointer to null
 
void eris_ifu_free_frameset (cpl_frameset **item)
 free memory and set pointer to null
 
void eris_ifu_free_frame (cpl_frame **item)
 free memory and set pointer to null
 
void eris_ifu_free_hdrl_parameter (hdrl_parameter **item)
 free memory and set pointer to null
 
void eris_ifu_free_parameter (cpl_parameter **item)
 free memory and set pointer to null
 
void eris_ifu_free_parameterlist (cpl_parameterlist **item)
 free memory and set pointer to null
 
void eris_ifu_free_table (cpl_table **item)
 free memory and set pointer to null
 
void eris_ifu_free_double_array (double **item)
 free memory and set pointer to null
 
void eris_ifu_free_float_array (float **item)
 free memory and set pointer to null
 
void eris_ifu_free_int_array (int **item)
 free memory and set pointer to null
 
void eris_ifu_free_polynomial (cpl_polynomial **item)
 free memory and set pointer to null
 
void eris_ifu_free_bivector (cpl_bivector **item)
 free memory and set pointer to null
 
void eris_ifu_free_apertures (cpl_apertures **item)
 free memory and set pointer to null
 
cpl_error_code eris_ifu_save_image (cpl_frameset *fs, const cpl_propertylist *plist, const cpl_parameterlist *parlist, const char *recipe, const char *procatg, const char *filename, cpl_type type, const cpl_image *image)
 save image
 
cpl_error_code eris_ifu_save_imagelist (cpl_frameset *fs, cpl_frame *inherit, const cpl_propertylist *plist, const cpl_parameterlist *parlist, const char *recipe, const char *procatg, const char *filename, cpl_type type, const cpl_imagelist *imglist)
 save imagelist
 
cpl_error_code eris_ifu_hdrl_image_reject_mask (hdrl_image *img, const cpl_mask *mask)
 'Add' the mask to the image
 
cpl_error_code eris_ifu_save_vector_dbg (const cpl_vector *vec, const char *filename, int create, const cpl_propertylist *pl)
 save vector
 
cpl_error_code eris_ifu_save_ifu_vector_dbg (const eris_ifu_vector *vec, const char *filename, int create)
 save vector
 
cpl_error_code eris_ifu_save_bivector_dbg (const cpl_bivector *bivec, const char *filename, int col, int create)
 save bivector as a vector (col=1 or col=2) or as a table
 
cpl_error_code eris_ifu_save_image_dbg (const cpl_image *img, const char *filename, int create, const cpl_propertylist *pl)
 eris_ifu_save_image_dbg
 
cpl_error_code eris_ifu_save_table_dbg (const cpl_table *tbl, const char *filename, int create)
 eris_ifu_save_table_dbg
 
cpl_error_code eris_ifu_save_mask_dbg (const cpl_mask *mask, const char *filename, int create, const cpl_propertylist *pl)
 eris_ifu_save_mask_dbg
 
cpl_error_code eris_ifu_save_imagelist_dbg (const cpl_imagelist *imglist, const char *filename, int create)
 save CPL imagelist for debug purposes
 
cpl_error_code eris_ifu_save_cpl_image_dbg (const cpl_image *img, const char *name, int singlefile, const cpl_propertylist *pl)
 save CPL image for debug purposes
 
cpl_error_code eris_ifu_save_cpl_imagelist_dbg (const cpl_imagelist *imglist, const char *name)
 save CPL imagelist for debugging purposes
 
cpl_error_code eris_ifu_save_hdrl_image_dbg (const hdrl_image *hdrl_img, const char *filename, int singlefile, const cpl_propertylist *pl)
 save HDRL imagelist for debugging purposes
 
cpl_error_code eris_ifu_save_hdrl_imagelist_dbg (const hdrl_imagelist *hdrl_img_list, const char *filename, int singlefile)
 eris_ifu_save_hdrl_imagelist_dbg
 
cpl_mask * eris_ifu_load_badpixel_mask (const cpl_frameset *frameset, const char *category, int ext)
 ‍**
 

eris_ifu_file_exists

‍**

Parameters
filenameName of the file to look up.
Returns
true file exists, false otherwise
cpl_error_code eris_ifu_file_exists (const char *filename)
 
cpl_imagelist * eris_ifu_hdrl_get_imagelist (const hdrl_imagelist *hdrl_imglist, enum hdrl_t type)
 Extract from a HDRL-imglist a specific CPL-imglist.
 
char * eris_ifu_get_lampString (int lampStatus)
 eris_ifu_get_lampString
 
const char * eris_ifu_get_bandString (ifsBand band)
 eris_ifu_get_bandString
 
double eris_ifu_get_band_resolution (ifsBand band)
 eris_ifu_get_band_resolution
 
cpl_error_code eris_ifu_get_plane_cut_min_max (ifsBand band, cpl_size *zmin, cpl_size *zmax)
 eris_ifu_get_plane_cut_min_max
 
cpl_error_code eris_ifu_cube_set_values (hdrl_imagelist **iml)
 remove planes from input iml and bpm in the range [0, zmin), (zmax,sz]
 
cpl_error_code eris_ifu_cube_trim_nans (const cpl_size zmin, const cpl_size zmax, hdrl_imagelist **iml, cpl_imagelist **bpm, cpl_propertylist *header)
 remove planes from input iml and bpm in the range [0, zmin), (zmax,sz]
 
const char * eris_ifu_get_instrumentString (ifsInstrument instrument)
 eris_ifu_get_instrumentString
 
const char * eris_ifu_get_preopticsScaleString (ifsPreopticsScale scale)
 eris_ifu_get_preopticsScaleString
 
cpl_image * eris_ifu_image_create_window (const cpl_image *img)
 
cpl_mask * eris_ifu_mask_create_border (const cpl_mask *mask)
 eris_ifu_mask_create_border
 
cpl_error_code eris_ifu_mask_nans_in_hdrlimage (hdrl_image **hima)
 Flag NANs in image.
 
cpl_error_code eris_ifu_mask_nans_in_cube (cpl_imagelist *cube)
 mask NANs in input data cube
 
cpl_mask * eris_ifu_quality2bp_mask (const cpl_image *qualityMask, deqQualityType qualityType)
 transform input image (quality mask) to output mask with given bit code
 
cpl_imagelist * eris_ifu_interpolatedMask_to_maskZero (cpl_imagelist *bpmCube, double threshold)
 return cube flagging (as 1) pixels above a given threshold
 
cpl_error_code eris_ifu_split_hdrl_imagelist (hdrl_imagelist *cube, cpl_imagelist *dataCube, cpl_imagelist *errorCube)
 extract from hdrl_imagelist the data and error information
 
cpl_error_code eris_ifu_split3_hdrl_imagelist (hdrl_imagelist *cube, cpl_imagelist *dataCube, cpl_imagelist *errorCube, cpl_imagelist *qualCube)
 extract from hdrl_imagelist the data and error information
 
cpl_table * eris_qclog_init (void)
 Initialize QC table.
 
cpl_error_code eris_qclog_add_int (cpl_table *table, const char *key_name, const int value, const char *key_help)
 add QC int info to table
 
cpl_error_code eris_qclog_add_bool (cpl_table *table, const char *key_name, const char *key_help)
 add QC boolean info to table
 
cpl_error_code eris_qclog_add_double (cpl_table *table, const char *key_name, const double value, const char *key_help)
 add QC double info to table
 
cpl_error_code eris_qclog_add_double_f (cpl_table *table, const char *key_name, const double value, const char *key_help)
 add QC float info to table
 
cpl_error_code eris_qclog_add_double_format (cpl_table *table, const char *key_name, const double value, const char *key_help)
 add QC double (with format) info to table
 
cpl_error_code eris_qclog_add_string (cpl_table *table, const char *key_name, const char *value, const char *key_help)
 add QC string info to table
 
cpl_error_code eris_pfits_put_qc (cpl_propertylist *plist, cpl_table *qclog)
 convert table with QC parameter information to a propertylist
 
cpl_error_code eris_ifu_get_badpix_qc_from_ima (const cpl_image *image, cpl_propertylist *qc_list, const char *prefix)
 compute QC keyword with number of bad pixels and fraction to total
 
cpl_error_code eris_ifu_get_badpix_qc_from_mask (const cpl_mask *bp_mask, cpl_propertylist *qc_list, const char *prefix)
 compute QC keyword with number of bad pixels and fraction to total
 
cpl_error_code eris_gaussian_maxpos (const cpl_image *self, double sigma, double *pxpos, double *pypos, double *ppeak, double *sigma_x, double *sigma_y)
 
cpl_propertylist * eris_compute_psf_qc (hdrl_image *hima, const cpl_parameterlist *parlist, const char *context)
 compute QC parameters on a PSF STD image
 
cpl_mask * eris_ifu_hima_get_obj_mask_percent (hdrl_image *hima, const double percent)
 find mask flagging pixels above percent(%) pixels with lower intensity
 
cpl_mask * eris_ifu_hima_get_obj_mask (hdrl_image *hima, const cpl_size niter, const double kappa)
 find mask flagging pixels above a threshold set by ks-clip algorithm
 
cpl_error_code eris_get_pupil_shift (hdrl_imagelist *iml, const int n, cpl_table **qclog_tbl)
 Get what object shift.
 
cpl_mask * eris_ifu_mask_from_image (const cpl_image *img_mask)
 eris_ifu_mask_from_image
 

Detailed Description

Function Documentation

◆ eris_compute_psf_qc()

cpl_propertylist * eris_compute_psf_qc ( hdrl_image *  hima,
const cpl_parameterlist *  parlist,
const char *  context 
)

compute QC parameters on a PSF STD image

Parameters
himainput image
parlistinput parameters
contextparameter context (prefix+recipe name)
Returns
propertylist with computed QC parameters

Definition at line 2941 of file eris_ifu_utils.c.

References eris_check_error_code(), eris_ifu_is_nan_or_inf(), eris_parameters_get_double(), eris_pfits_put_qc(), eris_qclog_add_double(), eris_qclog_add_double_f(), eris_qclog_add_int(), eris_qclog_init(), hdrl_image_get_image(), hdrl_image_get_size_x(), and hdrl_image_get_size_y().

◆ eris_get_pupil_shift()

cpl_error_code eris_get_pupil_shift ( hdrl_imagelist *  iml,
const int  n,
cpl_table **  qclog_tbl 
)

Get what object shift.

Parameters
imlimagelist
nimagelist sequence
qclog_tblqclog table
Returns
0 if standard 0 if pixel scale changes in input Strehl data

Definition at line 3270 of file eris_ifu_utils.c.

References eris_check_error_code(), eris_qclog_add_double_f(), hdrl_image_delete(), hdrl_image_get_image(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), and hdrl_imagelist_collapse_median().

◆ eris_ifu_cube_set_values()

cpl_error_code eris_ifu_cube_set_values ( hdrl_imagelist **  iml)

remove planes from input iml and bpm in the range [0, zmin), (zmax,sz]

Parameters
zminplanes in range [0,zmin] are removed
zmaxplanes in range [zmax,sz] are removed
imlinput imagelist
bpminput bad pixel map
headerinput FITS header
Returns
cpl_error_code

Definition at line 1662 of file eris_ifu_utils.c.

References eris_check_error_code(), hdrl_image_set_pixel(), hdrl_imagelist_get(), and hdrl_imagelist_get_size().

◆ eris_ifu_cube_trim_nans()

cpl_error_code eris_ifu_cube_trim_nans ( const cpl_size  zmin,
const cpl_size  zmax,
hdrl_imagelist **  iml,
cpl_imagelist **  bpm,
cpl_propertylist *  header 
)

remove planes from input iml and bpm in the range [0, zmin), (zmax,sz]

Parameters
zminplanes in range [0,zmin] are removed
zmaxplanes in range [zmax,sz] are removed
imlinput imagelist
bpminput bad pixel map
headerinput FITS header
Returns
cpl_error_code

Definition at line 1698 of file eris_ifu_utils.c.

References eris_check_error_code(), hdrl_imagelist_get_size(), and hdrl_imagelist_unset().

◆ eris_ifu_cut_endings()

cpl_error_code eris_ifu_cut_endings ( cpl_vector **  vec,
int *  begin,
int *  end,
int  cut 
)

Cut leading and trailing -1 of a vector.

Parameters
vec(Input) Vector to trim. (Output) Trimmed vector, if cut is TRUE.
beginNULL or variable to hold determined beginning position (zero based). Set to zero in case of error.
endNULL or variable to hold determined ending position (zero based). Set to zero in case of error.
cutTRUE if vec should be trimmed, FALSE if just the start and end positions should be determined. Setting begin and end to NULL and cut to FALSE is senseless.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

This function only cuts -1. Other negative numbers are classified as ok.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if vec is NULL.

Definition at line 233 of file eris_ifu_utils.c.

References CATCH, eris_check_error_code(), eris_ifu_free_vector(), and TRY.

Referenced by eris_ifu_idl_where().

◆ eris_ifu_free_apertures()

void eris_ifu_free_apertures ( cpl_apertures **  item)

free memory and set pointer to null

Parameters
item

Definition at line 685 of file eris_ifu_utils.c.

◆ eris_ifu_free_bivector()

void eris_ifu_free_bivector ( cpl_bivector **  item)

free memory and set pointer to null

Parameters
item

Definition at line 675 of file eris_ifu_utils.c.

◆ eris_ifu_free_double_array()

void eris_ifu_free_double_array ( double **  item)

free memory and set pointer to null

Parameters
item

Definition at line 635 of file eris_ifu_utils.c.

Referenced by eris_ifu_1d_interpolation().

◆ eris_ifu_free_float_array()

void eris_ifu_free_float_array ( float **  item)

free memory and set pointer to null

Parameters
item

Definition at line 645 of file eris_ifu_utils.c.

◆ eris_ifu_free_frame()

void eris_ifu_free_frame ( cpl_frame **  item)

free memory and set pointer to null

Parameters
item

Definition at line 584 of file eris_ifu_utils.c.

◆ eris_ifu_free_frameset()

void eris_ifu_free_frameset ( cpl_frameset **  item)

free memory and set pointer to null

Parameters
item

Definition at line 574 of file eris_ifu_utils.c.

Referenced by eris_ifu_get_hdrlimagelist_by_tag().

◆ eris_ifu_free_hdrl_image()

void eris_ifu_free_hdrl_image ( hdrl_image **  item)

free memory and set pointer to null

Parameters
item
Returns
void

Definition at line 474 of file eris_ifu_utils.c.

References hdrl_image_delete().

Referenced by eris_ifu_load_exposure_file(), and eris_ifu_warp_polynomial_image().

◆ eris_ifu_free_hdrl_imagelist()

void eris_ifu_free_hdrl_imagelist ( hdrl_imagelist **  item)

free memory and set pointer to null

Parameters
item

Definition at line 484 of file eris_ifu_utils.c.

References hdrl_imagelist_delete().

Referenced by eris_ifu_get_hdrlimagelist_by_tag().

◆ eris_ifu_free_hdrl_parameter()

void eris_ifu_free_hdrl_parameter ( hdrl_parameter **  item)

free memory and set pointer to null

Parameters
item

Definition at line 594 of file eris_ifu_utils.c.

References hdrl_parameter_delete().

Referenced by eris_ifu_calc_bpm().

◆ eris_ifu_free_ifu_vector()

void eris_ifu_free_ifu_vector ( eris_ifu_vector **  item)

free memory and set pointer to null

Parameters
item

Definition at line 554 of file eris_ifu_utils.c.

References eris_ifu_vector_delete().

◆ eris_ifu_free_image()

void eris_ifu_free_image ( cpl_image **  item)

◆ eris_ifu_free_imagelist()

void eris_ifu_free_imagelist ( cpl_imagelist **  item)

free memory and set pointer to null

Parameters
item

Definition at line 504 of file eris_ifu_utils.c.

Referenced by eris_ifu_calc_bpm(), eris_ifu_hdrl_get_imagelist(), and eris_ifu_save_hdrl_imagelist_dbg().

◆ eris_ifu_free_int_array()

void eris_ifu_free_int_array ( int **  item)

free memory and set pointer to null

Parameters
item

Definition at line 655 of file eris_ifu_utils.c.

Referenced by eris_ifu_lcorr_get_peak_lambdas().

◆ eris_ifu_free_mask()

void eris_ifu_free_mask ( cpl_mask **  item)

free memory and set pointer to null

Parameters
item

Definition at line 514 of file eris_ifu_utils.c.

Referenced by eris_ifu_calc_bpm(), eris_ifu_detect_crh(), eris_ifu_load_badpixel_mask(), eris_ifu_mask_create_border(), and eris_ifu_mask_from_image().

◆ eris_ifu_free_matrix()

void eris_ifu_free_matrix ( cpl_matrix **  item)

free memory and set pointer to null

Parameters
item

Definition at line 524 of file eris_ifu_utils.c.

◆ eris_ifu_free_parameter()

void eris_ifu_free_parameter ( cpl_parameter **  item)

free memory and set pointer to null

Parameters
item

Definition at line 604 of file eris_ifu_utils.c.

◆ eris_ifu_free_parameterlist()

void eris_ifu_free_parameterlist ( cpl_parameterlist **  item)

free memory and set pointer to null

Parameters
item

Definition at line 615 of file eris_ifu_utils.c.

◆ eris_ifu_free_polynomial()

void eris_ifu_free_polynomial ( cpl_polynomial **  item)

free memory and set pointer to null

Parameters
item

Definition at line 665 of file eris_ifu_utils.c.

◆ eris_ifu_free_propertylist()

void eris_ifu_free_propertylist ( cpl_propertylist **  item)

◆ eris_ifu_free_string()

void eris_ifu_free_string ( char **  item)

◆ eris_ifu_free_table()

void eris_ifu_free_table ( cpl_table **  item)

free memory and set pointer to null

Parameters
item

Definition at line 625 of file eris_ifu_utils.c.

Referenced by eris_ifu_load_distances(), eris_ifu_load_distortion_polynomials(), eris_ifu_load_distortion_polynomials_old(), and eris_ifu_load_slit_positions().

◆ eris_ifu_free_vector()

void eris_ifu_free_vector ( cpl_vector **  item)

◆ eris_ifu_get_badpix_qc_from_ima()

cpl_error_code eris_ifu_get_badpix_qc_from_ima ( const cpl_image *  image,
cpl_propertylist *  qc_list,
const char *  prefix 
)

compute QC keyword with number of bad pixels and fraction to total

Parameters
imageinput image (a bad pixel map, intensity [0,1]
qc_listoutput property list to add QC keywords
prefixprefix of QC keyword
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2628 of file eris_ifu_utils.c.

References eris_check_error_code(), eris_ifu_append_qc_double(), and eris_ifu_append_qc_int().

◆ eris_ifu_get_badpix_qc_from_mask()

cpl_error_code eris_ifu_get_badpix_qc_from_mask ( const cpl_mask *  bp_mask,
cpl_propertylist *  qc_list,
const char *  prefix 
)

compute QC keyword with number of bad pixels and fraction to total

Parameters
bp_maskinput bad pixel mask
qc_listoutput property list to add QC keywords
prefixprefix of QC keyword
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2673 of file eris_ifu_utils.c.

References eris_check_error_code(), eris_ifu_append_qc_double(), and eris_ifu_append_qc_int().

◆ eris_ifu_get_band_resolution()

double eris_ifu_get_band_resolution ( ifsBand  band)

eris_ifu_get_band_resolution

Parameters
band
Returns
Returns the nominal resolution corresponding to a given band

Definition at line 1581 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_ifu_lcorr_crosscorrelate_spectra().

◆ eris_ifu_get_bandString()

const char * eris_ifu_get_bandString ( ifsBand  band)

eris_ifu_get_bandString

Parameters
band
Returns
Returns the band-setting as string

Definition at line 1514 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_ifu_get_frameset_by_tag()

cpl_frameset * eris_ifu_get_frameset_by_tag ( const cpl_frameset *  frameset,
const char *  tag 
)

Get frames with given tag from frameset.

Parameters
framesetframe set
tagto search for
Returns
newly allocated, possibly empty, frameset, or NULL on error

Definition at line 391 of file eris_ifu_utils.c.

References BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), and TRY.

Referenced by eris_ifu_get_hdrlimagelist_by_tag().

◆ eris_ifu_get_hdrlimagelist_by_tag()

hdrl_imagelist * eris_ifu_get_hdrlimagelist_by_tag ( cpl_frameset *  frameset,
const char *  tag,
int  exposureCorrectionMode 
)

Return HDRL imagelist by searching tagged frames in frameset.

Parameters
framesetThe input frameset (of the recipe)
tagThe tag name of the frames to be selected
exposureCorrectionModedata correction to be applied
Returns
a pointer to the HDRL imagelist or NULL in case of an error

The function returns an HDRL imagelist (and, if requested, a CPL imagelist) by searching an input frameset for frames with the proper tag name. If no frames with the tag are found a NULL pointer will be returned. No error images in the HDRL imagelist will be created.

Definition at line 330 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_frameset(), eris_ifu_free_hdrl_imagelist(), eris_ifu_get_frameset_by_tag(), eris_ifu_load_exposure_file(), hdrl_imagelist_get_size(), hdrl_imagelist_new(), hdrl_imagelist_set(), and TRY.

◆ eris_ifu_get_instrumentString()

const char * eris_ifu_get_instrumentString ( ifsInstrument  instrument)

eris_ifu_get_instrumentString

Parameters
instrument
Returns
Returns the instrument-setting as string

Definition at line 1742 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_ifu_get_lampString()

char * eris_ifu_get_lampString ( int  lampStatus)

eris_ifu_get_lampString

Parameters
lampStatus
Returns
Returns a string indicating the lamps switched ON

Definition at line 1491 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_ifu_get_plane_cut_min_max()

cpl_error_code eris_ifu_get_plane_cut_min_max ( ifsBand  band,
cpl_size *  zmin,
cpl_size *  zmax 
)

eris_ifu_get_plane_cut_min_max

Parameters
band
zminoutput plane that still has more than half pixels with NANs
zmaxoutput plane that still has more than half pixels with NANs
Returns
Returns the min/max values corresponding to NAN for a given band

Definition at line 1617 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_ifu_get_preopticsScaleString()

const char * eris_ifu_get_preopticsScaleString ( ifsPreopticsScale  scale)

eris_ifu_get_preopticsScaleString

Parameters
scale
Returns
Returns the scale-setting as string

Definition at line 1762 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_ifu_hdrl_get_imagelist()

cpl_imagelist * eris_ifu_hdrl_get_imagelist ( const hdrl_imagelist *  hdrl_imglist,
enum hdrl_t  type 
)

Extract from a HDRL-imglist a specific CPL-imglist.

Parameters
hdrl_imglistThe input hdrl_imglist
typeEither data, error or badpix
Returns
The desired cpl_imagelist

Definition at line 1442 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_image(), eris_ifu_free_imagelist(), hdrl_image_get_error_const(), hdrl_image_get_image_const(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), and TRY.

Referenced by eris_ifu_save_hdrl_imagelist_dbg().

◆ eris_ifu_hdrl_image_reject_mask()

cpl_error_code eris_ifu_hdrl_image_reject_mask ( hdrl_image *  img,
const cpl_mask *  mask 
)

'Add' the mask to the image

Parameters
imgImage to alter
maskMask to add
Returns
CPL error code

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT The CPL image is a NULL pointer
  • CPL_TYPE_INVALID The image has less two times the border size columns

Definition at line 824 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), hdrl_image_get_mask(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), and TRY.

◆ eris_ifu_hima_get_obj_mask()

cpl_mask * eris_ifu_hima_get_obj_mask ( hdrl_image *  hima,
const cpl_size  niter,
const double  kappa 
)

find mask flagging pixels above a threshold set by ks-clip algorithm

Parameters
himainput hdrl image
niternumber of kapa-sigma iterations
kappakappa used in kappa-sigma clip of (object) data
Returns
cpl_mask* mask flagging points where objects have been found
Note
niter must be such that: 1 <= niter <= 100

Definition at line 3215 of file eris_ifu_utils.c.

References eris_check_error_code(), hdrl_image_get_image(), hdrl_image_get_median(), hdrl_image_get_stdev(), and hdrl_image_reject_from_mask().

◆ eris_ifu_hima_get_obj_mask_percent()

cpl_mask * eris_ifu_hima_get_obj_mask_percent ( hdrl_image *  hima,
const double  percent 
)

find mask flagging pixels above percent(%) pixels with lower intensity

Parameters
himainput hdrl image
percentinput percent threshold
Returns
cpl_mask* mask flagging points where objects have been found
Note
percent must be such that: 0.25 <= percent <= 0.75

Definition at line 3170 of file eris_ifu_utils.c.

References hdrl_image_get_image(), hdrl_image_get_size_x(), and hdrl_image_get_size_y().

◆ eris_ifu_idl_values_at_indices()

cpl_vector * eris_ifu_idl_values_at_indices ( const cpl_vector *  data,
const cpl_vector *  indices 
)

Returns a vector of given indices.

Parameters
dataThe data vector.
indicesThe indices to the data vector.
Returns
A (possibly shorter) vector with the desired values.

The returned vector contains the values of data indicated by indices . indices needn't be orderd, so will also have the returned vector the same order.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if data is NULL or if an illegal op is provided.

Definition at line 168 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_vector(), SET_ERROR_MSG, and TRY.

◆ eris_ifu_idl_where()

cpl_vector * eris_ifu_idl_where ( const cpl_vector *  data,
double  val,
int  op 
)

Implements the where-function knownm from IDL.

Parameters
dataThe vector.
valThe value.
opThe operator.
Returns
A vector with the indices to the input vector which fulfill the given condition. When the condition is never met NULL is returned.

The vector is checked elementwise like 'data[i] op val'. The operator can be any of following enums: eq: data[i] == val ne: data[i] != val ge: data[i] >= val gt: data[i] > val le: data[i] <= val lt: data[i] < val

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if data is NULL or if an illegal op is provided.

Definition at line 78 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_cut_endings(), eris_ifu_free_vector(), SET_ERROR_MSG, and TRY.

◆ eris_ifu_interpolatedMask_to_maskZero()

cpl_imagelist * eris_ifu_interpolatedMask_to_maskZero ( cpl_imagelist *  bpmCube,
double  threshold 
)

return cube flagging (as 1) pixels above a given threshold

Parameters
bpmCubeinput imagelist
thresholdthreshold
Returns
cube with detected threshold pixels

Definition at line 2101 of file eris_ifu_utils.c.

References ASSURE, CATCH, eris_check_error_code(), and TRY.

◆ eris_ifu_load_badpixel_mask()

cpl_mask * eris_ifu_load_badpixel_mask ( const cpl_frameset *  frameset,
const char *  category,
int  ext 
)

‍**

Loading badpixel mask of a given category.

Parameters
framesetThe input set-of-frames.
categoryThe category of the badpixelmask to load. If NULL, the next frame with same keyword as accessed right before will be returned
extThe number of the extension. 0 for primary HDU
Returns
The loaded basdpixel mask.

Definition at line 1296 of file eris_ifu_utils.c.

References ASSURE, CATCH, CATCH_MSG, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_mask(), and TRY.

◆ eris_ifu_mask_create_border()

cpl_mask * eris_ifu_mask_create_border ( const cpl_mask *  mask)

eris_ifu_mask_create_border

Parameters
mask
Returns

Add badpixborder around img

Definition at line 1850 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_mask(), and TRY.

◆ eris_ifu_mask_from_image()

cpl_mask * eris_ifu_mask_from_image ( const cpl_image *  img_mask)

eris_ifu_mask_from_image

Parameters
img_mask
Returns

convert image to mask img: 1: good, 0:bad mask: 0: good, 1: bad

Definition at line 3337 of file eris_ifu_utils.c.

References BRK_IF_NULL, CATCH, CATCH_MSG, eris_ifu_free_mask(), and TRY.

◆ eris_ifu_mask_nans_in_cube()

cpl_error_code eris_ifu_mask_nans_in_cube ( cpl_imagelist *  cube)

mask NANs in input data cube

Parameters
cubeinput imagelist
Returns
CPL_ERROR_NONE if OK

Definition at line 1941 of file eris_ifu_utils.c.

References BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), and TRY.

Referenced by eris_ifu_lcorr_create_object_mask(), and eris_ifu_lcorr_get().

◆ eris_ifu_mask_nans_in_hdrlimage()

cpl_error_code eris_ifu_mask_nans_in_hdrlimage ( hdrl_image **  hima)

Flag NANs in image.

Parameters
himainput image
Returns
0 if everything is ok

Definition at line 1899 of file eris_ifu_utils.c.

References eris_check_error_code(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_image_get_mask(), hdrl_image_get_size_x(), and hdrl_image_get_size_y().

◆ eris_ifu_parameterlist_append_list()

cpl_error_code eris_ifu_parameterlist_append_list ( cpl_parameterlist *  p1,
const cpl_parameterlist *  p2 
)

Append a parameterlist to another one.

Parameters
p1The 1st list to be extended
p2The 2ns list to be appendend
Returns
CPL_ERROR_NONE in case everything went fine

Definition at line 442 of file eris_ifu_utils.c.

References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), and TRY.

◆ eris_ifu_quality2bp_mask()

cpl_mask * eris_ifu_quality2bp_mask ( const cpl_image *  qualityMask,
deqQualityType  qualityType 
)

transform input image (quality mask) to output mask with given bit code

Parameters
qualityMaskinput imagelist
qualityTypeBIT code
Returns
mask of given type.

Definition at line 2055 of file eris_ifu_utils.c.

References ASSURE, BRK_WITH_ERROR_MSG, CATCH, eris_check_error_code(), and TRY.

◆ eris_ifu_save_bivector_dbg()

cpl_error_code eris_ifu_save_bivector_dbg ( const cpl_bivector *  bivec,
const char *  filename,
int  col,
int  create 
)

save bivector as a vector (col=1 or col=2) or as a table

col 1 for x only, 2 for y only, 0 for both

Parameters
bivecinput bivector
filenamefile name of product
colparameter to indicate what to save
createcode to indicate to create file
Returns
CPL_ERROR_NONE if OK

Definition at line 908 of file eris_ifu_utils.c.

References eris_ifu_save_vector_dbg().

◆ eris_ifu_save_cpl_image_dbg()

cpl_error_code eris_ifu_save_cpl_image_dbg ( const cpl_image *  img,
const char *  name,
int  singlefile,
const cpl_propertylist *  pl 
)

save CPL image for debug purposes

Parameters
imginput image
namefile name of product
singlefileif HDRL image content is saved as a single file (MEF)
plinput propertylist
Returns
CPL_ERROR_NONE if OK

Definition at line 1023 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_save_image_dbg(), eris_ifu_save_mask_dbg(), and TRY.

◆ eris_ifu_save_cpl_imagelist_dbg()

cpl_error_code eris_ifu_save_cpl_imagelist_dbg ( const cpl_imagelist *  imglist,
const char *  name 
)

save CPL imagelist for debugging purposes

Parameters
imglistinput imagelist
namefile name of product
Returns
CPL_ERROR_NONE if OK

Definition at line 1068 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_string(), eris_ifu_save_imagelist_dbg(), and TRY.

◆ eris_ifu_save_hdrl_image_dbg()

cpl_error_code eris_ifu_save_hdrl_image_dbg ( const hdrl_image *  hdrl_img,
const char *  filename,
int  singlefile,
const cpl_propertylist *  pl 
)

save HDRL imagelist for debugging purposes

Parameters
hdrl_imginput image
filenamefile name of product
singlefileif HDRL image content is saved as a single file (MEF)
plinput propertylist
Returns
CPL_ERROR_NONE if OK

Definition at line 1096 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_save_image_dbg(), eris_ifu_save_mask_dbg(), hdrl_image_get_error_const(), hdrl_image_get_image_const(), hdrl_image_get_mask_const(), and TRY.

◆ eris_ifu_save_hdrl_imagelist_dbg()

cpl_error_code eris_ifu_save_hdrl_imagelist_dbg ( const hdrl_imagelist *  hdrl_img_list,
const char *  filename,
int  singlefile 
)

eris_ifu_save_hdrl_imagelist_dbg

Parameters
hdrl_img_listinput image list
filenamefile name of product
singlefileif HDRL imagelist content is saved as a single file (MEF)
Returns
CPL_ERROR_NONE if OK

Definition at line 1156 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_imagelist(), eris_ifu_hdrl_get_imagelist(), eris_ifu_save_imagelist_dbg(), hdrl_image_get_mask_const(), hdrl_imagelist_get_const(), hdrl_imagelist_get_size(), and TRY.

◆ eris_ifu_save_ifu_vector_dbg()

cpl_error_code eris_ifu_save_ifu_vector_dbg ( const eris_ifu_vector *  vec,
const char *  filename,
int  create 
)

save vector

Parameters
vecinput vector
filenamefile name of product
createcode to indicate to create file
Returns
CPL_ERROR_NONE if OK

Definition at line 891 of file eris_ifu_utils.c.

References eris_ifu_vector_save().

◆ eris_ifu_save_image()

cpl_error_code eris_ifu_save_image ( cpl_frameset *  fs,
const cpl_propertylist *  plist,
const cpl_parameterlist *  parlist,
const char *  recipe,
const char *  procatg,
const char *  filename,
cpl_type  type,
const cpl_image *  image 
)

save image

Parameters
fsinput frameset
plistinput propertylist
parlistinput propertylist
recipeinput recipe name
procatgproduct category
filenameproduct file name
typeof image
imageimage to save
Returns
CPL_ERROR_NONE if OK

Definition at line 703 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_string(), and TRY.

Referenced by eris_ifu_combine().

◆ eris_ifu_save_image_dbg()

cpl_error_code eris_ifu_save_image_dbg ( const cpl_image *  img,
const char *  filename,
int  create,
const cpl_propertylist *  pl 
)

eris_ifu_save_image_dbg

Parameters
imginput image
filenamefile name of product
createcode to indicate to create file
plinput propertylist
Returns
CPL_ERROR_NONE if OK

Definition at line 940 of file eris_ifu_utils.c.

Referenced by eris_ifu_save_cpl_image_dbg(), and eris_ifu_save_hdrl_image_dbg().

◆ eris_ifu_save_imagelist()

cpl_error_code eris_ifu_save_imagelist ( cpl_frameset *  fs,
cpl_frame *  inherit,
const cpl_propertylist *  plist,
const cpl_parameterlist *  parlist,
const char *  recipe,
const char *  procatg,
const char *  filename,
cpl_type  type,
const cpl_imagelist *  imglist 
)

save imagelist

Parameters
fsinput frameset
inheritframe from which to inherit header
plistinput propertylist
parlistinput propertylist
recipeinput recipe name
procatgproduct category
filenameproduct file name
typeof imagelist
imglistimagelist to save
Returns
CPL_ERROR_NONE if OK

Definition at line 760 of file eris_ifu_utils.c.

References CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_string(), and TRY.

◆ eris_ifu_save_imagelist_dbg()

cpl_error_code eris_ifu_save_imagelist_dbg ( const cpl_imagelist *  imglist,
const char *  filename,
int  create 
)

save CPL imagelist for debug purposes

Parameters
imglistinput image list
filenamefile name of product
createcode to indicate to create file
Returns
CPL_ERROR_NONE if OK

Definition at line 996 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_ifu_save_cpl_imagelist_dbg(), and eris_ifu_save_hdrl_imagelist_dbg().

◆ eris_ifu_save_mask_dbg()

cpl_error_code eris_ifu_save_mask_dbg ( const cpl_mask *  mask,
const char *  filename,
int  create,
const cpl_propertylist *  pl 
)

eris_ifu_save_mask_dbg

Parameters
maskinput mask
filenamefile name of product
createcode to indicate to create file
plinput propertylist
Returns
CPL_ERROR_NONE if OK

Definition at line 982 of file eris_ifu_utils.c.

Referenced by eris_ifu_save_cpl_image_dbg(), and eris_ifu_save_hdrl_image_dbg().

◆ eris_ifu_save_table_dbg()

cpl_error_code eris_ifu_save_table_dbg ( const cpl_table *  tbl,
const char *  filename,
int  create 
)

eris_ifu_save_table_dbg

Parameters
tblinput table
filenamefile name of product
createcode to indicate to create file
Returns
CPL_ERROR_NONE if OK

Definition at line 969 of file eris_ifu_utils.c.

◆ eris_ifu_save_vector_dbg()

cpl_error_code eris_ifu_save_vector_dbg ( const cpl_vector *  vec,
const char *  filename,
int  create,
const cpl_propertylist *  pl 
)

save vector

Parameters
vecinput vector
filenamefile name of product
createcode to indicate to create file
plpropertylist
Returns
CPL_ERROR_NONE if OK

Definition at line 876 of file eris_ifu_utils.c.

Referenced by eris_ifu_save_bivector_dbg(), and eris_ifu_slitpos_gauss().

◆ eris_ifu_split3_hdrl_imagelist()

cpl_error_code eris_ifu_split3_hdrl_imagelist ( hdrl_imagelist *  cube,
cpl_imagelist *  dataCube,
cpl_imagelist *  errorCube,
cpl_imagelist *  qualCube 
)

extract from hdrl_imagelist the data and error information

Parameters
cubeinput imagelist
dataCubeoutput data
errorCubeoutput errs
qualCubeoutput quality
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2219 of file eris_ifu_utils.c.

References CATCH, eris_check_error_code(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_image_get_mask(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), and TRY.

Referenced by eris_ifu_resample_save_cube().

◆ eris_ifu_split_hdrl_imagelist()

cpl_error_code eris_ifu_split_hdrl_imagelist ( hdrl_imagelist *  cube,
cpl_imagelist *  dataCube,
cpl_imagelist *  errorCube 
)

extract from hdrl_imagelist the data and error information

Parameters
cubeinput imagelist
dataCubeoutput data
errorCubeoutput errs
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2181 of file eris_ifu_utils.c.

References CATCH, eris_check_error_code(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), and TRY.

◆ eris_pfits_put_qc()

cpl_error_code eris_pfits_put_qc ( cpl_propertylist *  plist,
cpl_table *  qclog 
)

convert table with QC parameter information to a propertylist

Parameters
plistoutput property list
qcloginput qclog table
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2545 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_compute_psf_qc(), and eris_ifu_cube_collapse_mean_and_save().

◆ eris_qclog_add_bool()

cpl_error_code eris_qclog_add_bool ( cpl_table *  table,
const char *  key_name,
const char *  key_help 
)

add QC boolean info to table

Parameters
tableinput table
key_namekeyword name
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2330 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_qclog_add_double()

cpl_error_code eris_qclog_add_double ( cpl_table *  table,
const char *  key_name,
const double  value,
const char *  key_help 
)

add QC double info to table

Parameters
tableinput table
key_namekeyword name
valuekeyword value
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2372 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_compute_psf_qc().

◆ eris_qclog_add_double_f()

cpl_error_code eris_qclog_add_double_f ( cpl_table *  table,
const char *  key_name,
const double  value,
const char *  key_help 
)

add QC float info to table

Parameters
tableinput table
key_namekeyword name
valuekeyword value
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2417 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_compute_psf_qc(), eris_get_pupil_shift(), and eris_ifu_cube_collapse_mean_and_save().

◆ eris_qclog_add_double_format()

cpl_error_code eris_qclog_add_double_format ( cpl_table *  table,
const char *  key_name,
const double  value,
const char *  key_help 
)

add QC double (with format) info to table

Parameters
tableinput table
key_namekeyword name
valuekeyword value
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2460 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_qclog_add_int()

cpl_error_code eris_qclog_add_int ( cpl_table *  table,
const char *  key_name,
const int  value,
const char *  key_help 
)

add QC int info to table

Parameters
tableinput table
key_namekeyword name
valuekeyword value
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2285 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_compute_psf_qc().

◆ eris_qclog_add_string()

cpl_error_code eris_qclog_add_string ( cpl_table *  table,
const char *  key_name,
const char *  value,
const char *  key_help 
)

add QC string info to table

Parameters
tableinput table
key_namekeyword name
valuekeyword value
key_helpkeyword help info
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 2503 of file eris_ifu_utils.c.

References eris_check_error_code().

◆ eris_qclog_init()

cpl_table * eris_qclog_init ( void  )

Initialize QC table.

Returns
cpl_table

Definition at line 2259 of file eris_ifu_utils.c.

References eris_check_error_code().

Referenced by eris_compute_psf_qc(), and eris_ifu_cube_collapse_mean_and_save().