These are utility routines of various types. More...
Functions | |
const char * | vircam_get_license (void) |
int | vircam_compare_tags (const cpl_frame *frame1, const cpl_frame *frame2) |
cpl_frameset * | vircam_frameset_subgroup (cpl_frameset *frameset, cpl_size *labels, cpl_size nlab, const char *tag) |
cpl_frame * | vircam_frameset_subgroup_1 (cpl_frameset *frameset, cpl_size *labels, cpl_size nlab, const char *tag) |
int | vircam_frameset_fexists (cpl_frameset *frameset) |
void | vircam_exten_range (int inexten, const cpl_frame *fr, int *out1, int *out2) |
void | vircam_madfit (int npts, float *xdata, float *ydata, float *intercept, float *slope) |
void | vircam_linfit (int npts, double *xdata, double *ydata, double *intercept, double *slope, double *sig) |
int | vircam_solve_gauss (double **a, double *b, int m) |
int | vircam_polyfit (const cpl_array *xarray, const cpl_array *yarray, int ncoefs, int ilim, int niter, float lclip, float hclip, cpl_array **polycf, double *sigfit) |
void | vircam_difference_image (cpl_image *master, cpl_image *prog, unsigned char *bpm, cpl_table *chantab, int ncells, int oper, float *global_diff, float *global_rms, cpl_image **diffim, cpl_table **diffimstats) |
cpl_table * | vircam_create_diffimg_stats (int nrows) |
void | vircam_sort (float **a, int n, int m) |
long | vircam_getnpts (cpl_image *in) |
int | vircam_fndmatch (float x, float y, float *xlist, float *ylist, int nlist, float err) |
int * | vircam_dummy_confidence (long n) |
int | vircam_compare_dims (cpl_image *im1, cpl_image *im2) |
void | vircam_prov (cpl_propertylist *p, vir_fits **inlist, int n) |
void | vircam_merge_propertylists (cpl_propertylist *p1, cpl_propertylist *p2) |
void | vircam_dummy_property (cpl_propertylist *p) |
int | vircam_is_dummy (cpl_propertylist *p) |
void | vircam_overexp (vir_fits **fitslist, int *n, int ndit, float lthr, float hthr, int ditch, float *minv, float *maxv, float *avev) |
cpl_image * | vircam_dummy_image (vir_fits *model) |
cpl_table * | vircam_dummy_catalogue (int type) |
cpl_table * | vircam_illcor_newtab (int nrows) |
void | vircam_timestamp (char *out, int n) |
void | vircam_backmap (vir_fits *in, vir_mask *mask, int nbsize, cpl_image **out, float *med) |
int | vircam_findcol (cpl_propertylist *p, const char *col) |
void | vircam_rename_property (cpl_propertylist *p, const char *oldname, char *newname) |
int | vircam_catpars (cpl_frame *indx, char **catpath, char **catname) |
int | vircam_gaincor_calc (cpl_frame *frame, int *n, float **cors, int *status) |
int | vircam_check_crval (cpl_propertylist *phu, cpl_propertylist *ehu) |
These are utility routines of various types.
void vircam_backmap | ( | vir_fits * | in, | |
vir_mask * | mask, | |||
int | nbsize, | |||
cpl_image ** | out, | |||
float * | med | |||
) |
in | The input image | |
mask | The input bad pixel mask | |
nbsize | The input size of the smoothing cells | |
out | The output background map (corrected for to zero median) | |
med | The global median of the input image |
Definition at line 1802 of file vircam_utils.c.
References vircam_fits_get_image(), vircam_mask_get_data(), and vircam_med().
Referenced by vircam_tilesky().
int vircam_catpars | ( | cpl_frame * | indx, | |
char ** | catpath, | |||
char ** | catname | |||
) |
indx | The frame for the index FITS file | |
catpath | The full path to the catalgoue FITS files | |
catname | The name of the catalogue |
VIR_OK | if everything is ok | |
VIR_WARN | if the catalogue isn't identified in the header | |
VIR_FATAL | if the index file is missing or if there is missing header info |
Definition at line 2059 of file vircam_utils.c.
int vircam_check_crval | ( | cpl_propertylist * | phu, | |
cpl_propertylist * | ehu | |||
) |
phu | The primary header propertylist | |
ehu | The extension header propertylist |
VIR_OK | if everything is ok | |
VIR_FATAL | if no values of CRVAL are in the extension or no values of RA,DEC are available in the primary |
Definition at line 2236 of file vircam_utils.c.
References vircam_pfits_get_crval1(), vircam_pfits_get_crval2(), vircam_pfits_get_dec(), and vircam_pfits_get_ra().
int vircam_compare_dims | ( | cpl_image * | im1, | |
cpl_image * | im2 | |||
) |
im1 | The first image | |
im2 | The second image |
VIR_OK | If the dimensions are the same | |
VIR_FATAL | If the dimensions are different |
Definition at line 1396 of file vircam_utils.c.
Referenced by vircam_darkcor(), and vircam_flatcor().
int vircam_compare_tags | ( | const cpl_frame * | frame1, | |
const cpl_frame * | frame2 | |||
) |
frame1 | The first frame | |
frame2 | The second frame |
0 | if frame1 != frame2 | |
1 | if frame1 == frame2 | |
-1 | if either frame is missing its tag |
Definition at line 141 of file vircam_utils.c.
cpl_table* vircam_create_diffimg_stats | ( | int | nrows | ) |
nrows | The number of rows for the table |
Definition at line 1148 of file vircam_utils.c.
Referenced by vircam_difference_image().
void vircam_difference_image | ( | cpl_image * | master, | |
cpl_image * | prog, | |||
unsigned char * | bpm, | |||
cpl_table * | chantab, | |||
int | ncells, | |||
int | oper, | |||
float * | global_diff, | |||
float * | global_rms, | |||
cpl_image ** | diffim, | |||
cpl_table ** | diffimstats | |||
) |
master | The master calibration image | |
prog | The new mean image | |
bpm | Input bad pixel mask | |
chantab | The channel table for the detector | |
ncells | The number of cells per channel | |
oper | The operation to be performed:
| |
global_diff | The median difference over the whole difference image | |
global_rms | The rms difference over the whole difference image | |
diffim | The output difference/ratio image | |
diffimstats | The output difference/ratio image statistics table |
Definition at line 950 of file vircam_utils.c.
References vircam_create_diffimg_stats(), vircam_meansig(), and vircam_medmad().
cpl_table* vircam_dummy_catalogue | ( | int | type | ) |
type | The type of catalogue to create |
Definition at line 1689 of file vircam_utils.c.
References tabinit().
Referenced by vircam_jmp_save_catalogue().
int* vircam_dummy_confidence | ( | long | n | ) |
n | The number of pixels |
Definition at line 1362 of file vircam_utils.c.
cpl_image* vircam_dummy_image | ( | vir_fits * | model | ) |
model | The model on which the new image will be based. |
Definition at line 1654 of file vircam_utils.c.
References vircam_fits_get_image().
Referenced by vircam_jmp_dither_images(), and vircam_jmp_interleave().
void vircam_dummy_property | ( | cpl_propertylist * | p | ) |
p | The input propertylist |
Definition at line 1516 of file vircam_utils.c.
Referenced by vircam_jmp_save_catalogue(), vircam_jmp_save_illum(), vircam_jmp_save_offsky(), vircam_jmp_save_simple(), vircam_jmp_save_simple_offsets(), vircam_jmp_save_stack(), and vircam_jmp_save_super().
void vircam_exten_range | ( | int | inexten, | |
const cpl_frame * | fr, | |||
int * | out1, | |||
int * | out2 | |||
) |
inexten | Input image extension from the recipe invocation | |
fr | An input frame used to test whether the requested frame(s) exist or not | |
out1 | Lower part of extension range (-1 if there is an error) | |
out2 | Upper part of extension range (-1 if there is an error) |
Definition at line 353 of file vircam_utils.c.
int vircam_findcol | ( | cpl_propertylist * | p, | |
const char * | col | |||
) |
p | The input propertylist for the table | |
col | The column you want to find |
Definition at line 1963 of file vircam_utils.c.
Referenced by vircam_platesol().
int vircam_fndmatch | ( | float | x, | |
float | y, | |||
float * | xlist, | |||
float * | ylist, | |||
int | nlist, | |||
float | err | |||
) |
x | The X coordinate of the object | |
y | The Y coordinate of the object | |
xlist | The list of catalogue X coordinates | |
ylist | The list of catalogue Y coordinates | |
nlist | The number of entries in the lists | |
err | The maximum error radius for a match |
Definition at line 1297 of file vircam_utils.c.
Referenced by vircam_matchstds(), and vircam_matchxy().
int vircam_frameset_fexists | ( | cpl_frameset * | frameset | ) |
frameset | Input frameset |
VIR_OK | If everything went OK | |
VIR_FATAL | If any of the files in the frameset are missing |
Definition at line 285 of file vircam_utils.c.
cpl_frameset* vircam_frameset_subgroup | ( | cpl_frameset * | frameset, | |
cpl_size * | labels, | |||
cpl_size | nlab, | |||
const char * | tag | |||
) |
frameset | The input frameset | |
labels | The labels for the input frameset | |
nlab | The number of labels for the input frameset | |
tag | The tag for the frames in the output frameset |
Definition at line 193 of file vircam_utils.c.
Referenced by vircam_frameset_subgroup_1().
cpl_frame* vircam_frameset_subgroup_1 | ( | cpl_frameset * | frameset, | |
cpl_size * | labels, | |||
cpl_size | nlab, | |||
const char * | tag | |||
) |
frameset | The input frameset | |
labels | The labels for the input frameset | |
nlab | The number of labels for the input frameset | |
tag | The tag for the frames in the output frameset |
Definition at line 247 of file vircam_utils.c.
References vircam_frameset_subgroup().
Referenced by vircam_mask_define().
int vircam_gaincor_calc | ( | cpl_frame * | frame, | |
int * | n, | |||
float ** | cors, | |||
int * | status | |||
) |
frame | The input twilight frame | |
n | The number of image extensions | |
cors | An array of output corrections | |
status | The input/output status variable |
VIR_OK | if everything is ok |
Definition at line 2144 of file vircam_utils.c.
const char* vircam_get_license | ( | void | ) |
Definition at line 92 of file vircam_utils.c.
long vircam_getnpts | ( | cpl_image * | in | ) |
in | The input image |
Definition at line 1247 of file vircam_utils.c.
Referenced by vircam_genbpm(), vircam_imcombine(), and vircam_jmp_interleave().
cpl_table* vircam_illcor_newtab | ( | int | nrows | ) |
nrows | The number of rows in the table |
Definition at line 1716 of file vircam_utils.c.
Referenced by vircam_illum(), and vircam_jmp_save_illum().
int vircam_is_dummy | ( | cpl_propertylist * | p | ) |
p | The input propertylist |
Definition at line 1549 of file vircam_utils.c.
void vircam_linfit | ( | int | npts, | |
double * | xdata, | |||
double * | ydata, | |||
double * | intercept, | |||
double * | slope, | |||
double * | sig | |||
) |
npts | The number of data points | |
xdata | The X data | |
ydata | The Y data | |
intercept | The fitted intercept | |
slope | The fitted slope | |
sig | The fit error |
Definition at line 570 of file vircam_utils.c.
void vircam_madfit | ( | int | npts, | |
float * | xdata, | |||
float * | ydata, | |||
float * | intercept, | |||
float * | slope | |||
) |
npts | The number of data points | |
xdata | The X data | |
ydata | The Y data | |
intercept | The fitted intercept | |
slope | The fitted slope |
Definition at line 427 of file vircam_utils.c.
void vircam_merge_propertylists | ( | cpl_propertylist * | p1, | |
cpl_propertylist * | p2 | |||
) |
p1 | The first propertylist | |
p2 | The second propertylist |
Definition at line 1470 of file vircam_utils.c.
Referenced by vircam_jmp_save_catalogue(), vircam_jmp_save_illum(), vircam_jmp_save_stack(), and vircam_jmp_skycor().
void vircam_overexp | ( | vir_fits ** | fitslist, | |
int * | n, | |||
int | ndit, | |||
float | lthr, | |||
float | hthr, | |||
int | ditch, | |||
float * | minv, | |||
float * | maxv, | |||
float * | avev | |||
) |
fitslist | The input fits list. This will be replaced by another list that has the rejected images removed. | |
n | The number of fits images in the input list. This will be changed if any of these get rejected. | |
ndit | The number of coadds | |
lthr | The lower threshold for underexposed images | |
hthr | The upper threshold for overexposed images | |
ditch | If set, then the bad vir_fits image descriptors will be explicitly deleted. | |
minv | Output value with the lowest flux in the sample | |
maxv | Output value with the highest flux in the sample | |
avev | Output value with the average flux in the sample |
Definition at line 1601 of file vircam_utils.c.
References vircam_fits_delete(), and vircam_fits_get_image().
int vircam_polyfit | ( | const cpl_array * | xarray, | |
const cpl_array * | yarray, | |||
int | ncoefs, | |||
int | ilim, | |||
int | niter, | |||
float | lclip, | |||
float | hclip, | |||
cpl_array ** | polycf, | |||
double * | sigfit | |||
) |
xarray | The independent variable array | |
yarray | The dependent variable array | |
ncoefs | The requested polynomial order plus 1. | |
ilim | The number of low order coefficients not to fit. | |
niter | The number of iterations | |
lclip | The number of sigma for the lower clipping threshold | |
hclip | The number of sigma for the upper clipping threshold | |
polycf | The returned array of polynomial coefficients. | |
sigfit | The total error of the fit |
VIR_OK | If everything went OK | |
VIR_FATAL | If there was some sort of error |
Definition at line 759 of file vircam_utils.c.
References vircam_solve_gauss().
Referenced by vircam_genlincur().
void vircam_prov | ( | cpl_propertylist * | p, | |
vir_fits ** | inlist, | |||
int | n | |||
) |
p | The combined image propertylist | |
inlist | The list of images that went into ifile. | |
n | The number of images in the input list |
Definition at line 1428 of file vircam_utils.c.
References vircam_fits_get_fullname().
Referenced by vircam_imcombine(), vircam_imdither(), vircam_imstack(), and vircam_interleave().
void vircam_rename_property | ( | cpl_propertylist * | p, | |
const char * | oldname, | |||
char * | newname | |||
) |
p | The input propertylist for the table | |
oldname | The old property name | |
newname | The new property name |
Definition at line 2002 of file vircam_utils.c.
Referenced by vircam_tabwcs().
int vircam_solve_gauss | ( | double ** | a, | |
double * | b, | |||
int | m | |||
) |
a | The matrix part of the system (a[m][m]) | |
b | The vector part of the system (b[m]). The output fit coefficients overwrite the input values in this vector. | |
m | The size of the vectors |
VIR_OK | If everything went OK | |
VIR_FATAL | If matrix a has a zero determinant |
Definition at line 644 of file vircam_utils.c.
Referenced by vircam_genlincur(), and vircam_polyfit().
void vircam_sort | ( | float ** | a, | |
int | n, | |||
int | m | |||
) |
a | The input 2d array (a[m][n]) | |
n | The number of rows in the array | |
m | The number of columns in the array |
Definition at line 1200 of file vircam_utils.c.
void vircam_timestamp | ( | char * | out, | |
int | n | |||
) |
out | The output string. It should be at least 25 characters long. NB: if it isn't at least 25 characters long (and provided you haven't done something stupid like pass in a value of n which is larger than the size of the string) then the output value will truncated to n characters | |
n | The maximum size of the string. |
Definition at line 1754 of file vircam_utils.c.
Referenced by vircam_imdither(), and vircam_interleave().