FiberModel Class Reference

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions

Protected Attributes

Friends


Detailed Description

this class encapsulates all the knowledge about the fiber model pattern of the VIRUS spectrograph.

The form of the spectrum from each fiber is described by a gaussian with second and third hermite polynomials. The variation of fibermodel parameters sigma, h2 and h3 over the chip area are fitted with 7th order Chebychev polynoms.

The amplitudes are fitted for each fiber individually. First the amplitdude profile of the fiducial fiber is fitted with a one dimensional 7th order polynomial. The measured amplitudes of the remaining fibers are divided by the amplitude of the fiducial fiber and the remaining variation again individually fitted with a 7th order polynomial.

Together with Distortion and PsfModel, this forms a complete model of the VIRUS spectrograph.


Member Typedef Documentation

typedef Cheby2D_7<double,double> FiberModel::FiberModelPattern
typedef Poly1D<double, double,7> FiberModel::FiberThroughput

Constructor & Destructor Documentation

FiberModel::FiberModel (  ) 
FiberModel::FiberModel ( const bool  fixed_h2,
const bool  fixed_h3 
)
FiberModel::FiberModel ( const std::string &  filename  ) 

References init_from_file().

FiberModel::FiberModel ( const FiberModel other  ) 
virtual FiberModel::~FiberModel (  )  [inline, virtual]

Member Function Documentation

void FiberModel::init_from_file ( const std::string &  filename  ) 
std::vector<FiberThroughputPars> FiberModel::get_amplitudes (  )  const [inline]

References amplitudes_.

void FiberModel::set_amplitudes ( const std::vector< FiberThroughputPars > &  amplitudes  ) 

sets the amplitudes of the fibers

References amplitudes_.

Referenced by fit_initial_dist(), main(), and refit_models().

void FiberModel::set_h2 ( const FiberModel other  ) 

References h2_errors_, and h2_par_.

Referenced by main(), and refit_models().

void FiberModel::set_h3 ( const FiberModel other  ) 

References h3_errors_, and h3_par_.

Referenced by main(), and refit_models().

void FiberModel::set_sigma ( const FiberModel other  ) 

References sigma_errors_, and sigma_par_.

Referenced by main(), and refit_models().

void FiberModel::set_sigma_mult ( double  multiplier  ) 

References sigma_mult_.

void FiberModel::fit_sigma ( MArray< double, 1 > &  x,
MArray< double, 1 > &  y,
MArray< double, 1 > &  sigma,
MArray< double, 1 > &  sigma_errors 
)
void FiberModel::fit_h2 ( MArray< double, 1 > &  x,
MArray< double, 1 > &  y,
MArray< double, 1 > &  h2,
MArray< double, 1 > &  h2_errors 
)
void FiberModel::fit_h3 ( MArray< double, 1 > &  x,
MArray< double, 1 > &  y,
MArray< double, 1 > &  h3,
MArray< double, 1 > &  h3_errors 
)
void FiberModel::print_amplitude_coefficients (  )  const
void FiberModel::print_sigma_coefficients (  )  const
void FiberModel::print_h2_coefficients (  )  const
void FiberModel::print_h3_coefficients (  )  const
float FiberModel::get_single_fiberflux ( const int  x,
const int  y,
const Distortion D 
) const

return the model flux of the nearest fiber, for a pixel x,y on the chip

return the flux of the nearest fiber, for a pixel x,y on the chip

Referenced by SourceSimulator::add_continuum_source_to_images(), SourceSimulator::add_sersic_source_to_images(), get_cumulative_fiberflux(), main(), PointSourceDetector::make_image(), single_fiber_flat(), and FiberIterator::single_fiberflux().

float FiberModel::get_single_fiberflux ( const double  x,
const double  y,
const Distortion D 
) const

return the flux of the nearest fiber, for a position x,y on the chip

References get_fit_parameters(), MAX_FIBER_DIST, and sigma_mult_.

float FiberModel::get_single_fiberflux ( const double  x,
const double  y,
const int  fiber,
const Distortion D 
) const

return the flux of a given fiber, for a position x,y on the chip

References get_fit_parameters(), Distortion::get_reference_f(), Distortion::map_xf_y(), MAX_FIBER_DIST, and sigma_mult_.

float FiberModel::get_single_fiberprofile ( const int  x,
const int  y,
const Distortion D 
) const
float FiberModel::get_single_fiberprofile ( const double  x,
const double  y,
const Distortion D 
) const
float FiberModel::get_single_fiberprofile ( const int  x,
const int  y,
const int  fiber,
const Distortion D 
) const

return the profile of a fiber normalized to one at the center of the fiber, for a pixel x,y on the chip

References get_single_fiberprofile().

float FiberModel::get_single_fiberprofile ( const double  x,
const double  y,
const int  fiber,
const Distortion D 
) const
float FiberModel::get_cumulative_fiberflux ( const int  x,
const int  y,
const Distortion D 
) const

return the flux of all 3 adjacent fibers, for a pixel x,y on the chip

Referenced by SourceSimulator::addSkyToFrame(), FiberIterator::cumulative_flux(), flat_from_model(), main(), mask_cosmics(), pixelflat(), and refit_models().

float FiberModel::get_cumulative_fiberflux ( const double  x,
const double  y,
const Distortion D 
) const

return the flux of all 3 adjacent fibers, for a position x,y on the chip

References Distortion::get_numfibers(), get_single_fiberflux(), and Distortion::map_xy_fibernum().

float FiberModel::get_xy_amplitude ( const float  x,
const float  y,
const Distortion D 
) const
float FiberModel::get_wf_amplitude ( const float  w,
const int  f 
) const
float FiberModel::get_fiducial_amplitude ( const float  w  )  const

References _scalw_, amplitudes_, and FIDUCIAL_FIBER.

float FiberModel::get_xy_sigma ( const float  x,
const float  y 
) const
float FiberModel::get_xy_h2 ( const float  x,
const float  y 
) const
float FiberModel::get_xy_h3 ( const float  x,
const float  y 
) const
MArray< float, 2 > FiberModel::flat_from_data ( const MArray< float, 2 > &  A,
const Distortion D,
const int  length 
) const
MArray< float, 2 > FiberModel::flat_from_model ( const int  lx,
const int  ly,
const Distortion D 
) const

References get_cumulative_fiberflux().

Referenced by main(), and SuperSky::SuperSky().

MArray< float, 2 > FiberModel::single_fiber_flat ( const int  lx,
const int  ly,
const int  fiber,
const Distortion D 
) const
MArray< float, 2 > FiberModel::pixelflat ( const MArray< float, 2 > &  Flat,
const Distortion D 
) const
float FiberModel::interpolate_at_xy ( const MArray< float, 2 > &  I,
const float  x,
const float  y 
) const

interpolate an image at fractional coordinates x,y

References BiCubicInterpolator::interpolate().

Referenced by flat_from_data(), main(), and pixelflat().

int FiberModel::get_fit_parameters ( const double  x,
const double  y,
const Distortion D,
double *  Amp,
double *  H2,
double *  H3,
double *  y0,
double *  s 
) const [protected]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const FiberModel d 
) [friend]
std::istream& operator>> ( std::istream &  is,
FiberModel d 
) [friend]

Field Documentation

string FiberModel::version = "$Id: fibermodel.cpp 1079 2015-11-02 16:11:19Z snigula $" [static]
std::vector<FiberThroughputPars> FiberModel::amplitudes_ [protected]

Fit of the amplitudes relative to the fiducial fiber see full description above

Referenced by FiberModel(), get_amplitudes(), get_fiducial_amplitude(), get_wf_amplitude(), operator<<(), operator>>(), print_amplitude_coefficients(), and set_amplitudes().

double FiberModel::sigma_mult_ [protected]

Multiplicative factor applied to sigma when deriving the fiberflux. usually only by simfmod to simulate different optics / fiberbundles. Defaults to 1.

Referenced by FiberModel(), get_single_fiberflux(), get_single_fiberprofile(), init_from_file(), and set_sigma_mult().

int FiberModel::fit_niter_ [protected]

Number of iterations to do when fitting variation of the fibermodel parameters currently not used and defaults to 1.

Referenced by FiberModel(), fit_h2(), fit_h3(), fit_sigma(), and init_from_file().

int FiberModel::fiducial_fib_ [protected]

Fiducial fiber used for fitting the amplitudes, see full description above default defined in specconf.h

Referenced by FiberModel(), operator<<(), and operator>>().


Generated on 4 Nov 2015 for CURE by  doxygen 1.6.1