ERIS Pipeline Reference Manual 1.9.2
Functions
Miscellaneous Source Match Utilities

Functions

cpl_error_code enm_associate_std (cpl_table *objtab, cpl_table *stdtab, const float assoc, const int strict_classification, cpl_table **associated_std)
 Associate image catalogue objects with standards.
 
cpl_error_code enm_correct_crpix (const char *wcs_method, const char *catalogue, cpl_table *matched_stds, located_image *limage, cpl_matrix **xy_shift)
 Apply median offsets from matched standards table to image.
 
cpl_error_code enm_try_all_associations (cpl_table *objtab, cpl_table *stdtab, const double match_rad, cpl_table **matchtab)
 Match standards with objects by trying all possibilities and selecting best.
 
cpl_error_code enm_try_association (const double xstd[], const double ystd[], const cpl_size nstd, const double xobj[], const double yobj[], const cpl_size nobj, const cpl_size is, const cpl_size io, cpl_matrix **distances)
 Method to calculate 'distances' matrix given an object association.
 

Detailed Description

Function Documentation

◆ enm_associate_std()

cpl_error_code enm_associate_std ( cpl_table *  objtab,
cpl_table *  stdtab,
const float  assoc,
const int  strict_classification,
cpl_table **  associated_std 
)

Associate image catalogue objects with standards.

Parameters
objtabTable of objects in image
stdtabTable of standards
assocRadius of association (pixels)
strict_classificationTrue to only consider stellar round objects
associated_stdA table containing data for the associated objects
Returns
A CPL error code

The routine matches catalogue objects with standards that lie within 'assoc' pixels. If either image or standard catalogue is NULL then the routine returns immediately with no error and without modifying associated_std.

Definition at line 72 of file eris_nix_match.c.

◆ enm_correct_crpix()

cpl_error_code enm_correct_crpix ( const char *  wcs_method,
const char *  catalogue,
cpl_table *  matched_stds,
located_image *  limage,
cpl_matrix **  xy_shift 
)

Apply median offsets from matched standards table to image.

Parameters
wcs_methodString describing the correction method
catalogueName of reference catalogue
matched_stdsTable of matched standards
limageThe image to be corrected
xy_shiftMatrix containing corrections applied
Returns
A CPL error code

The routine calculates the median shifts in x and y implicit in the coordinates in the matched_stds table. These shifts are applied to the CRPIX1 and CRPIX2 keywords in the image to line up the object and standard positions.

Definition at line 278 of file eris_nix_match.c.

Referenced by enu_correct_wcs().

◆ enm_try_all_associations()

cpl_error_code enm_try_all_associations ( cpl_table *  objtab,
cpl_table *  stdtab,
const double  match_rad,
cpl_table **  matchtab 
)

Match standards with objects by trying all possibilities and selecting best.

Parameters
objtabTable of objects in image.
stdtabTable of standards to pattern match.
match_radMax distance between matching obj and std (pixels).
matchtabPointer to table with matched standard/object pairs.
Returns
A CPL error code

An object table from hdrl_catalogue and a standard star table, from either casu_getstds or hdrl_catalogue, are given.

All possible associations between standards and objects are tried and a metric of the pattern match is calculated for each - that is, the number of std/obj pairs that lie within 'match_rad' pixels of each other.

The association with the highest metric is selected, and a table is constructed of the std/obj matches found for it.

Definition at line 400 of file eris_nix_match.c.

References enm_try_association().

Referenced by enu_correct_wcs().

◆ enm_try_association()

cpl_error_code enm_try_association ( const double  xstd[],
const double  ystd[],
const cpl_size  nstd,
const double  xobj[],
const double  yobj[],
const cpl_size  nobj,
const cpl_size  is,
const cpl_size  io,
cpl_matrix **  distances 
)

Method to calculate 'distances' matrix given an object association.

Parameters
xstdArray containing x-coords of standards
ystdArray containing y-coords of standards
nstdNumber of standards
xobjArray containing x-coords of objects
yobjArray containing y-coords of objects
nobjNumber of objects
isIndex of match standard
ioIndex of match object
distancesout cpl_matrix containing the resulting distances between matched stds/objs
Returns
Matrix containing the resulting distances between matched stds/objs

Arrays with x,y coords of standards and objects are given, and a specification of which standard and which object are to be matched. The routine calculates the implied offset between standards and objects, and shifts the objects by this amount to now be in the 'standard' frame. A matrix is populated with the distances between each standard and each object, and returned.

Definition at line 677 of file eris_nix_match.c.

Referenced by enm_try_all_associations().