Data Reduction Modules


Detailed Description

These are the main processing routines. Most of these also have a test recipe described on the test recipe page.

int vircam_darkcor (vir_fits *infile, vir_fits *darksrc, float darkscl, int *status)
 Correct input data for dark current.
int vircam_defringe (vir_fits **infiles, int nimages, vir_fits **fringes, int nfringes, vir_mask *mask, int nbsize, int *status)
 Correct input data to remove fringes.
int vircam_destripe (vir_fits *in, vir_mask *inbpm, int *status)
 Remove stripes from the background of an image.
int vircam_flatcor (vir_fits *infile, vir_fits *flatsrc, int *status)
 Correct input data for flat field response.
int vircam_gaincor (vir_fits *infile, float gainscl, int *status)
 Gain correct input data frame.
int vircam_genbpm (vir_fits **flatlist, int nflatlist, float lthr, float hthr, cpl_array **bpm_array, int *nbad, float *badfrac, int *status)
 Generate a bad pixel mask from a list of dome flats.
int vircam_genlincur (double **fdata, int nimages, double *exps, double mindit, vir_tfits *chantab, int norder, cpl_table **lchantab, double **lindata, int *status)
 Generate a linearity curve for each readout channel in a list of images.
int vircam_lincor (vir_fits *infile, vir_tfits *lchantab, int kconst, int ndit, int *status)
 Apply linearity curves to data.
int vircam_getstds (cpl_propertylist *plist, int cache, char *path, char *catname, cpl_table **stds, int *status)
 Get a table of 2mass standard stars that appear on an image from a catalogue.
int vircam_imcombine (vir_fits **fset, int nfits, int combtype, int scaletype, int xrej, float thresh, cpl_image **outimage, unsigned char **rejmask, unsigned char **rejplus, cpl_propertylist **drs, int *status)
 Stack images into a mean or median image with rejection.
int vircam_imcore (vir_fits *infile, vir_fits *conf, int ipix, float threshold, int icrowd, float rcore, int nbsize, int cattyp, float filtfwhm, vir_tfits **outtab, int *status)
 Generate object catalogues from input images.
int vircam_imdither (vir_fits **inf, vir_fits **inconf, int nimages, int nconfs, float lthr, float hthr, cpl_propertylist **p, cpl_image **out, cpl_image **outc, int *status)
 Dither a set of jittered observations.
int vircam_interleave (vir_fits **infiles, int ninputs, vir_fits **inconfs, int nconfs, int nsteps, cpl_propertylist **p, cpl_image **outimage, cpl_image **outconf, int *status)
 Interleave a set of microstepped observations.
int vircam_matchxy (cpl_table *progtab, cpl_table *template, float srad, float *xoffset, float *yoffset, int *nm, int *status)
 Match two lists of x,y coordinates from two tables to find the cartesian offset between them.
int vircam_matchstds (cpl_table *objtab, cpl_table *stdstab, float srad, cpl_table **outtab, int *status)
 Match object and standard star tables by their xy coordinates.
int vircam_mkconf (cpl_image *flat, char *flatfile, vir_mask *bpm, cpl_image **outconf, cpl_propertylist **drs, int *status)
 Create a confidence map.
int vircam_photcal (vir_fits **images, cpl_table **mstds, cpl_propertylist **pl, int nimages, char *filt, cpl_table *phottab, int *status)
 Work out the photometric zeropoint.
int vircam_illum (vir_fits **images, cpl_table **mstds, cpl_propertylist **pl, int nimages, char *filt, cpl_table *phottab, int nbsize, cpl_table **illcor, float *illcor_rms, int *status)
 Work out the illumination correction.
int vircam_platesol (cpl_propertylist *plist, cpl_propertylist *tlist, cpl_table *matchedstds, int nconst, int shiftan, int *status)
 Work out a WCS for an image.


Function Documentation

int vircam_darkcor ( vir_fits *  infile,
vir_fits *  darksrc,
float  darkscl,
int *  status 
)

Correct input data for dark current.

Name:
vircam_darkcor
Purpose:
Correct input data for dark current
Description:
Two images are given -- one is the data for an observation, the other is for a mean dark frame. The latter is subtracted from the former. The result overwrites the input data array for the object image. The data for the dark array can be scaled by a factor before subtraction if a scaling factor other than 1 is specified.
Language:
C
Parameters:
infile The input data image (overwritten by result).
darksrc The input dark image
darkscl The dark scaling factor
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if the output property list is NULL.
VIR_FATAL if image data fails to load
QC headers:
None
DRS headers:
The following DRS keywords are written to the infile extension header
  • DARKCOR The name of the originating FITS file for the dark image
  • DARKSCL: The scale factor applied to the dark frame before subtraction.
Author:
Jim Lewis, CASU

Definition at line 85 of file vircam/vircam_darkcor.c.

References vircam_compare_dims(), vircam_fits_get_ehu(), vircam_fits_get_fullname(), and vircam_fits_get_image().

int vircam_defringe ( vir_fits **  infiles,
int  nimages,
vir_fits **  fringes,
int  nfringes,
vir_mask *  mask,
int  nbsize,
int *  status 
)

Correct input data to remove fringes.

Name:
vircam_defringe
Purpose:
Correct input data to remove fringes
Description:
A list of input images are given along with a fringe frame image. Each image is analysed to model out any large scale background variation which would bias the fitting procedure if it were left in. The background corrected fringe data is scaled by a series of different factors subtracted from the image data. The median absolute deviation of each the difference image is worked out and the run of MAD with scale factor is examined to see at what point the scale factor minimises the MAD. This scale factor is then used to correct the input data.
Language:
C
Parameters:
infiles The input data images (overwritten by result).
nimages The number of input images
fringes The input fringe frames
nfringes The number of input fringe frames
mask The bad pixel mask
nbsize The size of each cell for the background modelling
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
QC headers:
The following QC keywords are written to the infile extension header
  • FRINGE_RATIO The ratio of the background RMS of the input image before fringe correction vs after.
DRS headers:
The following QC keywords are written to the infile extension header
  • FRINGEi The ith fringe frame used in defringing
  • FRNGSCi The scale factor of the ith fringe frame used in correcting the input image
Author:
Jim Lewis, CASU

Definition at line 107 of file vircam/vircam_defringe.c.

References vircam_fits_get_ehu(), vircam_fits_get_fullname(), vircam_fits_get_image(), vircam_mask_get_data(), and vircam_medmad().

int vircam_destripe ( vir_fits *  in,
vir_mask *  inbpm,
int *  status 
)

Remove stripes from the background of an image.

Name:
vircam_destripe
Purpose:
Remove stripes from the background of an image
Description:
Remove stripes from the background of an image by finding the median of each row and putting the value into a profile. Normalise the profile to zero median. Then subtract the normalised median for each row from the original data.
Language:
C
Parameters:
in The input image. This is corrected in-situ.
inbpm The input image bad pixel mask.
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
QC headers:
None
DRS headers:
The following DRS keywords are written to the plist propertylist
  • STRIPECOR A flag saying that the stripe correction has been done
  • STRIPERMS The RMS of the stripe profile
Other headers:
None
Author:
Jim Lewis, CASU

Definition at line 84 of file vircam/vircam_destripe.c.

References vircam_fits_get_ehu(), vircam_fits_get_image(), vircam_mask_get_data(), vircam_med(), and vircam_medsig().

int vircam_flatcor ( vir_fits *  infile,
vir_fits *  flatsrc,
int *  status 
)

Correct input data for flat field response.

Name:
vircam_flatcor
Purpose:
Correct input data for flat field response
Description:
Two images are given -- one is the data for an observation, the other is for a mean flat frame. The latter is divided into the former. The result overwrites the input data array for the object image.
Language:
C
Parameters:
infile The input data image (overwritten by result).
flatsrc The input flat image
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if there is a zero divide or if the output property list is NULL.
VIR_FATAL if image data fails to load
QC headers:
None
DRS headers:
The following DRS keywords are written to the infile extension header
  • FLATCOR The name of the originating FITS file for the flat image
Author:
Jim Lewis, CASU

Definition at line 79 of file vircam/vircam_flatcor.c.

References vircam_compare_dims(), vircam_fits_get_ehu(), vircam_fits_get_fullname(), and vircam_fits_get_image().

int vircam_gaincor ( vir_fits *  infile,
float  gainscl,
int *  status 
)

Gain correct input data frame.

Name:
vircam_gaincor
Purpose:
Correct input data for inter-detector gain difference
Description:
An input image is scaled by a constant value so as to put all the images in a single observation onto the same gain scale.
Language:
C
Parameters:
infile The input data image (overwritten by result).
gainscl The input scale factor
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if the scale factor is zero
VIR_FATAL if image data fails to load
QC headers:
None
DRS headers:
The following DRS keywords are written to the infile extension header
  • GAINCOR The gain correction factor
Author:
Jim Lewis, CASU

Definition at line 77 of file vircam/vircam_gaincor.c.

References vircam_fits_get_ehu(), and vircam_fits_get_image().

int vircam_genbpm ( vir_fits **  flatlist,
int  nflatlist,
float  lthr,
float  hthr,
cpl_array **  bpm_array,
int *  nbad,
float *  badfrac,
int *  status 
)

Generate a bad pixel mask from a list of dome flats.

Name:
vircam_genbpm
Purpose:
Generate a bad pixel mask from a list of dark corrected dome flat images.
Description:
A list of dark corrected dome flat images is given. A master flat is created from all the input flats in the list. Each input flat is then divided by the master. Bad pixels are marked on the new image as those that are above or below the threshold (in sigma) in the new image. Any pixel which has been marked as bad for more than a quarter of the input images is defined as bad in the output mask.
Language:
C
Parameters:
flatlist The list of input dark corrected dome flat images.
nflatlist The number of input images
lthr The low rejection threshold in units of sigma
hthr The high rejection threshold in units of sigma
bpm_array The output bad pixel mask
nbad The number of bad pixels found
badfrac The fraction of pixels in the map that are bad
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK If everything is ok
VIR_FATAL The flat combination failed
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 92 of file vircam_genbpm.c.

References vircam_fits_get_image(), vircam_getnpts(), vircam_imcombine(), vircam_medmad(), and vircam_medsig().

int vircam_genlincur ( double **  fdata,
int  nimages,
double *  exps,
double  mindit,
vir_tfits *  chantab,
int  norder,
cpl_table **  lchantab,
double **  lindata,
int *  status 
)

Generate a linearity curve for each readout channel in a list of images.

Name:
vircam_genlincur
Purpose:
Generate linearity coefficients for each readout channel of a detector given a median statistic for each channel in a sequence of dome flat field exposures.
Description:
Median flux estimates for each channel in a series of dark corrected dome flat exposures are given along with exposure timing information. The dome exposures must have been taken with a range of exposure times and using a stable light source. From the known reset/read time and exposure times, the linearity curve for each channel can be measured. The resulting coefficients are written to a new channel table, along with an estimate of the non-linearity at a nominal level and an estimate of the quality of the initial fit.
Language:
C
Parameters:
fdata A 2d array of medians for each flat. The first index is the image number. The second index is the channel number.
nimages The number of input images
exps An array of exposure times for the input images
mindit The reset/readout time
chantab The input channel table
norder The order of the fit. This will equal to the number of coefficients in the output table as according to the mathematic description of the algorithm, the zeroth coefficient is always zero.
lchantab The output channel table with new linearity coefficients
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if one or more channels have a failed fit
VIR_FATAL if the channel table is invalid.
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 116 of file vircam_genlincur.c.

References vircam_chan_fill(), vircam_chan_free(), vircam_linfit(), vircam_polyfit(), vircam_solve_gauss(), and vircam_tfits_get_table().

int vircam_getstds ( cpl_propertylist *  plist,
int  cache,
char *  path,
char *  catname,
cpl_table **  stds,
int *  status 
)

Get a table of 2mass standard stars that appear on an image from a catalogue.

Name:
vircam_getstds
Purpose:
Get a table of 2mass standard stars that appear on an image from a catalogue.
Description:
The propertylist of an image is given. The WCS from that propertylist is extracted and the region in equatorial coordinates covered by the image is calculated. From that information standard stars are extracted from the 2mass point source catalogue which resides in a location specified by a given path. For each object in the table and x,y pixel coordinate pair is calculated from the WCS and added to the table.
Language:
C
Parameters:
plist The input propertylist for the image in question
cache If set, then we can cache results which should result in faster access for several observations of the same region
path The full path to the catalogue FITS files.
catname The name of the input catalogue. This is just used for labelling purposes
stds The output table of standards
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if the output standards table has no rows in it
VIR_FATAL if a failure occurs in either accessing or extracting the standard data.
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 110 of file vircam/vircam_getstds.c.

References vircam_coverage(), and vircam_radectoxy().

Referenced by vircam_jmp_illum(), and vircam_jmp_matched_stds().

int vircam_illum ( vir_fits **  images,
cpl_table **  mstds,
cpl_propertylist **  pl,
int  nimages,
char *  filt,
cpl_table *  phottab,
int  nbsize,
cpl_table **  illcor,
float *  illcor_rms,
int *  status 
)

Work out the illumination correction.

Name:
vircam_illum
Purpose:
Work out the illumination correction
Description:
Work out the illumination correction from a set of images by dividing the image space into a number of cells. The median of photometric zeropoints for all the stars in a cell is compared with the median zeropoint over the whole set of images.
Language:
C
Parameters:
images The input data images
mstds The input matched standards catalogues (one for each image)
pl The list of extension header propertylists (one for each image catalogue)
nimages The number of images in the input lists
filt The filter for the observations
phottab The photometric calibration table for VIRCAM
nbsize The size of the side of a cell in pixels
illcor The illumination correction table for this detector
illcor_rms The RMS of the illumination correction
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_WARN if there weren't any photometric standards or all the objects in the catalogue failed.
VIR_FATAL if there is a problem with the photometric calibration table
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 535 of file vircam_photcal.c.

References vircam_fits_get_ehu(), vircam_fits_get_fullname(), vircam_fits_get_image(), vircam_fits_get_phu(), vircam_illcor_newtab(), vircam_meansigcut(), vircam_medmad(), vircam_medsig(), vircam_pfits_get_airmass(), and vircam_pfits_get_exptime().

Referenced by vircam_jmp_illum().

int vircam_imcombine ( vir_fits **  fset,
int  nfits,
int  combtype,
int  scaletype,
int  xrej,
float  thresh,
cpl_image **  outimage,
unsigned char **  rejmask,
unsigned char **  rejplus,
cpl_propertylist **  drs,
int *  status 
)

Stack images into a mean or median image with rejection.

Name:
vircam_imcombine
Purpose:
Stack images into a mean or median image with rejection
Description:
A list of frames is given. The images can be stacked by doing pixel by pixel means or medians. Images can be scaled or biassed to a common background value before any combination or rejection is done. The rejection algorithm has the option of doing an extra cycle which looks at the area surrounding a rejected pixel to see if the rejection is really justified. The output consists of a mean/median image, a rejection mask and a second rejection mask that only marks positive rejections. The latter could be useful if trying to assess the number of cosmic ray hits.
Language:
C
Parameters:
fset Input image list
nfits The number of input images
combtype Combination type: 1 == Median, 2 == Mean
scaletype Scaling type: 0 == none, 1 == additive, 2 == multiplicative, 3 == multiplicative by exp time then additive by flux
xrej Extra rejection cycle flag
thresh Rejection threshold in sigma above background
outimage Output image
rejmask Output rejection mask
rejplus Output mask of rejected pixels with positive residual
drs A propertylist to be used to write DRS info
status An input/output status that is the same as the returned values below
Return values:
VIR_OK if everything is ok
VIR_WARN if fset has zero length
VIR_FATAL for all other conditions
QC headers:
None
DRS headers:
The following DRS keywords are written to the drs propertylist
  • PROV**** The provenance keywords
Author:
Jim Lewis, CASU

Definition at line 151 of file vircam/vircam_imcombine.c.

References vircam_fits_get_filename(), vircam_fits_get_image(), vircam_fits_get_nexten(), vircam_fits_get_phu(), vircam_getnpts(), vircam_pfits_get_exptime(), and vircam_prov().

Referenced by vircam_genbpm(), and vircam_jmp_skycor().

int vircam_imcore ( vir_fits *  infile,
vir_fits *  conf,
int  ipix,
float  threshold,
int  icrowd,
float  rcore,
int  nbsize,
int  cattyp,
float  filtfwhm,
vir_tfits **  outtab,
int *  status 
)

Generate object catalogues from input images.

Name:
vircam_imcore
Purpose:
Generate object catalogues from input images
Description:
A frame and its confidence map are given. Detection thresholds and various other parameters are also given. Output is a table with all the extracted objects with object classifications included.
Language:
C
Parameters:
infile The input frame with the image to be analysed
conf The input frame with the confidence map
ipix The minimum allowable size of an object
threshold The detection threshold in sigma above sky
icrowd If set then the deblending software will be used
rcore The core radius in pixels
nbsize The smoothing box size for background map estimation
cattyp The type of catalogue to be produced
filtfwhm The FWHM of the smoothing kernel in the detection algorithm
outtab The output table of object
status The input/output status that has the same return value a below
Return values:
VIR_OK if everything is ok
VIR_WARN,VIR_FATAL errors in the called routines
QC headers:
The following values will go into the extension propertylist
  • SATURATION Saturation level in ADU
  • MEAN_SKY Mean sky brightness in ADU
  • SKY_NOISE Pixel noise at sky level in ADU
  • IMAGE_SIZE The average FWHM of stellar objects in pixels
  • ELLIPTICITY The average stellar ellipticity (1 - b/a)
  • APERTURE_CORR The stellar aperture correction for 1x core flux
  • NOISE_OBJ The number of noise objects
DRS headers:
The following values will go into the extension propertylist
  • THRESHOL The detection threshold in ADU
  • MINPIX The minimum number of pixels per image
  • CROWDED Flag for crowded field analysis
  • RCORE The core radius for default profile fit in pixels
  • FILTFWHM The FWHM of the smoothing kernel in the detection algorithm
  • SEEING The average FWHM of stellar objects in pixels
  • CLASSIFD A flag to say that the catalgoue has been classified
  • SKYLEVEL Mean sky brightness in ADU
  • SKYNOISE Pixel noise at sky level in ADU
Other headers:
The following values will go into the extension propertylist
  • APCORxx A series of aperture correction values for each of the core radius apertures.
  • SYMBOLx A series of keywords to be used by GAIA for plotting ellipses
Author:
Jim Lewis, CASU

Definition at line 131 of file vircam/vircam_imcore.c.

References vircam_fits_delete(), vircam_fits_duplicate(), vircam_fits_get_filename(), vircam_fits_get_fullname(), vircam_fits_get_phu(), and vircam_tfits_get_table().

Referenced by vircam_jmp_catalogue(), vircam_jmp_dither_offsets(), and vircam_jmp_illum().

int vircam_imdither ( vir_fits **  inf,
vir_fits **  inconf,
int  nimages,
int  nconfs,
float  lthr,
float  hthr,
cpl_propertylist **  p,
cpl_image **  out,
cpl_image **  outc,
int *  status 
)

Dither a set of jittered observations.

Name:
vircam_imdither
Purpose:
Dither a set of jittered observations
Description:
A set of jittered observations and their confidence maps (optional) are given. The cartesian offsets for each image are also given in the header. The observations and the confidence maps are dithered into an input map each taking the jitter offsets into account.
Language:
C
Parameters:
inf The list of input jittered observation images. Their extension propertylists need to have: ESO DRS XOFFDITHER (the dither offset in X), ESO DRS YOFFDITHER (the dither offset in Y). These have to be added by the calling routine.
inconf The list of input confidence maps. If the list is NULL or has a size of zero, then no output confidence map will be created. If the list has a size that is less than the size of the input files list, then only the first one will be used (i.e. each input image has the same confidence map). If the list has the same number as the input images then all of the listed confidence maps will be used to form the output confidence map.
nimages The number of input observation images
nconfs The number of input confidence maps
lthr The lower clipping threshold (in sigma)
hthr The upper clipping threshold (in sigma)
p A propertylist that will be used for the output image. This will be the header for the first image in the input image frameset (infiles) with appropriate modifications to the WCS.
out The output dithered image
outc The output confidence map
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if a failure occurs in either accessing input data or the input image list has not images in it.
QC headers:
None
DRS headers:
The following DRS keywords are written to the p propertylist
  • PROV**** The provenance keywords
Author:
Jim Lewis, CASU

Definition at line 156 of file vircam/vircam_imdither.c.

References vircam_fits_get_ehu(), vircam_fits_get_fullname(), vircam_fits_get_image(), vircam_fits_get_phu(), vircam_pfits_get_crpix1(), vircam_pfits_get_crpix2(), vircam_pfits_get_exptime(), vircam_pfits_get_jxoff(), vircam_pfits_get_jyoff(), vircam_prov(), and vircam_timestamp().

int vircam_interleave ( vir_fits **  infiles,
int  ninputs,
vir_fits **  inconfs,
int  nconfs,
int  nsteps,
cpl_propertylist **  p,
cpl_image **  outimage,
cpl_image **  outconf,
int *  status 
)

Interleave a set of microstepped observations.

Name:
vircam_interleave
Purpose:
Interleave a set of microstepped observations
Description:
A set of microstepped observations and their confidence maps (optional) are given. The cartesian offsets as well as the background medians for each image are also given. The observations and optionally the confidence maps are interleaved onto a finer grid defined by the number of steps in the microstep series. If input confidence maps are given, then an output confidence map will also be generated.
Language:
C
Parameters:
infiles The list of input microstepped observation images. Their extension propertylists need to have: ESO DRS XOFFMICRO (the microstep offset in X), ESO DRS YOFFMICRO (the microstep offset in Y) and ESO DRS BACKMED (the background median). These have to be added by the calling routine.
ninputs The number of input observation images
inconfs The list of input confidence maps. If the list is NULL or has a size of zero, then no output confidence map will be created. If the list has a size that is less than the size of the input files list, then only the first one will be used (i.e. each input image has the same confidence map). If the list has the same number as the input images then all of the listed confidence maps will be used to form the output confidence map.
nconfs The number of input confidence maps
nsteps The number of steps in the microstep pattern, e.g. for a 3x3 microstep pattern, this should be set to 3.
p A propertylist that will be used for the output image. This will be the header for the first image in the input image frameset (infiles) with appropriate modifications to the WCS.
outimage The output interleaved image
outconf The output confidence map
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if a failure occurs in either accessing input data or the input image list has not images in it.
QC headers:
None
DRS headers:
The following DRS keywords are written to the p propertylist
  • PROV**** The provenance keywords
Author:
Jim Lewis, CASU

Definition at line 117 of file vircam/vircam_interleave.c.

References vircam_crpixshift(), vircam_fits_get_ehu(), vircam_fits_get_image(), vircam_fits_get_phu(), vircam_prov(), vircam_rescalecd(), and vircam_timestamp().

int vircam_lincor ( vir_fits *  infile,
vir_tfits *  lchantab,
int  kconst,
int  ndit,
int *  status 
)

Apply linearity curves to data.

Name:
vircam_lincor
Purpose:
Apply linearity curves to data.
Description:
Correct the data in an image for its non-linearity. This is done with the help of a linearity channel table and some basic timing information from the header.
Language:
C
Parameters:
infile The input image. This should probably be a series of dome flat exposures of a stable light source with varying exposure times.
lchantab The linearity channel table
kconst If this is set, then the value of k is constant for the image. This is true (for example) if the reset time equals the read time.
ndit Set to the number of co-adds there are in the input data.
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if the data array can't be mapped for the input image or the linearity channel table is invalid.
QC headers:
None
DRS headers:
The following DRS keywords are written to the infile extension header
  • LINCOR The name of the originating FITS file for the linearity table
Author:
Jim Lewis, CASU

Definition at line 333 of file vircam_genlincur.c.

References vircam_chan_d2r(), vircam_chan_fill(), vircam_chan_free(), vircam_chan_r2a(), vircam_fits_get_ehu(), vircam_fits_get_fullname(), vircam_fits_get_image(), vircam_pfits_get_ditdelay(), vircam_pfits_get_exptime(), vircam_pfits_get_mindit(), vircam_tfits_get_filename(), and vircam_tfits_get_table().

int vircam_matchstds ( cpl_table *  objtab,
cpl_table *  stdstab,
float  srad,
cpl_table **  outtab,
int *  status 
)

Match object and standard star tables by their xy coordinates.

Name:
vircam_matchstds
Purpose:
Match object and standard star tables by their xy coordinates
Description:
An object table (nominally from vircam_imcore) and a standard star table (nominally from vircam_getstds) are given. The x,y coordinates of each are searched to find the offsets that maximises the number of matched objects. Objects that match are written to an output table with both sets of cartesian coordinates plus any ancillary information that might be in the standards table.
Language:
C
Parameters:
objtab The input table with the programme objects. Must have columns called X_coordinate and Y_coordinate (as one gets from vircam_imcore).
stdstab The input table with the template objects. Must have columns called xpredict and ypredict (as one gets from vircam_getstds).
srad A search radius in pixels. This helps to define the number of points that are used in the grid search
outtab The returned output table with both sets of cartesian coordinates plus any extra information that appears in the standards table.
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK If everything succeeded.
VIR_WARN If either table has no rows.
VIR_FATAL If either table is missing one of the required columns
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 269 of file vircam_match.c.

References vircam_fndmatch(), and vircam_medmad().

Referenced by vircam_jmp_illum(), and vircam_jmp_matched_stds().

int vircam_matchxy ( cpl_table *  progtab,
cpl_table *  template,
float  srad,
float *  xoffset,
float *  yoffset,
int *  nm,
int *  status 
)

Match two lists of x,y coordinates from two tables to find the cartesian offset between them.

Name:
vircam_matchxy
Purpose:
Match two lists of x,y coordinates from two tables to find the cartesian offset between them
Description:
A program and a template table are given. The x,y coordinates of each are searched to find the offsets that maximises the number of matched objects. These offsets are returned along with the number of matches. The offsets are in the sense: xoffset = x_template - x_programme
Language:
C
Parameters:
progtab The input table with the programme objects. Must have columns called X_coordinate and Y_coordinate.
template The input table with the template objects. Must have columns called X_coordinate and Y_coordinate.
srad A search radius in pixels. This helps to define the number of points that are used in the grid search
xoffset The returned x offset
yoffset The returned y offset
nm The returned number of matches
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK If everything succeeded.
VIR_WARN If either table has no rows.
VIR_FATAL If either table is missing one of the required columns
QC headers:
None
DRS headers:
None
Author:
Jim Lewis, CASU

Definition at line 101 of file vircam_match.c.

References vircam_fndmatch(), and vircam_med().

Referenced by vircam_jmp_dither_offsets().

int vircam_mkconf ( cpl_image *  flat,
char *  flatfile,
vir_mask *  bpm,
cpl_image **  outconf,
cpl_propertylist **  drs,
int *  status 
)

Create a confidence map.

Name:
vircam_mkconf
Purpose:
Create a confidence map
Description:
Create a confidence map from a given flat image and a bad pixel mask. The confidence is defined as 100 times the normalised flat field. Any pixels that are flagged as bad will have a value of 0 confidence.
Language:
C
Parameters:
flat The input flat field data image
flatfile The input flat field file name.
bpm The input mask image
outconf The ouput confidence map image
drs A propertylist with entries for the drs header block
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if image data fails to load or the dimensionality of the input images don't match.
QC headers:
None
DRS headers:
The following DRS keywords are written to the drs propertylist
  • FLATIN The name of the originating FITS file for the flat image
  • BPMIN: The name of the originating FITS file for the BPM image
Author:
Jim Lewis, CASU

Definition at line 87 of file vircam/vircam_mkconf.c.

References vircam_fits_get_fullname(), vircam_mask_get_data(), vircam_mask_get_fits(), vircam_mask_get_size_x(), vircam_mask_get_size_y(), vircam_mask_get_type(), and vircam_mean().

int vircam_photcal ( vir_fits **  images,
cpl_table **  mstds,
cpl_propertylist **  pl,
int  nimages,
char *  filt,
cpl_table *  phottab,
int *  status 
)

Work out the photometric zeropoint.

Name:
vircam_photcal
Purpose:
Work out the photometric zeropoint
Description:
Work out the photometric zeropoint for a set of input images.
Language:
C
Parameters:
images The input data images
mstds The input matched standards catalogues (one for each image)
pl The list of extension header propertylists (one for each image catalogue)
nimages The number of images in the input lists
filt The filter for the observations
phottab The photometric calibration table for VIRCAM
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if there is a problem with the photometric calibration table
QC headers:
  • MAGZPT The zeropoint calculated through aperture 3 using only objects from the current image
  • MAGZERR The zeropoint sigma calculated through aperture 3 using only objects from the current image.
  • MAGNZPT The number of objects used to calculate the zeropoint.
  • LIMITING_MAG The 5 sigma limiting magnitude through aperture 3.
DRS headers:
The following DRS keywords are written to the infile extension header
  • MAGNZPTIM The number of objects used to calculate the zeropoint for the current image.
  • ZPIM1 The zeropoint calculated through 1*rcore using only objects from the current image.
  • ZPSIGIM1 The zeropoint sigma calculated through 1*rcore using only objects from the current image.
  • LIMIT_MAG1 The 5 sigma limiting magnitude for this image in 1*rcore
  • ZPIM2 The zeropoint calculated through 2*rcore using only objects from the current image.
  • ZPSIGIM2 The zeropoint sigma calculated through 2*rcore using only objects from the current image.
  • LIMIT_MAG2 The 5 sigma limiting magnitude for this image in 2*rcore
  • MAGNZPTALL The number of objects on all images used to calculate the zeropoint.
  • ZPALL1 The zeropoint calculated through 1*rcore using all objects from all images in the list.
  • ZPSIGALL1 The zeropoint sigma calculated through 1*rcore using all objects from all images in the list
  • ZPALL2 The zeropoint calculated through 2*rcore using all objects from all images in the list.
  • ZPSIGALL2 The zeropoint sigma calculated through 2*rcore using all objects from all images in the list
Author:
Jim Lewis, CASU

Definition at line 152 of file vircam_photcal.c.

References vircam_fits_get_ehu(), vircam_fits_get_fullname(), vircam_fits_get_phu(), vircam_meansigcut(), vircam_medmad(), vircam_pfits_get_airmass(), and vircam_pfits_get_exptime().

Referenced by vircam_jmp_photcal().

int vircam_platesol ( cpl_propertylist *  plist,
cpl_propertylist *  tlist,
cpl_table *  matchedstds,
int  nconst,
int  shiftan,
int *  status 
)

Work out a WCS for an image.

Name:
vircam_platesol
Purpose:
Work out a WCS for an image
Description:
Given a matched standards table (a table of astrometric standards matched with objects on an image), work out a ZPN world coordinate system for the image. A full 6 constant plate solution (two zero points, two scales and two rotations) or a more restricted 4 constant solution (two zero points, one scale and one rotation) can be fit.
Language:
C
Parameters:
plist The propertylist which represents the FITS header for an input image. Must have a rough FITS WCS if the tangent point is going to be repositioned.
tlist The propertylist which represents the FITS header for the input catalogue that went into the matched standards table. This is needed so that the catalogue header can be updated with the new WCS values. If it is NULL, then obviously no updating with be done
matchedstds A matched standards table containing at least the following columns: X_coordinate, Y_coordinate, xpredict, ypredict, ra, dec. See DRLD for more information.
nconst The number of plate constants for the fit. The allowed values are 4 and 6 (4 constants or 6 constants).
shiftan If set, then the difference between the predicted and true cartesian coordinates are used to redefine the equatorial coordinates of the pole of the WCS.
status An input/output status that is the same as the returned values below.
Return values:
VIR_OK if everything is ok
VIR_FATAL if the plate solution has failed, there aren't enough standards or the requested number of constants is neither 4 nor 6.
QC headers:
The following QC keywords are written to the plist propertylist
  • WCS_DCRVAL1 Change in crval1 (degrees)
  • WCS_DCRVAL2 Change in crval2 (degrees)
  • WCS_DTHETA Change in rotation (degrees)
  • WCS_SCALE The mean plate scale (arcsec/pixel)
  • WCS_SHEAR Shear in the WCS solution (degrees)
  • WCS_RMS Average error in WCS fit in (arcsec)
DRS headers:
The following DRS keywords are written to the plist propertylist
  • NUMBRMS The number of stars in the WCS fit
  • STDCRMS The average error in the WCS fit (arcsec)
  • WCSRAOFF Central pixel RA_after - RA_before (arcsec)
  • WCSDECOFF Central pixel Dec_after - Dec_before (arcsec)
Other headers:
The input FITS WCS keywords are overwritten by updated values
Author:
Jim Lewis, CASU

Definition at line 131 of file vircam/vircam_platesol.c.

References vircam_dmed(), vircam_findcol(), vircam_pfits_get_naxis1(), vircam_pfits_get_naxis2(), vircam_radectoxieta(), and vircam_xytoradec().

Referenced by vircam_jmp_wcsfit().


Generated on Wed Apr 10 04:01:57 2013 for VIRCAM Pipeline by  doxygen 1.5.1