Simulate a continuum point source observed through the IFU. Optionally add night sky.
SourceSimulator::SourceSimulator | ( | DitherEnvironment & | de, | |
const float | w_incr, | |||
vector< MArray< float, 2 > > & | imgs_l, | |||
vector< MArray< float, 2 > > & | imgs_r, | |||
bool | virus_eff, | |||
const float | ft | |||
) | [inline] |
void SourceSimulator::AddContSource | ( | const MArray< float, 1 > & | f, | |
const MArray< float, 1 > & | l, | |||
const float | x, | |||
const float | y, | |||
const float | aperture | |||
) |
References __maxw__, __minw__, add_continuum_source_to_images(), DE, dw, ProjectorSet::findResElemsForPointSourceInAperture(), flags, ifu::get_fibernum(), Projector::get_ifu(), DitherEnvironment::get_projector_set(), ProjectorSet::getNDithers(), and ProjectorSet::getProjector().
Referenced by main().
void SourceSimulator::AddSersicContSource | ( | const MArray< float, 1 > & | f, | |
const MArray< float, 1 > & | l, | |||
const Sersic & | S, | |||
const float | eaperture | |||
) |
References __maxw__, __minw__, a, add_sersic_source_to_images(), b, DE, dw, SourceSimulator::Sersic::ell, ProjectorSet::findResElemsForPointSourceInEllAperture(), flags, ifu::get_fibernum(), Projector::get_ifu(), DitherEnvironment::get_projector_set(), SourceSimulator::Sersic::get_re(), ProjectorSet::getNDithers(), ProjectorSet::getProjector(), SourceSimulator::Sersic::pa, SourceSimulator::Sersic::xc, and SourceSimulator::Sersic::yc.
Referenced by main().
void SourceSimulator::AddLineSource | ( | const float | x, | |
const float | y, | |||
const float | w, | |||
const float | f, | |||
const float | aperture | |||
) |
References add_line_source_to_images(), DE, ProjectorSet::fillInPointSourceModel(), ProjectorSet::findResElemsForPointSourceInAperture(), flags, ifu::get_fibernum(), Projector::get_ifu(), DitherEnvironment::get_projector_set(), ProjectorSet::getNDithers(), and ProjectorSet::getProjector().
Referenced by main().
void SourceSimulator::AddPoissonNoise | ( | ) |
References DE, DitherEnvironment::get_num_dithers(), imgs_left, imgs_right, and MTRand::randPoisson().
Referenced by main().
void SourceSimulator::AddSky | ( | const string & | sky_file, | |
const float | mag, | |||
const float | tint | |||
) |
Add night sky spectrum from an ascii file to all fibers in an IFU (both spectrographs). The night sky is scaled to AB mag in the V filter, and and exposure time of tint seconds.
References __LEFTSPECTGR__, __RIGHTSPECTGR__, addSkyToFrame(), DE, VFrame::get_distortion(), ifu::get_fiberd(), VFrame::get_fibermodel(), Projector::get_ifu(), DitherEnvironment::get_num_dithers(), DitherEnvironment::get_projector_set(), DitherEnvironment::get_vframe(), ProjectorSet::getProjector(), imgs_left, and imgs_right.
Referenced by main().
float SourceSimulator::mag_to_electrons | ( | const float | g_mag, | |
const float | tint | |||
) |
returns signal in detected electrons per cm^2/tint/A. Input magnitude is in the AB system in the g band.
References flambda_to_electrons().
Referenced by addSkyToFrame(), and main().
float SourceSimulator::flambda_to_electrons | ( | const float | flambda, | |
const float | lambda, | |||
const float | tint | |||
) |
returns signal in detected electrons per cm^2/tint/A. Input FLAMBDA is in ergs/cm^2/s/A !
References c.
Referenced by mag_to_electrons(), and main().
void SourceSimulator::addSkyToFrame | ( | const Distortion & | D, | |
const FiberModel & | F, | |||
MArray< float, 2 > & | image, | |||
const MArray< float, 1 > & | skyval, | |||
const MArray< float, 1 > & | skywl, | |||
const float | mag, | |||
const float | tint | |||
) |
Add a night sky spectrum to all fibers in a single CCD frame. The night sky is scaled to AB mag in the g filter, and and exposure time of tint seconds. Private version, driven externally by AddSky()
References apply_virus_eff, FiberModel::get_cumulative_fiberflux(), lin_interp(), mag_to_electrons(), Distortion::map_xy_wavelength_fast(), norm_to_sdss_g(), and virus_eff().
Referenced by AddSky().
float SourceSimulator::virus_eff | ( | const float | lambda | ) |
Third-order polynmomial approximation to VIRUS+HET+Atmosphere efficiency Taken from Gary's throughput_sep10v2 model, "realistic" version.
Lambda is the wavelength in Angstroms
Referenced by add_continuum_source_to_images(), add_sersic_source_to_images(), and addSkyToFrame().
void SourceSimulator::add_continuum_source_to_images | ( | const std::vector< ResElemList > & | data, | |
const MArray< float, 1 > & | ff, | |||
const MArray< float, 1 > & | l | |||
) |
This function adds the flux of a continuum source to a dithered set of images at one column (x) of the CCDs. No noise is added at this step.
References __LEFTSPECTGR__, apply_virus_eff, PooledList< T >::begin(), DE, PooledList< T >::end(), ResElem::ext, ResElem::f, flags, VFrame::get_distortion(), VFrame::get_fibermodel(), FiberModel::get_single_fiberflux(), DitherEnvironment::get_vframe(), imgs_left, imgs_right, lin_interp(), Distortion::map_xy_wavelength_fast(), ResElem::mflux, ResElem::tf, ResElem::tu, virus_eff(), ResElem::x, and ResElem::y.
Referenced by AddContSource().
void SourceSimulator::add_line_source_to_images | ( | vector< ResElemList > & | Model_LAE, | |
const float | flux | |||
) |
This function adds the flux of a single emissionn line source to a dithered set of images at one column (x) of the CCDs. No noise is added at this step.
References __LEFTSPECTGR__, PooledList< T >::begin(), PooledList< T >::end(), Pixel::flux, ResElem::ignore, imgs_left, imgs_right, ResElem::mflux, ResElem::npix(), ResElem::p, ResElem::tu, Pixel::x, and Pixel::y.
Referenced by AddLineSource().
void SourceSimulator::add_sersic_source_to_images | ( | const std::vector< ResElemList > & | data, | |
const Sersic & | S, | |||
const MArray< float, 1 > & | ff, | |||
const MArray< float, 1 > & | l | |||
) |
This function adds the flux of an extended Sersic profile source to a dithered set of images at one column (x) of the CCDs. No noise is added at this step.
References __LEFTSPECTGR__, apply_virus_eff, PooledList< T >::begin(), DE, PooledList< T >::end(), ResElem::ext, ResElem::f, flags, VFrame::get_distortion(), ifu::get_fiberd(), VFrame::get_fibermodel(), Projector::get_ifu(), DitherEnvironment::get_projector_set(), FiberModel::get_single_fiberflux(), DitherEnvironment::get_vframe(), ProjectorSet::getProjector(), imgs_left, imgs_right, lin_interp(), Distortion::map_xy_wavelength_fast(), ResElem::tf, ResElem::tu, virus_eff(), ResElem::x, ResElem::xsky, ResElem::y, and ResElem::ysky.
Referenced by AddSersicContSource().
void SourceSimulator::log_fluxin | ( | std::ostream & | out, | |
const float | fluxin, | |||
const float | fluxout, | |||
const float | z_em, | |||
const float | x, | |||
const float | y | |||
) |
Add a single emission line source affected pixels in data and error frames.
Referenced by main().
vector<MArray<float,2> >& SourceSimulator::imgs_left |
vector<MArray<float,2> >& SourceSimulator::imgs_right |
const float SourceSimulator::dw |
Referenced by AddContSource(), and AddSersicContSource().
Referenced by add_continuum_source_to_images(), add_sersic_source_to_images(), and addSkyToFrame().
MArray<short,2> SourceSimulator::flags |