PointSourceDetector Class Reference

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes

Friends


Detailed Description

Bayesian detection of point-like sources in sets of dithered frames.

First, construct a SignificanceMap assuming a point-like source on a grid in x,y,wavelength on sky. Use ProjectorSet to obtain the resolution elements on the CCDs in the dither set that are affected and compute their significance.

Then, segment the SignificanceMap using an ImSegmenter. For the segments with point-like morphology, go ahead and construct a full model of a point-like source and compare against the data in a chi2-sense.


Member Enumeration Documentation

When finding the optimal point source parameters for each segment, this value determines which strategy will be used.

Enumerator:
dontOptimize 
optimizeForSigma 
optimizeForChi2 

Constructor & Destructor Documentation

PointSourceDetector::PointSourceDetector ( const DitherEnvironment DE  )  [inline]

Member Function Documentation

void PointSourceDetector::detect (  ) 

Run the detection process for point sources: Compute the significance map, segment it, and compare the segments against point source models. Output catalog and cutout images.

References computeSignificanceMap(), DE_, DetectOptions::dump_segments, ImageSegmenter::expand(), DetectOptions::expand_sigma, g, DitherEnvironment::get_detect_parameters(), get_optimizer_strategy(), optimizeSegments(), placePointSourceModels(), DetectOptions::read_psigma, ImageSegmenter::segment(), DetectOptions::sigma, DetectOptions::xdetect_file, and DetectOptions::xdetect_size.

Referenced by main().

SignificanceMap PointSourceDetector::computeSignificanceMap (  )  const [protected]

Compute the significance map for a set of dithes by testing for the presence of a point source on coarse grid on sky and wavelength. The significance map contains the significance for a detection above the null-hypothesis that there's nothing there. Only the total amount of flux is tested, not the compatibility with a point source on sky or the CCD.

Compute the significance map for a set of dithes by testing for the presence of a point source on coarse grid on sky and wavelength. The significance map contains the significance for a detection above the null-hypothesis that there's nothing there. Only the total amount of flux is tested (the compatibility with point source on-sky), not the compatibility with a point source on the CCD. The latter is done in optimizeForChi2().

References PointSource::DetectionData::ap_sigma, DetectOptions::aperture, SignificanceMap::clear(), compute_sigma(), PointSource::dd, DE_, PointSource::debug_reselem_list(), DetectOptions::dump_segments, DetectOptions::dump_sigma, ProjectorSet::findResElemsForPointSourceInAperture(), g, DitherEnvironment::get_detect_parameters(), DitherEnvironment::get_grid_limits(), DitherEnvironment::get_output_basename(), DitherEnvironment::get_projector_set(), SkySampleLimits::index_to_l(), SkySampleLimits::index_to_x(), SkySampleLimits::index_to_y(), PointSource::DetectionData::l, SkySampleLimits::lmax, SkySampleLimits::lmin, SkySampleLimits::lstep, SkySampleLimits::nlstep, SkySampleLimits::nxstep, SkySampleLimits::nystep, P, DetectOptions::psf_size, SignificanceMap::set_sigma(), DetectOptions::sigma, SignificanceMap::write_significance_map(), SkySampleLimits::x_to_index(), DetectOptions::xdetect_file, SkySampleLimits::xmax, SkySampleLimits::xmin, PointSource::DetectionData::xs, SkySampleLimits::xstep, SkySampleLimits::ymax, SkySampleLimits::ymin, PointSource::DetectionData::ys, and SkySampleLimits::ystep.

Referenced by detect().

void PointSourceDetector::optimizeSegments ( list< ImSegment > &  segments,
const optimizerStrategy  opt 
) [protected]
PointSource PointSourceDetector::optimizeModelOnGrid ( const ImSegment s,
std::ostream &  out,
const optimizerStrategy  opt 
) [protected]
PointSource PointSourceDetector::optimizeModelWithSimplex ( const ImSegment s,
std::ostream &  out,
const optimizerStrategy  opt 
) [protected]
void PointSourceDetector::placePointSourceModels ( void   )  [protected]

Calculate chi2 for point-source models at a list of {x,y,lambda} on sky. No optimization is carried out. The list of positions are read from the cross-detection file.

Calculate chi2 for a point-source model at a list of {x,y,lambda} on sky. No optimization is carried out. The list of positions are read from the cross-detection file.

References DE_, g, generatePointSource(), DitherEnvironment::get_detect_parameters(), log_detection(), log_photometry(), nline_, DetectOptions::outputname, photometry(), DetectOptions::simsrc, DitherEnvironment::write_cmd_line(), DetectOptions::write_cutouts, writeCutout(), and DetectOptions::xdetect_file.

Referenced by detect().

PointSource PointSourceDetector::generatePointSource ( const float  source_x,
const float  source_y,
const float  source_l 
) const [protected]
MArray< float, 2 > PointSourceDetector::make_image ( const PointSource data  )  const [protected]

Create an Image of all fibers exceeding g.flux_thresh drawing the model image, the data and the errors. px and py are the size of the PSF in pixels.

Create an Image of all fibers exceeding detect_pars_.flux_thresh drawing the model image, the data and the errors. px and py are the size of the PSF in pixels.

References PooledList< T >::begin(), consider_res_elem(), count_res_elems(), PointSource::dd, DE_, PooledList< T >::end(), PointSource::DetectionData::fdat_fmod, Pixel::flux, VFrame::get_distortion(), VFrame::get_fibermodel(), FiberModel::get_single_fiberflux(), DitherEnvironment::get_vframe(), ResElem::npix(), ResElem::p, PointSource::PointSourceModel, PointSource::px, PointSource::py, ResElem::tu, vframes_, Pixel::x, ResElem::x, Pixel::y, and ResElem::y.

Referenced by writeCutout().

void PointSourceDetector::make_image_header ( const PointSource data,
FitsHeader &  h 
) const [protected]
void PointSourceDetector::writeCutout ( const PointSource best_PointSource,
const int  id 
) const [protected]
bool PointSourceDetector::consider_res_elem ( const ResElem res  )  const [inline, protected]

check the properties of a resolution element to see if it should be dropped or included in the calculation of sigma, chi2, ...

References ResElem::apfrac, detect_pars_, DetectOptions::flux_thresh, and ResElem::ignore.

Referenced by compute_chi2(), compute_chi2_stacked(), compute_sigma(), count_res_elems(), equivalent_width(), make_image(), make_image_header(), normalize_model(), and photometry().

bool PointSourceDetector::detection_criteria ( const PointSource data  )  const [protected]
float PointSourceDetector::get_normflux ( float  value,
int  x,
int  y 
) const [protected]

Referenced by compute_chi2().

void PointSourceDetector::normalize_model ( PointSource data  )  const [protected]
void PointSourceDetector::compute_chi2 ( PointSource data  )  const [protected]

compute best fit chisquare and flux value of tested PointSource Input:

  • PointSource data structure Output: modifies PointSource structure
  • total flux of PointSource on the chip in ADU from data: PointSource.dataflux
  • best fit total flux of PointSource on the chip in ADU from model: PointSource.modflux
  • fraction of flux on the sky which is on the chip: PointSource.fluxfrac
  • degrees of freedom used to calculate chi^2: PointSource.deg_f
  • reduced chi^2 of best-fitting model: PointSource.chi2

References ResElem::apfrac, PooledList< T >::begin(), PointSource::DetectionData::chi2, PointSource::DetectionData::chi2_w, consider_res_elem(), PointSource::DetectionData::dataflux, PointSource::dd, PointSource::DetectionData::deg_f, ResElem::dflux, ResElem::dfluxe, PooledList< T >::end(), ResElem::ext, PointSource::DetectionData::fdat_fmod, Pixel::flux, PointSource::DetectionData::fluxfrac, get_normflux(), ResElem::mflux, PointSource::DetectionData::modflux, ResElem::npix(), ResElem::p, PointSource::PointSourceModel, ResElem::tu, vframes_, Pixel::x, and Pixel::y.

Referenced by generatePointSource().

void PointSourceDetector::compute_chi2_stacked ( PointSource data  )  const [protected]

compute best fit chisquare and flux value of tested PointSource using a stacked image Input:

  • PointSource data structure Output: modifies PointSource structure
  • degrees of freedom used to calculate chi^2: PointSource.deg_f_s
  • reduced chi^2 of best-fitting model: PointSource.chi2_s

References ResElem::apfrac, PooledList< T >::begin(), PointSource::DetectionData::chi2_s, consider_res_elem(), PointSource::dd, PointSource::DetectionData::deg_f_s, PooledList< T >::end(), PointSource::DetectionData::fdat_fmod, Pixel::flux, ResElem::npix(), ResElem::p, PointSource::PointSourceModel, PointSource::px, PointSource::py, ResElem::tu, vframes_, Pixel::x, ResElem::x, Pixel::y, and ResElem::y.

Referenced by generatePointSource().

void PointSourceDetector::compute_sigma ( PointSource data  )  const [protected]

compute significance of detection of tested PointSource also set ignore flag in res elements that have continuum detections Input:

  • PointSource data structure Output: Modifies PointSource structure
  • significance of detection: PointSource.sigma
  • left and right continuum values

compute significance of detection at a given location on the sky (and wavelength).

Input:

  • PointSource data structure Output: Modifies PointSource structure
  • significance of detection: PointSource.sigma
  • left and right continuum values

This is a hot-spot in the detection code. Performance needs to be monitored/improved.

References PointSource::DetectionData::ap_sigma, ResElem::apfrac, PooledList< T >::begin(), consider_res_elem(), PointSource::DetectionData::cont, ResElem::cont, PointSource::DetectionData::dcont, PointSource::dd, PooledList< T >::end(), PointSource::DetectionData::fb_sigma, ResElem::npix(), ResElem::p, PointSource::PointSourceModel, ResElem::tf, ResElem::tu, vframes_, ResElem::x, Pixel::x, and Pixel::y.

Referenced by computeSignificanceMap(), and generatePointSource().

void PointSourceDetector::compute_probabilities ( PointSource data  )  const [protected]

compute probabilities also set ignore flag in res elements that have continuum detections Input:

References PointSource::DetectionData::chi2, PointSource::DetectionData::chi2_s, PointSource::dd, PointSource::DetectionData::deg_f, PointSource::DetectionData::deg_f_s, gammq(), PointSource::DetectionData::gammq, and PointSource::DetectionData::gammq_s.

Referenced by generatePointSource().

void PointSourceDetector::equivalent_width ( PointSource data  )  const [protected]
void PointSourceDetector::photometry ( PointSource data  )  const [protected]

do photometry on a detected point source detection

Input:

  • PointSource data structure Output: Modifies PointSource structure
  • light center of detection: PointSource.x, PointSource.y

Note: Contrary to the name this routine currently only calculates the light center

perform weighted aperture photometry on a detected point source

Input:

  • PointSource data structure Output: Modifies PointSource structure
  • light center of detection: PointSource.x, PointSource.y

References ResElem::apfrac, PooledList< T >::begin(), consider_res_elem(), PointSource::dd, DE_, PointSource::PhotometryData::dwflux, PooledList< T >::end(), PointSource::DetectionData::fluxfrac, PointSource::PhotometryData::fluxfrac, VFrame::get_cont(), DitherEnvironment::get_fluxnorm(), DitherEnvironment::get_vframe(), PointSource::PhotometryData::l, ResElem::l, ResElem::npix(), ResElem::p, PointSource::pd, PointSource::PointSourceModel, ResElem::tf, ResElem::tu, vframes_, PointSource::PhotometryData::wflux, PointSource::PhotometryData::x, ResElem::x, Pixel::x, ResElem::xsky, PointSource::PhotometryData::y, Pixel::y, and ResElem::ysky.

Referenced by optimizeSegments(), and placePointSourceModels().

int PointSourceDetector::count_res_elems ( const PointSource data  )  const [protected]
void PointSourceDetector::log_detection ( std::ostream &  out,
const int  sid,
const PointSource ps 
) [protected]

Write data for the current model canididate to a log file (the .det file)

Write data for the current model candidate to a log file (the detect_line.dat file)

References PointSource::dd, and nline_.

Referenced by optimizeModelOnGrid(), optimizeSegments(), and placePointSourceModels().

void PointSourceDetector::log_photometry ( std::ostream &  out,
const int  sid,
const PointSource ps 
) [protected]

Write photometry for the current model candidate to a detect_phot.dat file

References PointSource::pd.

Referenced by optimizeSegments(), and placePointSourceModels().

float PointSourceDetector::back_to_flambda ( const float  photcount,
const float  tint,
const float  lam 
) [protected]

References c.

Referenced by optimizeSegments().

void PointSourceDetector::log_outflux ( std::ostream &  out,
const float  pxx,
const float  pyy,
const float  photcount,
const float  photdcount,
const float  photflux,
const float  photdflux 
) [protected]

Referenced by optimizeSegments().

PointSourceDetector::optimizerStrategy PointSourceDetector::get_optimizer_strategy ( const DetectOptions g  )  [protected]

Friends And Related Function Documentation

friend class OptimizePointSource [friend]

Field Documentation

const vector<VFrame >& PointSourceDetector::vframes_ [protected]
int PointSourceDetector::nline_ [protected]

Generated on 4 Nov 2015 for CURE by  doxygen 1.6.1