|
| int | vircam_illum (casu_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_destripe (casu_fits *in, casu_mask *inbpm, int *status) |
| | Remove stripes from the background of an image.
|
| |
| int | vircam_genbpm (casu_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, casu_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 (casu_fits *infile, casu_tfits *lchantab, int kconst, int ndit, int *status) |
| | Apply linearity curves to data.
|
| |
| int | vircam_grout (casu_tfits *intab, cpl_frameset *input_cats, cpl_frameset *input_confs, casu_tfits **outtab, int *status) |
| | Correct input tile catalogues.
|
| |
| int | vircam_interleave (casu_fits **infiles, int ninputs, casu_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_mosaic (cpl_frameset *infiles, cpl_frameset *inconf, int interp, int skyflag, float skywish_in, const char *expkey, int conflim, casu_fits **out, casu_fits **outc, int *status) |
| | Create a vircam mosaic.
|
| |
| int | vircam_tilesky (casu_fits **inlist, int nfiles, casu_mask *mask, casu_fits **skyout, int *status) |
| | Work sky estimate from an input tile series.
|
| |
These are the main processing routines. Most of these also have a test recipe described on the test recipe page.
| int vircam_destripe |
( |
casu_fits * | in, |
|
|
casu_mask * | inbpm, |
|
|
int * | status ) |
|
extern |
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
-
| CASU_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 87 of file vircam/vircam_destripe.c.
References casu_fits_get_ehu(), casu_fits_get_image(), casu_mask_get_data(), casu_medmad(), casu_medmadcut(), and casu_qmedsig().
| int vircam_genbpm |
( |
casu_fits ** | flatlist, |
|
|
int | nflatlist, |
|
|
float | lthr, |
|
|
float | hthr, |
|
|
cpl_array ** | bpm_array, |
|
|
int * | nbad, |
|
|
float * | badfrac, |
|
|
int * | status ) |
|
extern |
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
-
| CASU_OK | If everything is ok |
| CASU_FATAL | The flat combination failed |
- QC headers:
- None
- DRS headers:
- None
- Author
- Jim Lewis, CASU
Definition at line 93 of file vircam_genbpm.c.
References casu_fits_get_image(), casu_getnpts(), casu_imcombine(), casu_medmad(), and casu_medsig().
| int vircam_genlincur |
( |
double ** | fdata, |
|
|
int | nimages, |
|
|
double * | exps, |
|
|
double | mindit, |
|
|
casu_tfits * | chantab, |
|
|
int | norder, |
|
|
cpl_table ** | lchantab, |
|
|
double ** | lindata, |
|
|
int * | status ) |
|
extern |
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 |
| lindata | An array of the linearised values of 'fdata' |
| status | An input/output status that is the same as the returned values below. |
- Return values
-
| CASU_OK | if everything is ok |
| CASU_WARN | if one or more channels have a failed fit |
| CASU_FATAL | if the channel table is invalid. |
- QC headers:
- None
- DRS headers:
- None
- Author
- Jim Lewis, CASU
Definition at line 118 of file vircam_genlincur.c.
References casu_tfits_get_table(), vircam_chan_fill(), vircam_chan_free(), vircam_polyfit(), and vircam_solve_gauss().
| int vircam_grout |
( |
casu_tfits * | intab, |
|
|
cpl_frameset * | input_cats, |
|
|
cpl_frameset * | input_confs, |
|
|
casu_tfits ** | outtab, |
|
|
int * | status ) |
|
extern |
Correct input tile catalogues.
- Name:
- vircam_grout
- Purpose:
- Correct input tile catalogues for the effects of variable seeing and magnitude zeropoints of the images that went into that tile.
- Description:
- Variable conditions during the observations of the 6 pawprints of a VIRCAM tile can lead to spatial systematics in the fluxes measured from a tiled image. This routine takes that effect out.
- Language:
- C
- Parameters
-
| intab | The input tile catalogue |
| input_cats | The catalogues for the input pawprints that formed the tile |
| input_confs | The confidence maps for the input pawprints that formed the tile |
| outtab | The output tile catalogue |
| status | An input/output status that is the same as the returned values below. |
- Return values
-
| CASU_OK | if everything is ok |
| CASU_FATAL | if image data fails to load |
- QC headers:
- None
- DRS headers:
- None
- Author
- Jim Lewis, CASU
Definition at line 108 of file vircam_grout.c.
References casu_fits_get_image(), casu_fits_load(), casu_med(), casu_tfits_duplicate(), casu_tfits_get_ehu(), casu_tfits_get_table(), and casu_xytoxy_list().
| int vircam_illum |
( |
casu_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 ) |
|
extern |
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
-
| CASU_OK | if everything is ok |
| CASU_WARN | if there weren't any photometric standards or all the objects in the catalogue failed. |
| CASU_FATAL | if there is a problem with the photometric calibration table |
- QC headers:
- None
- DRS headers:
- None
- Author
- Jim Lewis, CASU
Definition at line 1406 of file vircam_utils.c.
References casu_fits_get_ehu(), casu_fits_get_fullname(), casu_fits_get_image(), casu_fits_get_phu(), casu_medmad(), casu_medmadcut(), casu_medsig(), vircam_illcor_newtab(), vircam_pfits_get_airmass(), and vircam_pfits_get_exptime().
Referenced by vircam_jmp_illum().
| int vircam_interleave |
( |
casu_fits ** | infiles, |
|
|
int | ninputs, |
|
|
casu_fits ** | inconfs, |
|
|
int | nconfs, |
|
|
int | nsteps, |
|
|
cpl_propertylist ** | p, |
|
|
cpl_image ** | outimage, |
|
|
cpl_image ** | outconf, |
|
|
int * | status ) |
|
extern |
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
-
| CASU_OK | if everything is ok |
| CASU_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 casu_crpixshift(), casu_fits_get_ehu(), casu_fits_get_image(), casu_fits_get_phu(), casu_prov(), casu_rescalecd(), and vircam_timestamp().
Referenced by vircam_jmp_interleave().
| int vircam_lincor |
( |
casu_fits * | infile, |
|
|
casu_tfits * | lchantab, |
|
|
int | kconst, |
|
|
int | ndit, |
|
|
int * | status ) |
|
extern |
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
-
| CASU_OK | if everything is ok |
| CASU_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 382 of file vircam_genlincur.c.
References casu_fits_get_ehu(), casu_fits_get_fullname(), casu_fits_get_image(), casu_tfits_get_filename(), casu_tfits_get_table(), vircam_chan_d2r(), vircam_chan_fill(), vircam_chan_free(), vircam_chan_r2a(), vircam_pfits_get_ditdelay(), vircam_pfits_get_exptime(), and vircam_pfits_get_mindit().
| int vircam_tilesky |
( |
casu_fits ** | inlist, |
|
|
int | nfiles, |
|
|
casu_mask * | mask, |
|
|
casu_fits ** | skyout, |
|
|
int * | status ) |
|
extern |
Work sky estimate from an input tile series.
- Name:
- vircam_tilesky
- Purpose:
- Work a sky estimate from an input tile
- Description:
- A list of images from a whole tile is given. These are broken up into groups that all have the same position within the jitter sequence. An intermediate sky is formed from each group and then a final output sky is formed from the intermediate sky files.
- Language:
- C
- Parameters
-
| inlist | The input images from the tile |
| nfiles | The number of images in the jitter series |
| mask | The bad pixel mask derived from the confidence map. |
| skyout | The output sky map |
| status | An input/output status that is the same as the returned values below. |
- Return values
-
| CASU_OK | if everything is ok |
| CASU_FATAL | if something went wrong. An error message will appear. |
- Author
- Jim Lewis, CASU
Definition at line 94 of file vircam_sky.c.
References casu_fits_get_image(), casu_fits_get_phu(), casu_fits_wrap(), casu_imcombine(), casu_inpaint(), casu_mask_get_data(), casu_mask_get_size_x(), casu_mask_get_size_y(), vircam_pfits_get_jitteri(), and vircam_pfits_get_njsteps().