LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
lsst.afw.image::Calib Class Reference

#include <Calib.h>

Inheritance diagram for lsst.afw.image::Calib:
lsst.afw.table.io::PersistableFacade< Calib > lsst.afw.table.io::Persistable

Public Types

typedef boost::shared_ptr< CalibPtr
 
typedef boost::shared_ptr
< Calib const > 
ConstPtr
 

Public Member Functions

 Calib ()
 
 Calib (std::vector< boost::shared_ptr< Calib const >> const &calibs)
 
 Calib (boost::shared_ptr< lsst::daf::base::PropertySet const >)
 
void setMidTime (lsst::daf::base::DateTime const &midTime)
 
lsst::daf::base::DateTime getMidTime () const
 
lsst::daf::base::DateTime getMidTime (boost::shared_ptr< const lsst::afw::cameraGeom::Detector >, lsst::afw::geom::Point2I const &) const
 
void setExptime (double exptime)
 
double getExptime () const
 
void setFluxMag0 (double fluxMag0, double fluxMag0Sigma=0.0)
 
void setFluxMag0 (std::pair< double, double > fluxMag0AndSigma)
 
std::pair< double, double > getFluxMag0 () const
 
double getFlux (double const mag) const
 
std::pair< double, double > getFlux (double const mag, double const magErr) const
 
ndarray::Array< double, 1 > getFlux (ndarray::Array< double const, 1 > const &mag) const
 
std::pair< ndarray::Array
< double, 1 >, ndarray::Array
< double, 1 > > 
getFlux (ndarray::Array< double const, 1 > const &mag, ndarray::Array< double const, 1 > const &magErr) const
 
double getMagnitude (double const flux) const
 
std::pair< double, double > getMagnitude (double const flux, double const fluxErr) const
 
ndarray::Array< double, 1 > getMagnitude (ndarray::Array< double const, 1 > const &flux) const
 
std::pair< ndarray::Array
< double, 1 >, ndarray::Array
< double, 1 > > 
getMagnitude (ndarray::Array< double const, 1 > const &flux, ndarray::Array< double const, 1 > const &fluxErr) const
 
bool operator== (Calib const &rhs) const
 
bool operator!= (Calib const &rhs) const
 
bool isPersistable () const
 Return true if this particular object can be persisted using afw::table::io. More...
 
- Public Member Functions inherited from lsst.afw.table.io::Persistable
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory. More...
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object. More...
 
virtual ~Persistable ()
 

Static Public Member Functions

static void setThrowOnNegativeFlux (bool raiseException)
 
static bool getThrowOnNegativeFlux ()
 
- Static Public Member Functions inherited from lsst.afw.table.io::PersistableFacade< Calib >
static boost::shared_ptr< Calib > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr< Calib > readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr< Calib > readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 

Protected Member Functions

virtual std::string getPersistenceName () const
 Return the unique name used to persist this object and look up its factory. More...
 
virtual void write (OutputArchiveHandle &handle) const
 Write the object to one or more catalogs. More...
 
- Protected Member Functions inherited from lsst.afw.table.io::Persistable
virtual std::string getPythonModule () const
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More...
 
 Persistable ()
 
 Persistable (Persistable const &other)
 
void operator= (Persistable const &other)
 

Private Attributes

lsst::daf::base::DateTime _midTime
 
double _exptime
 
double _fluxMag0
 
double _fluxMag0Sigma
 

Static Private Attributes

static bool _throwOnNegativeFlux = true
 

Additional Inherited Members

- Protected Types inherited from lsst.afw.table.io::Persistable
typedef io::OutputArchiveHandle OutputArchiveHandle
 

Detailed Description

Describe an exposure's calibration

Definition at line 82 of file Calib.h.

Member Typedef Documentation

typedef boost::shared_ptr<Calib const> lsst.afw.image::Calib::ConstPtr

Definition at line 85 of file Calib.h.

typedef boost::shared_ptr<Calib> lsst.afw.image::Calib::Ptr

Definition at line 84 of file Calib.h.

Constructor & Destructor Documentation

lsst.afw.image::Calib::Calib ( )
explicit

ctor

Definition at line 49 of file Calib.cc.

49 : _midTime(), _exptime(0.0), _fluxMag0(0.0), _fluxMag0Sigma(0.0) {}
double _fluxMag0Sigma
Definition: Calib.h:145
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
lsst.afw.image::Calib::Calib ( std::vector< boost::shared_ptr< Calib const >> const &  calibs)
explicit

ctor from a vector of Calibs

Note
All the input calibs must have the same zeropoint; throw InvalidParameterError if this isn't true
Parameters
calibsSet of calibs to be merged

Definition at line 55 of file Calib.cc.

56  :
57  _midTime(), _exptime(0.0), _fluxMag0(0.0), _fluxMag0Sigma(0.0)
58 {
59  if (calibs.empty()) {
60  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
61  "You must provide at least one input Calib");
62  }
63 
64  double const fluxMag00 = calibs[0]->_fluxMag0;
65  double const fluxMag0Sigma0 = calibs[0]->_fluxMag0Sigma;
66 
67  double midTimeSum = 0.0; // sum(time*expTime)
68  for (std::vector<CONST_PTR(Calib)>::const_iterator ptr = calibs.begin(); ptr != calibs.end(); ++ptr) {
69  Calib const& calib = **ptr;
70 
71  if (::fabs(fluxMag00 - calib._fluxMag0) > std::numeric_limits<double>::epsilon() ||
72  ::fabs(fluxMag0Sigma0 - calib._fluxMag0Sigma) > std::numeric_limits<double>::epsilon()) {
73  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
74  (boost::format("You may only combine calibs with the same fluxMag0: "
75  "%g +- %g v %g +- %g")
76  % calib.getFluxMag0().first % calib.getFluxMag0().second
77  % calibs[0]->getFluxMag0().first % calibs[0]->getFluxMag0().second
78  ).str());
79  }
80 
81  double const exptime = calib._exptime;
82 
83  midTimeSum += calib._midTime.get()*exptime;
84  _exptime += exptime;
85  }
86 
87  daf::base::DateTime tmp(midTimeSum/_exptime); // there's no way to set the double value directly
88  using std::swap;
89  swap(_midTime, tmp);
90 }
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
Definition: Image.cc:291
#define CONST_PTR(...)
Definition: base.h:47
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
double _fluxMag0Sigma
Definition: Calib.h:145
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
lsst.afw.image::Calib::Calib ( boost::shared_ptr< lsst::daf::base::PropertySet const >  metadata)
explicit

ctor

Definition at line 95 of file Calib.cc.

95  {
97  double exptime = 0.0;
98  double fluxMag0 = 0.0, fluxMag0Sigma = 0.0;
99 
100  std::string key = "TIME-MID";
101  if (metadata->exists(key)) {
102  midTime = lsst::daf::base::DateTime(boost::algorithm::trim_right_copy(metadata->getAsString(key)));
103  }
104 
105  key = "EXPTIME";
106  if (metadata->exists(key)) {
107  try {
108  exptime = metadata->getAsDouble(key);
109  } catch (lsst::pex::exceptions::TypeError & err) {
110  std::string exptimeStr = metadata->getAsString(key);
111  exptime = boost::lexical_cast<double>(exptimeStr);
112  }
113  }
114 
115  key = "FLUXMAG0";
116  if (metadata->exists(key)) {
117  fluxMag0 = metadata->getAsDouble(key);
118 
119  key = "FLUXMAG0ERR";
120  if (metadata->exists(key)) {
121  fluxMag0Sigma = metadata->getAsDouble(key);
122  }
123  }
124 
125  _midTime = midTime;
126  _exptime = exptime;
129 }
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:58
table::Key< double > fluxMag0Sigma
Definition: Calib.cc:487
table::Key< boost::int64_t > midTime
Definition: Calib.cc:484
table::Key< double > fluxMag0
Definition: Calib.cc:486
double _fluxMag0Sigma
Definition: Calib.h:145
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142

Member Function Documentation

double lsst.afw.image::Calib::getExptime ( ) const

Return the length of an exposure in seconds

Definition at line 249 of file Calib.cc.

250 {
251  return _exptime;
252 }
double lsst.afw.image::Calib::getFlux ( double const  mag) const

Return a flux (in ADUs) given a magnitude

Parameters
magthe magnitude of the object

Definition at line 329 of file Calib.cc.

330  {
331  checkNegativeFlux0(_fluxMag0);
332  return convertToFlux(_fluxMag0, mag);
333 }
std::pair< double, double > lsst.afw.image::Calib::getFlux ( double const  mag,
double const  magSigma 
) const

Return a flux and flux error (in ADUs) given a magnitude and magnitude error

Assumes that the errors are small and uncorrelated.

Parameters
magthe magnitude of the object
magSigmathe error in the magnitude

Definition at line 350 of file Calib.cc.

354 {
355  checkNegativeFlux0(_fluxMag0);
356  double const flux = convertToFlux(_fluxMag0, mag);
357  double const fluxErr = convertToFluxErr(_fluxMag0Sigma/_fluxMag0, flux, magSigma);
358  return std::make_pair(flux, fluxErr);
359 }
double _fluxMag0Sigma
Definition: Calib.h:145
ndarray::Array< double, 1 > lsst.afw.image::Calib::getFlux ( ndarray::Array< double const, 1 > const &  mag) const

Definition at line 334 of file Calib.cc.

334  {
335  checkNegativeFlux0(_fluxMag0);
338  ndarray::Array<double,1>::Iterator outIter = flux.begin();
339  for (; inIter != mag.end(); ++inIter, ++outIter) {
340  *outIter = convertToFlux(_fluxMag0, *inIter);
341  }
342  return flux;
343 }
size_type size() const
Return the size of the first dimension.
detail::SimpleInitializer< N > allocate(Vector< int, N > const &shape)
Create an expression that allocates uninitialized memory for an array.
A multidimensional strided array.
Definition: Array.h:47
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
std::pair< ndarray::Array< double, 1 >, ndarray::Array< double, 1 > > lsst.afw.image::Calib::getFlux ( ndarray::Array< double const, 1 > const &  mag,
ndarray::Array< double const, 1 > const &  magErr 
) const

Definition at line 361 of file Calib.cc.

364  {
365  checkNegativeFlux0(_fluxMag0);
366  if (mag.size() != magErr.size()) {
367  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
368  (boost::format("Size of mag (%d) and magErr (%d) don't match") %
369  mag.size() % magErr.size()).str());
370  }
371 
375  ndarray::Array<double const,1>::Iterator magErrIter = magErr.begin();
376  ndarray::Array<double,1>::Iterator fluxIter = flux.begin();
377  ndarray::Array<double,1>::Iterator fluxErrIter = fluxErr.begin();
378 
379  double fluxMag0InvSNR = _fluxMag0Sigma/_fluxMag0;
380  for (; magIter != mag.end(); ++magIter, ++magErrIter, ++fluxIter, ++fluxErrIter) {
381  *fluxIter = convertToFlux(_fluxMag0, *magIter);
382  *fluxErrIter = convertToFluxErr(fluxMag0InvSNR, *fluxIter, *magErrIter);
383  }
384 
385  return std::make_pair(flux, fluxErr);
386 }
size_type size() const
Return the size of the first dimension.
detail::SimpleInitializer< N > allocate(Vector< int, N > const &shape)
Create an expression that allocates uninitialized memory for an array.
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A multidimensional strided array.
Definition: Array.h:47
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
double _fluxMag0Sigma
Definition: Calib.h:145
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
std::pair< double, double > lsst.afw.image::Calib::getFluxMag0 ( ) const

Return the flux, and error in flux, of a zero-magnitude object

Definition at line 274 of file Calib.cc.

275 {
276  return std::make_pair(_fluxMag0, _fluxMag0Sigma);
277 }
double _fluxMag0Sigma
Definition: Calib.h:145
double lsst.afw.image::Calib::getMagnitude ( double const  flux) const

Return a magnitude given a flux

Parameters
fluxthe measured flux of the object (ADUs)

Definition at line 391 of file Calib.cc.

393 {
394  checkNegativeFlux0(_fluxMag0);
395  if (isNegativeFlux(flux, Calib::getThrowOnNegativeFlux())) {
396  return std::numeric_limits<double>::quiet_NaN();
397  }
398  return convertToMag(_fluxMag0, flux);
399 }
static bool getThrowOnNegativeFlux()
Definition: Calib.cc:148
std::pair< double, double > lsst.afw.image::Calib::getMagnitude ( double const  flux,
double const  fluxErr 
) const

Return a magnitude and magnitude error given a flux and flux error

Parameters
fluxthe measured flux of the object (ADUs)
fluxErrthe error in the measured flux (ADUs)

Definition at line 404 of file Calib.cc.

407 {
408  checkNegativeFlux0(_fluxMag0);
409  if (isNegativeFlux(flux, Calib::getThrowOnNegativeFlux())) {
410  double const NaN = std::numeric_limits<double>::quiet_NaN();
411  return std::make_pair(NaN, NaN);
412  }
413 
414  double mag, magErr;
415  convertToMagWithErr(&mag, &magErr, _fluxMag0, _fluxMag0Sigma/_fluxMag0, flux, fluxErr);
416  return std::make_pair(mag, magErr);
417 }
double _fluxMag0Sigma
Definition: Calib.h:145
static bool getThrowOnNegativeFlux()
Definition: Calib.cc:148
ndarray::Array< double, 1 > lsst.afw.image::Calib::getMagnitude ( ndarray::Array< double const, 1 > const &  flux) const

Definition at line 419 of file Calib.cc.

419  {
420  checkNegativeFlux0(_fluxMag0);
424  int nonPositive = 0;
425  for (; fluxIter != flux.end(); ++fluxIter, ++magIter) {
426  if (isNegativeFlux(*fluxIter, false)) {
427  ++nonPositive;
428  *magIter = std::numeric_limits<double>::quiet_NaN();
429  continue;
430  }
431  *magIter = convertToMag(_fluxMag0, *fluxIter);
432  }
433  if (nonPositive && Calib::getThrowOnNegativeFlux()) {
434  throw LSST_EXCEPT(lsst::pex::exceptions::DomainError,
435  (boost::format("Flux must be >= 0: %d non-positive seen") % nonPositive).str());
436  }
437  return mag;
438 }
size_type size() const
Return the size of the first dimension.
detail::SimpleInitializer< N > allocate(Vector< int, N > const &shape)
Create an expression that allocates uninitialized memory for an array.
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A multidimensional strided array.
Definition: Array.h:47
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
static bool getThrowOnNegativeFlux()
Definition: Calib.cc:148
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
std::pair< ndarray::Array< double, 1 >, ndarray::Array< double, 1 > > lsst.afw.image::Calib::getMagnitude ( ndarray::Array< double const, 1 > const &  flux,
ndarray::Array< double const, 1 > const &  fluxErr 
) const

Definition at line 440 of file Calib.cc.

443  {
444  checkNegativeFlux0(_fluxMag0);
445  if (flux.size() != fluxErr.size()) {
446  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
447  (boost::format("Size of flux (%d) and fluxErr (%d) don't match") %
448  flux.size() % fluxErr.size()).str());
449  }
450 
454  ndarray::Array<double const,1>::Iterator fluxErrIter = fluxErr.begin();
456  ndarray::Array<double,1>::Iterator magErrIter = magErr.begin();
457  int nonPositive = 0;
458  double fluxMag0InvSNR = _fluxMag0Sigma/_fluxMag0;
459  for (; fluxIter != flux.end(); ++fluxIter, ++fluxErrIter, ++magIter, ++magErrIter) {
460  if (isNegativeFlux(*fluxIter, false)) {
461  ++nonPositive;
462  double const NaN = std::numeric_limits<double>::quiet_NaN();
463  *magIter = NaN;
464  *magErrIter = NaN;
465  continue;
466  }
467  double f, df;
468  convertToMagWithErr(&f, &df, _fluxMag0, fluxMag0InvSNR, *fluxIter, *fluxErrIter);
469  *magIter = f;
470  *magErrIter = df;
471  }
472  if (nonPositive && Calib::getThrowOnNegativeFlux()) {
473  throw LSST_EXCEPT(lsst::pex::exceptions::DomainError,
474  (boost::format("Flux must be >= 0: %d non-positive seen") % nonPositive).str());
475  }
476  return std::make_pair(mag, magErr);
477 }
size_type size() const
Return the size of the first dimension.
detail::SimpleInitializer< N > allocate(Vector< int, N > const &shape)
Create an expression that allocates uninitialized memory for an array.
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A multidimensional strided array.
Definition: Array.h:47
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
double _fluxMag0Sigma
Definition: Calib.h:145
static bool getThrowOnNegativeFlux()
Definition: Calib.cc:148
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
lsst::daf::base::DateTime lsst.afw.image::Calib::getMidTime ( ) const

Return the time at the middle of an exposure

Definition at line 219 of file Calib.cc.

220 {
221  return _midTime;
222 }
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
lsst::daf::base::DateTime lsst.afw.image::Calib::getMidTime ( boost::shared_ptr< const lsst::afw::cameraGeom::Detector ,
lsst::afw::geom::Point2I const &   
) const

Return the time at the middle of an exposure at the specified position in the focal plane (as described by a cameraGeom::Detector)

Warning
This implementation ignores its arguments!

Definition at line 230 of file Calib.cc.

234 {
235  return _midTime;
236 }
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
std::string lsst.afw.image::Calib::getPersistenceName ( ) const
protectedvirtual

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

Reimplemented from lsst.afw.table.io::Persistable.

Definition at line 535 of file Calib.cc.

535 { return getCalibPersistenceName(); }
bool lsst.afw.image::Calib::getThrowOnNegativeFlux ( )
static

Tell me whether Calib will throw an exception if asked to convert a flux to a magnitude

Definition at line 148 of file Calib.cc.

149 {
150  return _throwOnNegativeFlux;
151 }
static bool _throwOnNegativeFlux
Definition: Calib.h:146
bool lsst.afw.image::Calib::isPersistable ( ) const
inlinevirtual

Return true if this particular object can be persisted using afw::table::io.

Reimplemented from lsst.afw.table.io::Persistable.

Definition at line 133 of file Calib.h.

133 { return true; }
bool lsst.afw.image::Calib::operator!= ( Calib const &  rhs) const
inline

Definition at line 131 of file Calib.h.

131 { return !(*this == rhs); }
bool lsst.afw.image::Calib::operator== ( Calib const &  rhs) const

Are two Calibs identical?

Note
Maybe this should be an approximate comparison

Definition at line 197 of file Calib.cc.

197  {
198  return
199  ::fabs(_midTime.get() - rhs._midTime.get()) < std::numeric_limits<double>::epsilon() &&
200  _exptime == rhs._exptime &&
201  _fluxMag0 == rhs._fluxMag0 &&
202  _fluxMag0Sigma == rhs._fluxMag0Sigma;
203 }
double get(DateSystem system=MJD, Timescale scale=TAI) const
Definition: DateTime.cc:419
double _fluxMag0Sigma
Definition: Calib.h:145
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
void lsst.afw.image::Calib::setExptime ( double  exptime)

Set the length of an exposure

Parameters
exptimethe length of the exposure (s)

Definition at line 241 of file Calib.cc.

242  {
243  _exptime = exptime;
244 }
void lsst.afw.image::Calib::setFluxMag0 ( double  fluxMag0,
double  fluxMag0Sigma = 0.0 
)

Set the flux of a zero-magnitude object

Parameters
fluxMag0The flux in question (ADUs)
fluxMag0SigmaThe error in the flux (ADUs)

Definition at line 257 of file Calib.cc.

260 {
263 }
table::Key< double > fluxMag0Sigma
Definition: Calib.cc:487
table::Key< double > fluxMag0
Definition: Calib.cc:486
double _fluxMag0Sigma
Definition: Calib.h:145
void lsst.afw.image::Calib::setFluxMag0 ( std::pair< double, double >  fluxMag0AndSigma)
Parameters
fluxMag0AndSigmaThe flux and error (ADUs)

Definition at line 264 of file Calib.cc.

266 {
267  _fluxMag0 = fluxMag0AndSigma.first;
268  _fluxMag0Sigma = fluxMag0AndSigma.second;
269 }
double _fluxMag0Sigma
Definition: Calib.h:145
void lsst.afw.image::Calib::setMidTime ( lsst::daf::base::DateTime const &  midTime)

Set the time of the middle of an exposure

Note
In general this is a function of position of the position of the detector in the focal plane
Parameters
midTimeTime at middle of exposure

Definition at line 210 of file Calib.cc.

212 {
213  _midTime = midTime;
214 }
table::Key< boost::int64_t > midTime
Definition: Calib.cc:484
lsst::daf::base::DateTime _midTime
Definition: Calib.h:142
void lsst.afw.image::Calib::setThrowOnNegativeFlux ( bool  raiseException)
static

Set whether Calib should throw an exception when asked to convert a flux to a magnitude

Parameters
raiseExceptionShould the exception be raised?

Definition at line 138 of file Calib.cc.

140 {
141  _throwOnNegativeFlux = raiseException;
142 }
static bool _throwOnNegativeFlux
Definition: Calib.h:146
void lsst.afw.image::Calib::write ( OutputArchiveHandle handle) const
protectedvirtual

Write the object to one or more catalogs.

The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.

Reimplemented from lsst.afw.table.io::Persistable.

Definition at line 537 of file Calib.cc.

537  {
538  CalibSchema const & keys = CalibSchema::get();
539  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
540  PTR(table::BaseRecord) record = cat.addNew();
541  record->set(keys.midTime, getMidTime().nsecs());
542  record->set(keys.expTime, getExptime());
543  std::pair<double,double> fluxMag0 = getFluxMag0();
544  record->set(keys.fluxMag0, fluxMag0.first);
545  record->set(keys.fluxMag0Sigma, fluxMag0.second);
546  handle.saveCatalog(cat);
547 }
#define PTR(...)
Definition: base.h:41
table::Key< double > fluxMag0Sigma
Definition: Calib.cc:487
CatalogT< BaseRecord > BaseCatalog
Definition: fwd.h:61
std::pair< double, double > getFluxMag0() const
Definition: Calib.cc:274
table::Key< boost::int64_t > midTime
Definition: Calib.cc:484
table::Key< double > expTime
Definition: Calib.cc:485
double getExptime() const
Definition: Calib.cc:249
lsst::daf::base::DateTime getMidTime() const
Definition: Calib.cc:219
table::Key< double > fluxMag0
Definition: Calib.cc:486

Member Data Documentation

double lsst.afw.image::Calib::_exptime
private

Definition at line 143 of file Calib.h.

double lsst.afw.image::Calib::_fluxMag0
private

Definition at line 144 of file Calib.h.

double lsst.afw.image::Calib::_fluxMag0Sigma
private

Definition at line 145 of file Calib.h.

lsst::daf::base::DateTime lsst.afw.image::Calib::_midTime
private

Definition at line 142 of file Calib.h.

bool lsst.afw.image::Calib::_throwOnNegativeFlux = true
staticprivate

Control whether we throw an exception when faced with a negative flux

Definition at line 146 of file Calib.h.


The documentation for this class was generated from the following files: