| |
void | apclust (ap_t *ap, int np, plstruct *plstr) |
Detect multiple objects from a given Plessey array. | |
| |
void | apinit (ap_t *ap) |
Initialise the ap structure. | |
void | apreinit (ap_t *ap) |
Re-initialise the ap structure. | |
void | apclose (ap_t *ap) |
Close ap structure. | |
| |
void | apline (ap_t *ap, float dat[], float conf[], float smoothed[], float smoothedc[], int j, unsigned char *bpm) |
Detect objects on a line of data. | |
| |
void | areals (ap_t *ap, int iareal[NAREAL]) |
Work out the areal profiles for an object. | |
| |
int | classify (vir_tfits *catalogue, cpl_propertylist *plist, float minsize, int cattype) |
Do star/galaxy classification. | |
| |
void | tabinit (ap_t *ap) |
Initialise catalogues. | |
int | do_seeing (ap_t *ap) |
Do seeing estimate. | |
int | process_results (ap_t *ap) |
Process results. | |
int | tabclose (ap_t *ap) |
Close the table structure. | |
void | tabinit_gen (int ncols, const char *ttype[], const char *tunit[], cpl_type tform[]) |
Initialise tables (generic). | |
int | do_seeing_gen (ap_t *ap, const char *col_ellipt, const char *col_pkht, char *col_areals[NAREAL]) |
Do seeing estimate (generic). | |
| |
void | tabinit_1 (void) |
Initialise type 1 catalogue. | |
int | do_seeing_1 (ap_t *ap) |
Do seeing estimate for type 1 catalogue. | |
int | process_results_1 (ap_t *ap) |
Process results for type 1 catalogue. | |
| |
void | tabinit_2 (void) |
Initialise type 2 catalogue. | |
int | do_seeing_2 (ap_t *ap) |
Do seeing estimate for type 2 catalogue. | |
int | process_results_2 (ap_t *ap) |
Process results for type 2 catalogue. | |
| |
void | tabinit_3 (void) |
Initialise type 1 catalogue. | |
int | do_seeing_3 (ap_t *ap) |
Do seeing estimate for type 3 catalogue. | |
int | process_results_3 (ap_t *ap) |
Process results for type 3 catalogue. | |
| |
void | tabinit_4 (ap_t *ap) |
Initialise type 4 catalogue (object mask). | |
int | do_seeing_4 (ap_t *ap) |
Dummy seeing routine for type 4 catalogue (object mask). | |
int | process_results_4 (ap_t *ap) |
Process results for type 4 catalogue (object mask). | |
int | tabclose_4 (ap_t *ap) |
Close object mask. | |
| |
int | imcore_background (ap_t *ap, int nbsize, float nullval) |
Model and create background map. | |
int | imcore_backstats (ap_t *ap, float nullval, int satonly, float *skymed, float *skysig, float *sat) |
Work out robust background estimate over a whole input image. | |
void | imcore_backest (ap_t *ap, float x, float y, float *skylev, float *skyrms) |
Work out estimated sky for a pixel position. | |
void | imcore_medsig (int *shist, int nh, int ist, int itarg, float *med, float *sig) |
Analyse histogram to work out median and sigma. | |
| |
int | imcore_conf (vir_fits *infile, vir_fits *conf, int ipix, float threshold, int icrowd, float rcore, int nbsize, int cattyp, float filtfwhm, vir_tfits **outcat) |
Do source extraction. | |
| |
int | extend (ap_t *ap, float xniso, float xbar, float ybar, float sxx, float sxy, float syy, float areal0, float tmax, float *ttotal) |
Do aperture integration. | |
| |
void | bfilt (float **xbuf, int nx, int ny) |
Do bilinear median and linear filtering on background values. | |
| |
int | imcore_opm (vir_fits *infile, vir_fits *conf, int ipix, float threshold, int nbsize, float filtfwhm, int niter) |
Create an object mask. | |
| |
void | overlp (ap_t *ap, float parm[IMNUM][NPAR], int *nbit, float xbar, float ybar, float total, int npix, float tmax) |
Deblend overlapping images. | |
| |
void | phopt (ap_t *ap, float parm[IMNUM][NPAR], int nbit, int naper, float apertures[], float cflux[], float badpix[], int nrcore) |
Do multiple profile fitting. | |
| |
float | imcore_exprad (float thresh, float peak, float areal0, float rcores[], int naper) |
Work out the exponential radius for an object. | |
float | imcore_kronrad (float areal0, float rcores[], float cflux[], int naper) |
Work out the Kron radius for an object. | |
float | imcore_petrad (float areal0, float rcores[], float cflux[], int naper) |
Work out the Petrosian. | |
void | imcore_flux (ap_t *ap, float parm[IMNUM][NPAR], int nbit, float apers[], float fluxes[], int nr, float rcores[], float rfluxes[]) |
Work out the fluxes for special radii. | |
| |
void | moments (ap_t *ap, float results[]) |
Do moments analysis on an object. | |
| |
void | seeing (ap_t *ap, int nrows, float *ellipt, float *pkht, float **areal, float *work, float *fwhm) |
Work out the median seeing. | |
| |
void | restack (ap_t *ap, int ip) |
Free information for an object from the ap structure. | |
void | terminate (ap_t *ap) |
Check for objects that have terminated. | |
void | apfu (ap_t *ap) |
Get rid of the largest contributor in an ap structure. | |
void | extract_data (ap_t *ap, int ip) |
Put data into the Plessey array for an object. |
These are the routines that do the source extraction.
void apclose | ( | ap_t * | ap | ) |
void apclust | ( | ap_t * | ap, | |
int | np, | |||
plstruct * | plstr | |||
) |
Detect multiple objects from a given Plessey array.
ap | The new input ap structure | |
np | The number of pixels within the input Plessey array | |
plstr | The Plessey array from the original structure with the lower detection threshold. |
Definition at line 71 of file apclust.c.
References apfu().
Referenced by overlp().
void apfu | ( | ap_t * | ap | ) |
Get rid of the largest contributor in an ap structure.
ap | The current ap structure |
Definition at line 192 of file terminate.c.
References restack().
Referenced by apclust(), imcore_conf(), and imcore_opm().
void apinit | ( | ap_t * | ap | ) |
Initialise the ap structure.
ap | The input ap structure |
Definition at line 64 of file apinit.c.
Referenced by imcore_conf(), imcore_opm(), and overlp().
void apline | ( | ap_t * | ap, | |
float | dat[], | |||
float | conf[], | |||
float | smoothed[], | |||
float | smoothedc[], | |||
int | j, | |||
unsigned char * | bpm | |||
) |
Detect objects on a line of data.
ap | The input ap structure | |
dat | The line of data | |
conf | The confidence map for the line of data | |
smoothed | A smoothed version of the data line. | |
smoothedc | A smoothed version of the confidence map line. | |
j | A number that tells you which row this is in the image | |
bpm | A bad pixel mask for that line |
Definition at line 75 of file apline.c.
Referenced by imcore_conf(), and imcore_opm().
void apreinit | ( | ap_t * | ap | ) |
Re-initialise the ap structure.
ap | The input ap structure |
Definition at line 141 of file apinit.c.
Referenced by overlp().
void areals | ( | ap_t * | ap, | |
int | iareal[NAREAL] | |||
) |
Work out the areal profiles for an object.
ap | The input ap structure | |
iareal | The output areal profile array |
Definition at line 67 of file areals.c.
Referenced by process_results_1(), process_results_2(), and process_results_3().
void bfilt | ( | float ** | xbuf, | |
int | nx, | |||
int | ny | |||
) |
Do bilinear median and linear filtering on background values.
xbuf | The input map to be smoothed | |
nx | The X dimension of the map | |
ny | The Y dimension of the map |
Definition at line 70 of file imcore_filter.c.
Referenced by imcore_background().
int classify | ( | vir_tfits * | catalogue, | |
cpl_propertylist * | plist, | |||
float | minsize, | |||
int | cattype | |||
) |
Do star/galaxy classification.
catalogue | The input imcore catalogue | |
plist | The propertylist from the primary header of the input image | |
minsize | The minimum size in pixels of objects to be used in the analysis | |
cattype | The catalogue type |
VIR_OK | If everything is OK | |
VIR_FATAL | If the input catalogue is unrecognised. |
Definition at line 204 of file classify.c.
References vircam_pfits_get_exptime(), vircam_tfits_get_ehu(), and vircam_tfits_get_table().
Referenced by vircam_imcore().
int do_seeing | ( | ap_t * | ap | ) |
Do seeing estimate.
ap | The current ap structure |
VIR_OK | If all went well | |
VIR_FATAL | If catalogue type is unrecognised |
Definition at line 117 of file create_table.c.
References do_seeing_1(), do_seeing_2(), do_seeing_3(), and do_seeing_4().
Referenced by imcore_conf().
int do_seeing_1 | ( | ap_t * | ap | ) |
Do seeing estimate for type 1 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. Currently this is the only return value |
Definition at line 175 of file create_table_1.c.
References do_seeing_gen().
Referenced by do_seeing().
int do_seeing_2 | ( | ap_t * | ap | ) |
Do seeing estimate for type 2 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. Currently this is the only return value |
Definition at line 275 of file create_table_2.c.
References do_seeing_gen().
Referenced by do_seeing().
int do_seeing_3 | ( | ap_t * | ap | ) |
Do seeing estimate for type 3 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. Currently this is the only return value |
Definition at line 154 of file create_table_3.c.
References do_seeing_gen().
Referenced by do_seeing().
int do_seeing_4 | ( | ap_t * | ap | ) |
Dummy seeing routine for type 4 catalogue (object mask).
ap | The current ap structure |
VIR_OK | If all is well. Currently this is the only return value |
Definition at line 108 of file create_table_4.c.
Referenced by do_seeing().
int do_seeing_gen | ( | ap_t * | ap, | |
const char * | col_ellipt, | |||
const char * | col_pkht, | |||
char * | col_areals[NAREAL] | |||
) |
Do seeing estimate (generic).
ap | The current ap structure | |
col_ellipt | The name of the column for ellipticity | |
col_pkht | The name of the column for the peak height | |
col_areals | The array of names of the areal profile columns |
VIR_OK | If all is ok. This is currently the only value. |
Definition at line 325 of file create_table.c.
References seeing().
Referenced by do_seeing_1(), do_seeing_2(), and do_seeing_3().
int extend | ( | ap_t * | ap, | |
float | xniso, | |||
float | xbar, | |||
float | ybar, | |||
float | sxx, | |||
float | sxy, | |||
float | syy, | |||
float | areal0, | |||
float | tmax, | |||
float * | ttotal | |||
) |
Do aperture integration.
ap | The current ap structure | |
xniso | The isophotal flux | |
xbar | The X position of the object | |
ybar | The Y position of the object | |
sxx | Second moment in X | |
syy | Second moment in Y | |
sxy | Second moment cross term | |
areal0 | The first areal profile | |
tmax | The peak flux of the object | |
ttotal | The output total integrated flux |
VIR_OK | If all went OK. Currently this is the only value. |
Definition at line 89 of file imcore_extend.c.
Referenced by process_results_1(), and process_results_2().
void extract_data | ( | ap_t * | ap, | |
int | ip | |||
) |
Put data into the Plessey array for an object.
ap | The current ap structure | |
ip | The parent in question |
Definition at line 248 of file terminate.c.
Referenced by terminate().
void imcore_backest | ( | ap_t * | ap, | |
float | x, | |||
float | y, | |||
float * | skylev, | |||
float * | skyrms | |||
) |
Work out estimated sky for a pixel position.
ap | The current ap structure | |
x | The X position in question | |
y | The Y position in question | |
skylev | Output sky level at x,y | |
skyrms | Output sky noise at x,y |
Definition at line 438 of file imcore_background.c.
Referenced by process_results_1(), and process_results_2().
int imcore_background | ( | ap_t * | ap, | |
int | nbsize, | |||
float | nullval | |||
) |
Model and create background map.
ap | The current ap structure | |
nbsize | The size of the cells in pixels | |
nullval | A null value used to flag bad pixels |
VIR_OK | If all went well. This is currently the only value. |
Definition at line 81 of file imcore_background.c.
References bfilt(), and imcore_medsig().
Referenced by imcore_conf(), and imcore_opm().
int imcore_backstats | ( | ap_t * | ap, | |
float | nullval, | |||
int | satonly, | |||
float * | skymed, | |||
float * | skysig, | |||
float * | sat | |||
) |
Work out robust background estimate over a whole input image.
ap | The current ap structure | |
nullval | A null value used to flag bad pixels | |
satonly | If set, then only the saturation level will be computed. | |
skymed | Output sky median | |
skysig | Output sky noise | |
sat | Output saturation level |
VIR_OK | If all went well. | |
VIR_WARN | If there aren't enough good values to do the calculation |
Definition at line 291 of file imcore_background.c.
References imcore_medsig().
Referenced by imcore_conf(), and imcore_opm().
int imcore_conf | ( | vir_fits * | infile, | |
vir_fits * | conf, | |||
int | ipix, | |||
float | threshold, | |||
int | icrowd, | |||
float | rcore, | |||
int | nbsize, | |||
int | cattyp, | |||
float | filtfwhm, | |||
vir_tfits ** | outcat | |||
) |
Do source extraction.
infile | The input image | |
conf | The input 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 | |
outcat | The output table of object |
VIR_OK | if everything is ok | |
VIR_WARN,VIR_FATAL | errors in the called routines |
Definition at line 146 of file imcore_conf.c.
References apfu(), apinit(), apline(), do_seeing(), imcore_background(), imcore_backstats(), tabclose(), tabinit(), terminate(), vircam_fits_get_ehu(), vircam_fits_get_image(), vircam_fits_get_nexten(), vircam_fits_get_phu(), vircam_pfits_get_gain(), vircam_tabwcs(), and vircam_tfits_wrap().
Referenced by vircam_imcore().
float imcore_exprad | ( | float | thresh, | |
float | peak, | |||
float | areal0, | |||
float | rcores[], | |||
int | naper | |||
) |
Work out the exponential radius for an object.
thresh | The detection threshold | |
peak | The peak flux of the object | |
areal0 | The lowest level areal profile for the object | |
rcores | The list of aperture radii used | |
naper | The number of radii used |
Definition at line 76 of file imcore_radii.c.
Referenced by process_results_2().
void imcore_flux | ( | ap_t * | ap, | |
float | parm[IMNUM][NPAR], | |||
int | nbit, | |||
float | apers[], | |||
float | fluxes[], | |||
int | nr, | |||
float | rcores[], | |||
float | rfluxes[] | |||
) |
Work out the fluxes for special radii.
ap | The current ap structure | |
parm | The parameters for each object already detected | |
nbit | The number of detected objects in the current Plessey structure. | |
apers | The radii of the standard apertures | |
fluxes | The fluxes computed through the standard apertures | |
nr | The number of special apertures | |
rcores | The radii the special apertures | |
rfluxes | The fluxes computed through the special apertures. |
Definition at line 250 of file imcore_radii.c.
Referenced by process_results_2().
float imcore_kronrad | ( | float | areal0, | |
float | rcores[], | |||
float | cflux[], | |||
int | naper | |||
) |
Work out the Kron radius for an object.
areal0 | The lowest level areal profile for the object | |
rcores | The list of aperture radii used | |
cflux | The aperture fluxes for each radius | |
naper | The number of radii used |
Definition at line 122 of file imcore_radii.c.
Referenced by process_results_2().
void imcore_medsig | ( | int * | shist, | |
int | nh, | |||
int | ist, | |||
int | itarg, | |||
float * | med, | |||
float * | sig | |||
) |
Analyse histogram to work out median and sigma.
shist | The input histogram | |
nh | The number of bins in the histogram | |
ist | The first bin position that we will look at | |
itarg | The target value for the summation. | |
med | Output median | |
sig | Output sigma from the first quartile. |
Definition at line 521 of file imcore_background.c.
Referenced by imcore_background(), and imcore_backstats().
int imcore_opm | ( | vir_fits * | infile, | |
vir_fits * | conf, | |||
int | ipix, | |||
float | threshold, | |||
int | nbsize, | |||
float | filtfwhm, | |||
int | niter | |||
) |
Create an object mask.
infile | The input image. The output object mask will be stored in the pixel mask for this image. | |
conf | The input confidence map | |
ipix | The minimum allowable size of an object | |
threshold | The detection threshold in sigma above sky | |
nbsize | The smoothing box size for background map estimation | |
filtfwhm | The FWHM of the smoothing kernel in the detection algorithm | |
niter | The number of detection iterations. |
VIR_OK | if everything is ok | |
VIR_WARN,VIR_FATAL | errors in the called routines |
Definition at line 112 of file imcore_opm.c.
References apfu(), apinit(), apline(), imcore_background(), imcore_backstats(), tabclose(), tabinit(), terminate(), vircam_fits_get_ehu(), vircam_fits_get_image(), vircam_fits_get_nexten(), and vircam_pfits_get_gain().
Referenced by vircam_opm().
float imcore_petrad | ( | float | areal0, | |
float | rcores[], | |||
float | cflux[], | |||
int | naper | |||
) |
Work out the Petrosian.
areal0 | The lowest level areal profile for the object | |
rcores | The list of aperture radii used | |
cflux | The aperture fluxes for each radius | |
naper | The number of radii used |
Definition at line 176 of file imcore_radii.c.
Referenced by process_results_2().
void moments | ( | ap_t * | ap, | |
float | results[] | |||
) |
Do moments analysis on an object.
ap | The current ap structure | |
results | The output array with the moments results. |
Definition at line 65 of file moments.c.
Referenced by process_results_1(), process_results_2(), and process_results_3().
void overlp | ( | ap_t * | ap, | |
float | parm[IMNUM][NPAR], | |||
int * | nbit, | |||
float | xbar, | |||
float | ybar, | |||
float | total, | |||
int | npix, | |||
float | tmax | |||
) |
Deblend overlapping images.
ap | The current input ap structure | |
parm | The parameter array for the deblended objects | |
nbit | The output number of objects found in the deblended object | |
xbar | The X position of the input object | |
ybar | The Y position of the input object | |
total | The total flux of the input object | |
npix | The number of pixels in the original object | |
tmax | The peak flux of the original object |
Definition at line 98 of file imcore_overlp.c.
References apclose(), apclust(), apinit(), and apreinit().
Referenced by process_results_1(), and process_results_2().
void phopt | ( | ap_t * | ap, | |
float | parm[IMNUM][NPAR], | |||
int | nbit, | |||
int | naper, | |||
float | apertures[], | |||
float | cflux[], | |||
float | badpix[], | |||
int | nrcore | |||
) |
Do multiple profile fitting.
ap | The current ap structure | |
parm | The input/output object parameters | |
nbit | The number of objects detected in the current Plessey structure | |
naper | The number of apertures | |
apertures | Array of aperture radii | |
cflux | Array of aperture fluxes | |
badpix | Array saying how many bad pixels were included in the data for each object at each radius | |
nrcore | The index of the apertures array that defines where the radius = Rcore |
Definition at line 91 of file imcore_phopt.c.
Referenced by process_results_1(), and process_results_2().
int process_results | ( | ap_t * | ap | ) |
Process results.
ap | The current ap structure |
VIR_OK | If all went well | |
VIR_FATAL | If catalogue type is unrecognised |
Definition at line 171 of file create_table.c.
References process_results_1(), process_results_2(), process_results_3(), and process_results_4().
Referenced by terminate().
int process_results_1 | ( | ap_t * | ap | ) |
Process results for type 1 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. | |
VIR_FATAL | If peak flux < 0 |
Definition at line 223 of file create_table_1.c.
References areals(), extend(), imcore_backest(), moments(), overlp(), and phopt().
Referenced by process_results().
int process_results_2 | ( | ap_t * | ap | ) |
Process results for type 2 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. | |
VIR_FATAL | If peak flux < 0 |
Definition at line 323 of file create_table_2.c.
References areals(), extend(), imcore_backest(), imcore_exprad(), imcore_flux(), imcore_kronrad(), imcore_petrad(), moments(), overlp(), and phopt().
Referenced by process_results().
int process_results_3 | ( | ap_t * | ap | ) |
Process results for type 3 catalogue.
ap | The current ap structure |
VIR_OK | If all is well. | |
VIR_FATAL | If peak flux < 0 |
Definition at line 203 of file create_table_3.c.
References areals(), and moments().
Referenced by process_results().
int process_results_4 | ( | ap_t * | ap | ) |
Process results for type 4 catalogue (object mask).
ap | The current ap structure |
VIR_OK | If all is well. This is currently the only value |
Definition at line 143 of file create_table_4.c.
Referenced by process_results().
void restack | ( | ap_t * | ap, | |
int | ip | |||
) |
Free information for an object from the ap structure.
ap | The current ap structure | |
ip | The parent number for the object |
Definition at line 64 of file terminate.c.
Referenced by apfu(), and terminate().
void seeing | ( | ap_t * | ap, | |
int | nrows, | |||
float * | ellipt, | |||
float * | pkht, | |||
float ** | areal, | |||
float * | work, | |||
float * | fwhm | |||
) |
Work out the median seeing.
ap | The current ap structure | |
nrows | The number rows in the object catalogue | |
ellipt | The array of ellipticities from the object catalogue | |
pkht | The array of peak heights from the object catalogue | |
areal | The array of areal profiles from the object catalogue | |
work | A work array (should probably allocate this local at some stage) | |
fwhm | The output FWHM estimate |
Definition at line 80 of file seeing.c.
Referenced by do_seeing_gen().
int tabclose | ( | ap_t * | ap | ) |
Close the table structure.
ap | The current ap structure |
VIR_OK | If all went well | |
VIR_FATAL | If catalogue type is unrecognised |
Definition at line 225 of file create_table.c.
References tabclose_4().
Referenced by imcore_conf(), and imcore_opm().
int tabclose_4 | ( | ap_t * | ap | ) |
Close object mask.
ap | The current ap structure |
VIR_OK | If all is well. This is currently the only value |
Definition at line 193 of file create_table_4.c.
Referenced by tabclose().
void tabinit | ( | ap_t * | ap | ) |
Initialise catalogues.
ap | The current ap structure |
Definition at line 65 of file create_table.c.
References tabinit_1(), tabinit_2(), tabinit_3(), and tabinit_4().
Referenced by imcore_conf(), imcore_opm(), and vircam_dummy_catalogue().
void tabinit_1 | ( | void | ) |
Initialise type 1 catalogue.
Definition at line 136 of file create_table_1.c.
References tabinit_gen().
Referenced by tabinit().
void tabinit_2 | ( | void | ) |
Initialise type 2 catalogue.
Definition at line 235 of file create_table_2.c.
References tabinit_gen().
Referenced by tabinit().
void tabinit_3 | ( | void | ) |
Initialise type 1 catalogue.
Definition at line 115 of file create_table_3.c.
References tabinit_gen().
Referenced by tabinit().
void tabinit_4 | ( | ap_t * | ap | ) |
Initialise type 4 catalogue (object mask).
ap | The current ap structure |
Definition at line 62 of file create_table_4.c.
Referenced by tabinit().
void tabinit_gen | ( | int | ncols, | |
const char * | ttype[], | |||
const char * | tunit[], | |||
cpl_type | tform[] | |||
) |
Initialise tables (generic).
ncols | The number of columns in the table | |
ttype | Array of column names for FITS table | |
tunit | Array of units for each of the columns | |
tform | Array of formats for each of the columns as defined in the FITS standard |
Definition at line 272 of file create_table.c.
Referenced by tabinit_1(), tabinit_2(), and tabinit_3().
void terminate | ( | ap_t * | ap | ) |
Check for objects that have terminated.
ap | The current ap structure |
Definition at line 130 of file terminate.c.
References extract_data(), process_results(), and restack().
Referenced by imcore_conf(), and imcore_opm().