This class maps the flux distribution of a point-like source on the sky (either a Moffat or a Gaussian) to the flux pattern registered on a VIRUS frame.
The idea is that first, we find all the resolution elements that are receiving flux given a position on sky and an IFU
object. Then, we can fill in a model of a point source from the PsfModel
. This structure is used later to compare the detected flux to the point-source model.
A
ProjectorSet can be used to hold a number of Projector
instances to represent a full dither. It exposes the same interface and delegates calls to the individual Projectors
.
Projector::Projector | ( | VFrame & | vframe, | |
const string & | ifufile, | |||
const float | seeing, | |||
const float | flux_norm, | |||
const float | airmass, | |||
int | CCD_x, | |||
int | CCD_y, | |||
int | psf_size_x, | |||
int | psf_size_y | |||
) |
References initialize().
virtual Projector::~Projector | ( | ) | [inline, virtual] |
int Projector::get_psf_size_x | ( | ) | const [inline] |
References psf_size_x_.
int Projector::get_psf_size_y | ( | ) | const [inline] |
References psf_size_y_.
ResElemList Projector::find_res_elems | ( | const SkyPosition & | p | ) | const |
Construct a list of ResElems containing the flux from a point source at {x,y,wavelength}
References append_res_elem_to_list(), extinction(), flux_frac_in_fiber(), ifu::get_fiber_x(), ifu::get_fiber_y(), ifu::get_fiberd(), ifu::get_fibernum(), ifu::get_nf_row(), ifu::get_target_fiber(), ifu::get_target_unit(), Ifu_, Projector::SkyPosition::l_, listPool, seeing_, Projector::SkyPosition::x_, and Projector::SkyPosition::y_.
ResElemList Projector::find_res_elems_aperture | ( | const SkyPosition & | p, | |
const float | aperture | |||
) | const |
Construct a list of ResElems containing the flux from a point source at {x,y,wavelength} within a circular aperture of a given diameter. Fractional contributions are considered by the intersection of the aperture circle with the fiber area. The aperture is in units of the seeing.
References append_res_elem_to_list(), extinction(), flux_frac_in_fiber(), ifu::get_fiber_x(), ifu::get_fiber_y(), ifu::get_fiberd(), ifu::get_fibernum(), ifu::get_nf_row(), ifu::get_target_fiber(), ifu::get_target_unit(), Ifu_, intersect_circles(), Projector::SkyPosition::l_, listPool, seeing_, Projector::SkyPosition::x_, and Projector::SkyPosition::y_.
ResElemList Projector::find_res_elems_ell_aperture | ( | const SkyPosition & | p, | |
const float | a, | |||
const float | b, | |||
const float | pa | |||
) | const |
Construct a list of ResElems containing the flux from a point source at {x,y,wavelength} within an elliptical aperture of given axes and position angle. Fractional contributions are considered by the intersection of the aperture ellipse with the fiber cross-section.
References append_res_elem_to_list(), extinction(), polygon::PolygonIntersection::get_ellipse(), ifu::get_fiber_x(), ifu::get_fiber_y(), ifu::get_fiberd(), ifu::get_fibernum(), ifu::get_target_fiber(), ifu::get_target_unit(), Ifu_, polygon::PolygonIntersection::inter(), Projector::SkyPosition::l_, listPool, P, Projector::SkyPosition::x_, and Projector::SkyPosition::y_.
void Projector::fill_in_point_source_model | ( | ResElemList & | fluxes | ) | const |
References PooledList< T >::begin(), PooledList< T >::end(), ResElem::ext, ResElem::f, Pixel::flux, VFrame::get_distortion(), ifu::get_fiber_x(), ifu::get_fiber_y(), PsfModel::get_psf(), VFrame::get_psfmodel(), Ifu_, ResElem::mflux, ResElem::npix(), ResElem::p, psf_size_x_, psf_size_y_, ResElem::tu, vframe_, Pixel::x, ResElem::x, ResElem::xsky, Pixel::y, ResElem::y, and ResElem::ysky.
Referenced by ProjectorSet::fillInPointSourceModel().
MArray< float, 2 > Projector::get_psf_grid | ( | int | tunit, | |
const MArray< float, 1 > & | cx, | |||
const MArray< float, 1 > & | cy | |||
) | const |
return 2D MArray containing a grid of PSFs sampled at the list of coordinate pairs from the arrays xf and yf.
References VFrame::get_distortion(), PsfModel::get_psf(), VFrame::get_psfmodel(), psf_size_x_, psf_size_y_, and vframe_.
Referenced by DitherEnvironment::dump_psf_grid().
void Projector::read_fibers | ( | const string & | ifufile, | |
VFrame & | vframe | |||
) |
TODO: Should probably check them separately
References __LEFTSPECTGR__, __RIGHTSPECTGR__, VFrame::get_distortion(), ifu::get_fibernum(), Distortion::get_reference_f(), Ifu_, and ifu::init_from_file().
Referenced by initialize().
const ifu& Projector::get_ifu | ( | ) | const [inline] |
const VFrame& Projector::get_vframe | ( | ) | const [inline] |
References vframe_.
Referenced by PointSourceDetector::equivalent_width().
void Projector::apply_atmospheric_extinction | ( | bool | ext | ) | [inline] |
References apply_atmospheric_ext_.
void Projector::initialize | ( | VFrame & | vframe, | |
const string & | ifufile, | |||
const float | seeing, | |||
const float | flux_norm, | |||
const float | airmass, | |||
int | CCD_x, | |||
int | CCD_y, | |||
int | psf_size_x, | |||
int | psf_size_y | |||
) | [protected] |
Initialize self, common part of self setup used by constructors
References airmass_, apply_atmospheric_ext_, CCDsize_x_, CCDsize_y_, flux_norm_, imagesize_, init_flux_fractions(), moffat, P_, pix_arcsec_, psf_size_x_, psf_size_y_, read_fibers(), res_element_, RH_, seeing_, TC_, tpsf_type_, and vframe_.
Referenced by Projector().
float Projector::extinction | ( | const float | l | ) | const [protected] |
References airmass_, apply_atmospheric_ext_, and flux_norm_.
Referenced by find_res_elems(), find_res_elems_aperture(), and find_res_elems_ell_aperture().
float Projector::atmos_refraction | ( | float | l, | |
float | secz | |||
) | const [protected] |
float Projector::nl | ( | float | l, | |
float | D1, | |||
float | D2 | |||
) | const [protected] |
Referenced by atmos_refraction().
void Projector::init_flux_fractions | ( | void | ) | [protected] |
References ffdist_, fluxfrac_, gaussian, ifu::get_fiberd(), Ifu_, imagesize_, mask_fiber(), moffat, pix_arcsec_, seeing_, sim_seeing(), and tpsf_type_.
Referenced by initialize().
void Projector::find_affected_pixels | ( | ResElem & | e | ) | const [protected] |
References CCDsize_x_, CCDsize_y_, VFrame::get_distortion(), Distortion::get_reference_f(), ResElem::ignore, ResElem::l, Distortion::map_wf_x(), Distortion::map_wf_y(), ResElem::p, psf_size_x_, psf_size_y_, ResElem::tf, ResElem::tu, vframe_, ResElem::x, and ResElem::y.
Referenced by append_res_elem_to_list().
MArray< float, 2 > Projector::sim_seeing | ( | const float | fwhm, | |
const float | pix_arcsec, | |||
const float | imagesize | |||
) | const [protected] |
References gaussian, moffat, span(), telescope_psf_gaussian(), telescope_psf_moffat(), and tpsf_type_.
Referenced by init_flux_fractions().
MArray< float, 2 > Projector::telescope_psf_gaussian | ( | const MArray< float, 2 > & | Mx, | |
const MArray< float, 2 > & | My, | |||
const float | cx, | |||
const float | cy, | |||
const float | fwhm | |||
) | const [protected] |
Referenced by sim_seeing().
MArray< float, 2 > Projector::telescope_psf_moffat | ( | const MArray< float, 2 > & | Mx, | |
const MArray< float, 2 > & | My, | |||
const float | cx, | |||
const float | cy, | |||
const float | fwhm | |||
) | const [protected] |
Referenced by sim_seeing().
MArray< float, 2 > Projector::sky_e_mask | ( | const MArray< float, 2 > & | I, | |
const float | xc, | |||
const float | yc, | |||
const float | a1, | |||
const float | b1, | |||
const float | pa | |||
) | const [protected] |
Referenced by mask_fiber().
MArray< float, 2 > Projector::mask_fiber | ( | const MArray< float, 2 > & | d, | |
const float | x, | |||
const float | y, | |||
const float | r | |||
) | const [protected] |
References sky_e_mask().
Referenced by init_flux_fractions().
float Projector::flux_frac_in_fiber | ( | const float | offset | ) | const [protected] |
compute the fraction of flux of a point-source through a fiber at a given distance
References ffdist_, fluxfrac_, and v.
Referenced by find_res_elems(), and find_res_elems_aperture().
float Projector::intersect_circles | ( | const float | d, | |
const float | r1, | |||
const float | r2 | |||
) | const [protected] |
Referenced by find_res_elems_aperture().
void Projector::append_res_elem_to_list | ( | ResElemList & | res, | |
const int | i, | |||
int | tu, | |||
int | tf, | |||
const float | l, | |||
const float | ext, | |||
const float | fl, | |||
const float | a_intersect = 1.0f , |
|||
const float | xsky = 0.0f , |
|||
const float | ysky = 0.0f | |||
) | const [protected] |
Append a new res elem to the list Use specialized list<>
and placement new if available (GNUC) to avoid superfluous memcpy.
References ResElem::apfrac, find_affected_pixels(), psf_size_x_, psf_size_y_, PooledList< T >::push_back_noconstruct(), ResElem::xsky, and ResElem::ysky.
Referenced by find_res_elems(), find_res_elems_aperture(), and find_res_elems_ell_aperture().
VFrame Projector::vframe_ [protected] |
Referenced by fill_in_point_source_model(), find_affected_pixels(), get_psf_grid(), get_vframe(), and initialize().
ifu Projector::Ifu_ [protected] |
float Projector::res_element_ [protected] |
Referenced by initialize().
int Projector::psf_size_x_ [protected] |
int Projector::psf_size_y_ [protected] |
float Projector::seeing_ [protected] |
Referenced by find_res_elems(), find_res_elems_aperture(), init_flux_fractions(), and initialize().
float Projector::airmass_ [protected] |
Referenced by extinction(), and initialize().
float Projector::TC_ [protected] |
Referenced by atmos_refraction(), and initialize().
float Projector::RH_ [protected] |
Referenced by atmos_refraction(), and initialize().
float Projector::P_ [protected] |
Referenced by atmos_refraction(), and initialize().
int Projector::CCDsize_x_ [protected] |
Referenced by find_affected_pixels(), and initialize().
int Projector::CCDsize_y_ [protected] |
Referenced by find_affected_pixels(), and initialize().
tel_psf_type Projector::tpsf_type_ [protected] |
Referenced by init_flux_fractions(), initialize(), and sim_seeing().
MArray<float,1> Projector::fluxfrac_ [protected] |
Referenced by flux_frac_in_fiber(), and init_flux_fractions().
MArray<float,1> Projector::ffdist_ [protected] |
Referenced by flux_frac_in_fiber(), and init_flux_fractions().
int Projector::pix_arcsec_ [protected] |
Referenced by init_flux_fractions(), and initialize().
int Projector::imagesize_ [protected] |
Referenced by init_flux_fractions(), and initialize().
float Projector::flux_norm_ [protected] |
Referenced by extinction(), and initialize().
bool Projector::apply_atmospheric_ext_ [protected] |
Referenced by apply_atmospheric_extinction(), extinction(), and initialize().
Pool Projector::listPool [static, protected] |
The memory pool for ResElem
instances. Used to speed up allocation and deallocation of the ResElems
during construction of the SingificanceMap
.
Referenced by find_res_elems(), find_res_elems_aperture(), and find_res_elems_ell_aperture().