Object Detection and Photometry Class
Possible usage includes:
For examples of usage see testphot.cpp
typedef ltl::MArray<float,2> tcs_photometry::Photometry::MImage |
typedef ltl::MArray<char, 2> tcs_photometry::Photometry::MMask |
typedef std::list<Object*> tcs_photometry::Photometry::ObjectList |
tcs_photometry::Photometry::Photometry | ( | const PhotometryParams & | pp | ) | [inline] |
void tcs_photometry::Photometry::SetParams | ( | const PhotometryParams & | pp | ) | [inline] |
References pp_.
Referenced by tcs_photometry::GuiderPhot::SetParams().
MImage tcs_photometry::Photometry::copy_square | ( | const MImage & | A, | |
const int | minx, | |||
const int | maxx, | |||
const int | miny, | |||
const int | maxy | |||
) |
Copy out a rectangular region out of an image. The new image retains the index ranges corresponding to the coordinates within the original image.
Copy out a square region containing the circle centered at x,y with radius. The new image retains the index ranges corresponding to the coordinates within the original image.
Referenced by main().
int tcs_photometry::Photometry::subtract_background_fit | ( | MImage & | I | ) |
subtract the background from an image using a k-th order surface fit to the image values. Also computes the RMS within the image.
References tcs_photometry::PhotometryParams::bgorder_, tcs_photometry::PhotometryParams::nanval_, and pp_.
Referenced by main().
int tcs_photometry::Photometry::subtract_background_fit_annulus | ( | MImage & | I | ) |
subtract the background from an image using a 2nd order surface fit to the image values in an annulus. Also computes the RMS within that annulus.
subtract the background from an image using a first-order surface fit to the image values in an annulus. Also computes the RMS within that annulus.
References bg_, elliptical_annulus_mask(), pp_, sigma_bg_, tcs_photometry::PhotometryParams::sky_annulus_, and UNRELIABLE_BACKGROUND.
Referenced by main().
Photometry::ObjectList tcs_photometry::Photometry::find_stars | ( | const MImage & | I | ) |
threshold the image at some level above the background noise, segment the resulting image mask and assemble Objects
out of consecutive regions.
References assemble(), tcs_photometry::PhotometryParams::detect_sigma_, pp_, and sigma_bg_.
Referenced by main().
int tcs_photometry::Photometry::kron_aperture_phot | ( | const MImage & | I, | |
const Object & | o, | |||
PhotData & | pd, | |||
AperturePhotResults & | res | |||
) | [inline] |
Photometry in Kron-like aperture (aperture size based on a constant times the intensity-weighted first moment of the image)
References aperture_phot(), tcs_photometry::Object::icx_, tcs_photometry::Object::icy_, tcs_photometry::Object::ir1_, tcs_photometry::PhotData::kron_aper_, tcs_photometry::PhotometryParams::kron_factor_, pp_, and tcs_photometry::PhotometryParams::sky_annulus_.
Referenced by main().
int tcs_photometry::Photometry::fixed_aperture_phot | ( | const MImage & | I, | |
const Object & | o, | |||
PhotData & | pd, | |||
AperturePhotResults & | res | |||
) | [inline] |
Photometry in Kron-like aperture (aperture size based on a constant times the intensity-weighted first moment of the image)
References aperture_phot(), tcs_photometry::PhotData::fixed_aper_, tcs_photometry::Object::icx_, tcs_photometry::Object::icy_, pp_, and tcs_photometry::PhotometryParams::sky_annulus_.
Referenced by main().
int tcs_photometry::Photometry::fit_bivariate_gaussian | ( | MImage & | A, | |
const float | x, | |||
const float | y, | |||
const int | radius, | |||
FitPars & | fp | |||
) |
Fit a bivariate Gaussian ellipsoid to the image of a source
References a, b, bg_, tcs_photometry::FitPars::chi2_, tcs_photometry::FitPars::dflux_, tcs_photometry::FitPars::dm_, tcs_photometry::FitPars::e_gauss_par_, FIT_RADIUS_TOO_BIG, tcs_photometry::FitPars::flux_, tcs_photometry::FitPars::gauss_par_, tcs_photometry::FitPars::m_, tcs_photometry::PhotometryParams::magzero_, MAX_GAUSSFIT_RADIUS, OBJECT_AT_IMAGE_BORDER, and pp_.
Referenced by main().
int tcs_photometry::Photometry::aperture_phot | ( | const MImage & | Image, | |
const float | x, | |||
const float | y, | |||
const float | aper, | |||
const float | sky1, | |||
const float | sky2, | |||
PhotData & | pd, | |||
AperturePhotResults & | res | |||
) | [protected] |
Circular aperture photometry Object center: x,y Aperture radius in pixels: aper Beginning and end of sky annulus: sky1, sky2
References check_variance(), tcs_photometry::AperturePhotResults::df_, tcs_photometry::AperturePhotResults::dm_, tcs_photometry::AperturePhotResults::dsky_, elliptical_annulus_mask(), tcs_photometry::AperturePhotResults::f_, tcs_photometry::PhotometryParams::gain_, integrate_soft_e_mask_fixed(), tcs_photometry::AperturePhotResults::m_, tcs_photometry::PhotometryParams::magzero_, OBJECT_AT_IMAGE_BORDER, OBJECT_IN_BAD_IMAGE_REGION, pp_, tcs_photometry::PhotData::setflag(), and tcs_photometry::AperturePhotResults::sky_.
Referenced by fixed_aperture_phot(), and kron_aperture_phot().
Photometry::ObjectList tcs_photometry::Photometry::assemble | ( | MMask & | M, | |
const MImage & | I | |||
) | [protected] |
segment the image into consecutive regions above threshold
References tcs_photometry::Object::evaluate(), tcs_photometry::Object::icx_, tcs_photometry::Object::icy_, tcs_photometry::PhotometryParams::magzero_, mark_pixels(), tcs_photometry::PhotometryParams::maxsize_, tcs_photometry::PhotometryParams::npixmin_, tcs_photometry::Object::pixnum(), pp_, and tcs_photometry::PhotometryParams::saturation_.
Referenced by find_stars().
void tcs_photometry::Photometry::mark_pixels | ( | Object & | obj, | |
const int | x, | |||
const int | y, | |||
MMask & | M, | |||
const MImage & | I | |||
) | [protected] |
recursively add pixels surrounding a pixel (x,y) to an object if they are flagged in the mask as lying above threshold
References tcs_photometry::Object::addpixel(), tcs_photometry::PhotometryParams::maxsize_, tcs_photometry::Object::pixnum(), and pp_.
Referenced by assemble().
float tcs_photometry::Photometry::integrate_soft_e_mask_fixed | ( | const MImage & | I, | |
const float | sky, | |||
float | xc, | |||
float | yc, | |||
float | ap, | |||
const int | subsample, | |||
float * | area | |||
) | [protected] |
Integrate the flux within an elliptical aperture by subsampling the image and computing the intersection of the ellipse with the subsampled pixels.
Referenced by aperture_phot().
Photometry::MImage tcs_photometry::Photometry::elliptical_mask | ( | const MImage & | I, | |
const float | xc, | |||
const float | yc, | |||
const float | a1, | |||
const float | b1, | |||
const float | pa | |||
) | [protected] |
Return an image multiplied by the characteristic function of an ellipse All pixels outside the ellipse will be set to zero, pixels within the ellipse will retain their values.
References tcs_photometry::PhotometryParams::nanval_, and pp_.
Photometry::MImage tcs_photometry::Photometry::elliptical_annulus_mask | ( | const MImage & | I, | |
const float | xc, | |||
const float | yc, | |||
const float | a1, | |||
const float | b1, | |||
const float | a2, | |||
const float | b2, | |||
const float | pa | |||
) | [protected] |
Return an image multiplied by the characteristic function of an elliptical annulus. All pixels outside the annulus will be set to zero. Pixels within the annulus will retain their values.
References tcs_photometry::PhotometryParams::nanval_, and pp_.
Referenced by aperture_phot(), and subtract_background_fit_annulus().
bool tcs_photometry::Photometry::check_variance | ( | const MImage & | I | ) | [protected] |
make sure the image looks OK by looking at variances ...
Referenced by aperture_phot().
PhotometryParams tcs_photometry::Photometry::pp_ [protected] |
double tcs_photometry::Photometry::bg_ [protected] |
Referenced by fit_bivariate_gaussian(), Photometry(), and subtract_background_fit_annulus().
double tcs_photometry::Photometry::sigma_bg_ [protected] |
Referenced by find_stars(), Photometry(), and subtract_background_fit_annulus().