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. |
int vircam_darkcor | ( | vir_fits * | infile, | |
vir_fits * | darksrc, | |||
float | darkscl, | |||
int * | status | |||
) |
Correct input data for dark current.
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. |
VIR_OK | if everything is ok | |
VIR_WARN | if the output property list is NULL. | |
VIR_FATAL | if image data fails to load |
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.
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. |
VIR_OK | if everything is ok |
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.
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. |
VIR_OK | if everything is ok |
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.
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. |
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 |
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.
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. |
VIR_OK | if everything is ok | |
VIR_WARN | if the scale factor is zero | |
VIR_FATAL | if image data fails to load |
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.
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. |
VIR_OK | If everything is ok | |
VIR_FATAL | The flat combination failed |
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.
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. |
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. |
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.
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. |
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. |
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.
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. |
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 |
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.
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 |
VIR_OK | if everything is ok | |
VIR_WARN | if fset has zero length | |
VIR_FATAL | for all other conditions |
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.
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 |
VIR_OK | if everything is ok | |
VIR_WARN,VIR_FATAL | errors in the called routines |
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.
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. |
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. |
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.
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. |
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. |
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.
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. |
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. |
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.
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. |
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 |
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.
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. |
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 |
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.
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. |
VIR_OK | if everything is ok | |
VIR_FATAL | if image data fails to load or the dimensionality of the input images don't match. |
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.
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. |
VIR_OK | if everything is ok | |
VIR_FATAL | if there is a problem with the photometric calibration table |
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.
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. |
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. |
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().