LSSTApplications  16.0-11-g09ed895+2,16.0-11-g12e47bd,16.0-11-g9bb73b2+6,16.0-12-g5c924a4+6,16.0-14-g9a974b3+1,16.0-15-g1417920+1,16.0-15-gdd5ca33+1,16.0-16-gf0259e2,16.0-17-g31abd91+7,16.0-17-g7d7456e+7,16.0-17-ga3d2e9f+13,16.0-18-ga4d4bcb+1,16.0-18-gd06566c+1,16.0-2-g0febb12+21,16.0-2-g9d5294e+69,16.0-2-ga8830df+6,16.0-20-g21842373+7,16.0-24-g3eae5ec,16.0-28-gfc9ea6c+4,16.0-29-ge8801f9,16.0-3-ge00e371+34,16.0-4-g18f3627+13,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+29,16.0-4-gb13d127+6,16.0-49-g42e581f7+6,16.0-5-g27fb78a+7,16.0-5-g6a53317+34,16.0-5-gb3f8a4b+87,16.0-6-g9321be7+4,16.0-6-gcbc7b31+42,16.0-6-gf49912c+29,16.0-7-gd2eeba5+51,16.0-71-ge89f8615e,16.0-8-g21fd5fe+29,16.0-8-g3a9f023+20,16.0-8-g4734f7a+1,16.0-8-g5858431+3,16.0-9-gf5c1f43+8,master-gd73dc1d098+1,w.2019.01
LSSTDataManagementBasePackage
ExposureFitsReader.cc
Go to the documentation of this file.
1 /*
2  * Developed for the LSST Data Management System.
3  * This product includes software developed by the LSST Project
4  * (https://www.lsst.org).
5  * See the COPYRIGHT file at the top-level directory of this distribution
6  * for details of code ownership.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #include "lsst/log/Log.h"
23 
24 #include "lsst/afw/image/Calib.h"
26 #include "lsst/afw/geom/SkyWcs.h"
29 #include "lsst/afw/detection/Psf.h"
32 
33 namespace lsst { namespace afw { namespace image {
34 
35 namespace {
36 
37 LOG_LOGGER _log = LOG_GET("afw.image.fits.ExposureFitsReader");
38 
39 } // anonymous
40 
42 public:
43 
47  lsst::geom::Point2I const & xy0
48  ) {
49  // Try to read WCS from image metadata, and if found, strip the keywords used
50  try {
51  wcs = afw::geom::makeSkyWcs(*imageMetadata, true);
53  LOGLS_DEBUG(_log, "No WCS found in FITS metadata");
54  }
55  if (wcs && any(xy0.ne(lsst::geom::Point2I(0, 0)))) {
56  wcs = wcs->copyAtShiftedPixelOrigin(lsst::geom::Extent2D(xy0));
57  }
58 
59  // Strip LTV1, LTV2 from imageMetadata, because we don't use it internally
60  imageMetadata->remove("LTV1");
61  imageMetadata->remove("LTV2");
62 
63  if (!imageMetadata->exists("INHERIT")) {
64  // New-style exposures put everything but the Wcs in the primary HDU, use
65  // INHERIT keyword in the others. For backwards compatibility, if we don't
66  // find the INHERIT keyword, we ignore the primary HDU metadata and expect
67  // everything to be in the image HDU metadata. Note that we can't merge them,
68  // because they're probably duplicates.
69  metadata = imageMetadata;
70  } else {
71  metadata = primaryMetadata;
72  }
73 
74  filter = Filter(metadata, true);
76 
77  visitInfo = std::make_shared<VisitInfo>(*metadata);
79 
80  calib = std::make_shared<Calib>(metadata);
82 
83  // Strip MJD-OBS and DATE-OBS from metadata; those may be read by
84  // either SkyWcs or VisitInfo or both, so neither can strip them.
85  metadata->remove("MJD-OBS");
86  metadata->remove("DATE-OBS");
87 
88  // Strip DETSER, DETNAME; these are added when writing an Exposure
89  // with a Detector
90  metadata->remove("DETNAME");
91  metadata->remove("DETSER");
92  }
93 
99 };
100 
101 
103 public:
104 
105  enum Component {
106  PSF=0,
113  N_ARCHIVE_COMPONENTS
114  };
115 
117  auto popInt = [&metadata](std::string const& name) {
118  // The default of zero will cause archive.get to return a
119  // null/empty pointer, just as if a null/empty pointer was
120  // originally written to the archive.
121  int r = 0;
122  if (metadata.exists(name)) {
123  r = metadata.get<int>(name);
124  // We remove metadata entries to maintaing our practice
125  // of stripped metadata entries that have been used to
126  // construct more structured components.
127  metadata.remove(name);
128  }
129  return r;
130  };
131  _hdu = popInt("AR_HDU");
132  if (_hdu == 0) {
133  _state = ArchiveState::MISSING;
134  } else {
135  --_hdu; // Switch from FITS 1-indexed convention to LSST 0-indexed convention.
136  _state = ArchiveState::PRESENT;
137  }
138  _ids[PSF] = popInt("PSF_ID");
139  _ids[WCS] = popInt("SKYWCS_ID");
140  _ids[COADD_INPUTS] = popInt("COADD_INPUTS_ID");
141  _ids[AP_CORR_MAP] = popInt("AP_CORR_MAP_ID");
142  _ids[VALID_POLYGON] = popInt("VALID_POLYGON_ID");
143  _ids[TRANSMISSION_CURVE] = popInt("TRANSMISSION_CURVE_ID");
144  _ids[DETECTOR] = popInt("DETECTOR_ID");
145  }
146 
147  template <typename T>
149  if (!_ensureLoaded(fitsFile)) {
150  return nullptr;
151  }
152  return _archive.get<T>(_ids[c]);
153  }
154 
155 private:
156 
157  bool _ensureLoaded(afw::fits::Fits * fitsFile) {
158  if (_state == ArchiveState::MISSING) {
159  return false;
160  }
161  if (_state == ArchiveState::PRESENT) {
162  afw::fits::HduMoveGuard guard(*fitsFile, _hdu);
164  _state = ArchiveState::LOADED;
165  }
166  assert(_state == ArchiveState::LOADED); // constructor body should guarantee it's not UNKNOWN
167  return true;
168  }
169 
170  enum class ArchiveState { UNKNOWN, MISSING, PRESENT, LOADED };
171 
172  int _hdu = 0;
173  ArchiveState _state = ArchiveState::UNKNOWN;
176 };
177 
178 
180  _maskedImageReader(fileName)
181 {}
182 
184  _maskedImageReader(manager)
185 {}
186 
188  _maskedImageReader(fitsFile)
189 {}
190 
191 ExposureFitsReader::~ExposureFitsReader() noexcept = default;
192 
194  return _maskedImageReader.readBBox(origin);
195 }
196 
198  return _maskedImageReader.readXY0(bbox, origin);
199 }
200 
201 std::string ExposureFitsReader::readImageDType() const { return _maskedImageReader.readImageDType(); }
202 
203 std::string ExposureFitsReader::readMaskDType() const { return _maskedImageReader.readMaskDType(); }
204 
206 
208  _ensureReaders();
209  return _metadataReader->metadata;
210 }
211 
213  _ensureReaders();
214  auto r = _archiveReader->readComponent<afw::geom::SkyWcs>(_getFitsFile(), ArchiveReader::WCS);
215  if (!r) {
216  r = _metadataReader->wcs;
217  }
218  return r;
219 }
220 
222  _ensureReaders();
223  return _metadataReader->filter;
224 }
225 
227  _ensureReaders();
228  return _metadataReader->calib;
229 }
230 
232  _ensureReaders();
233  return _archiveReader->readComponent<detection::Psf>(_getFitsFile(), ArchiveReader::PSF);
234 }
235 
237  _ensureReaders();
238  return _archiveReader->readComponent<afw::geom::polygon::Polygon>(_getFitsFile(),
240 }
241 
243  _ensureReaders();
244  return _archiveReader->readComponent<ApCorrMap>(_getFitsFile(), ArchiveReader::AP_CORR_MAP);
245 }
246 
248  _ensureReaders();
249  return _archiveReader->readComponent<CoaddInputs>(_getFitsFile(), ArchiveReader::COADD_INPUTS);
250 }
251 
253  _ensureReaders();
254  return _metadataReader->visitInfo;
255 }
256 
258  _ensureReaders();
259  return _archiveReader->readComponent<TransmissionCurve>(_getFitsFile(), ArchiveReader::TRANSMISSION_CURVE);
260 }
261 
263  _ensureReaders();
264  return _archiveReader->readComponent<cameraGeom::Detector>(_getFitsFile(), ArchiveReader::DETECTOR);
265 }
266 
268  auto result = std::make_shared<ExposureInfo>();
269  result->setMetadata(readMetadata());
270  result->setFilter(readFilter());
271  result->setCalib(readCalib());
272  result->setVisitInfo(readVisitInfo());
273  // When reading an ExposureInfo (as opposed to reading individual
274  // components), we warn and try to proceed when a component is present
275  // but can't be read due its serialization factory not being set up
276  // (that's what throws the NotFoundErrors caught below).
277  try {
278  result->setPsf(readPsf());
279  } catch (pex::exceptions::NotFoundError& err) {
280  LOGLS_WARN(_log, "Could not read PSF; setting to null: " << err.what());
281  }
282  try {
283  result->setCoaddInputs(readCoaddInputs());
284  } catch (pex::exceptions::NotFoundError& err) {
285  LOGLS_WARN(_log, "Could not read CoaddInputs; setting to null: " << err.what());
286  }
287  try {
288  result->setApCorrMap(readApCorrMap());
289  } catch (pex::exceptions::NotFoundError& err) {
290  LOGLS_WARN(_log, "Could not read ApCorrMap; setting to null: " << err.what());
291  }
292  try {
293  result->setValidPolygon(readValidPolygon());
294  } catch (pex::exceptions::NotFoundError& err) {
295  LOGLS_WARN(_log, "Could not read ValidPolygon; setting to null: " << err.what());
296  }
297  try {
298  result->setTransmissionCurve(readTransmissionCurve());
299  } catch (pex::exceptions::NotFoundError& err) {
300  LOGLS_WARN(_log, "Could not read TransmissionCurve; setting to null: " << err.what());
301  }
302  try {
303  result->setDetector(readDetector());
304  } catch (pex::exceptions::NotFoundError& err) {
305  LOGLS_WARN(_log, "Could not read Detector; setting to null: " << err.what());
306  }
307  // In the case of WCS, we fall back to the metadata WCS if the one from
308  // the archive can't be read.
309  _ensureReaders();
310  result->setWcs(_metadataReader->wcs);
311  try {
312  auto wcs = _archiveReader->readComponent<afw::geom::SkyWcs>(_getFitsFile(), ArchiveReader::WCS);
313  if (!wcs) {
314  LOGLS_DEBUG(_log, "No WCS found in binary table");
315  } else {
316  result->setWcs(wcs);
317  }
318  } catch (pex::exceptions::NotFoundError & err) {
319  auto msg = str(boost::format("Could not read WCS extension; setting to null: %s") % err.what());
320  if (result->hasWcs()) {
321  msg += " ; using WCS from FITS header";
322  }
323  LOGLS_WARN(_log, msg);
324  }
325  return result;
326 }
327 
328 template <typename ImagePixelT>
330  bool allowUnsafe) {
331  return _maskedImageReader.readImage<ImagePixelT>(bbox, origin, allowUnsafe);
332 }
333 
334 template <typename ImagePixelT>
335 ndarray::Array<ImagePixelT, 2, 2> ExposureFitsReader::readImageArray(lsst::geom::Box2I const & bbox,
336  ImageOrigin origin,
337  bool allowUnsafe) {
338  return _maskedImageReader.readImageArray<ImagePixelT>(bbox, origin, allowUnsafe);
339 }
340 
341 template <typename MaskPixelT>
343  bool conformMasks, bool allowUnsafe) {
344  return _maskedImageReader.readMask<MaskPixelT>(bbox, origin, conformMasks, allowUnsafe);
345 }
346 
347 template <typename MaskPixelT>
348 ndarray::Array<MaskPixelT, 2, 2> ExposureFitsReader::readMaskArray(lsst::geom::Box2I const & bbox,
349  ImageOrigin origin,
350  bool allowUnsafe) {
351  return _maskedImageReader.readMaskArray<MaskPixelT>(bbox, origin, allowUnsafe);
352 }
353 
354 template <typename VariancePixelT>
356  bool allowUnsafe) {
357  return _maskedImageReader.readVariance<VariancePixelT>(bbox, origin, allowUnsafe);
358 }
359 
360 template <typename VariancePixelT>
361 ndarray::Array<VariancePixelT, 2, 2> ExposureFitsReader::readVarianceArray(lsst::geom::Box2I const & bbox,
362  ImageOrigin origin,
363  bool allowUnsafe) {
364  return _maskedImageReader.readVarianceArray<VariancePixelT>(bbox, origin, allowUnsafe);
365 }
366 
367 template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
369  lsst::geom::Box2I const & bbox,
370  ImageOrigin origin,
371  bool conformMasks,
372  bool allowUnsafe
373 ) {
374  return _maskedImageReader.read<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks,
375  /* needAllHdus= */false,
376  allowUnsafe);
377 }
378 
379 template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
381  lsst::geom::Box2I const & bbox,
382  ImageOrigin origin,
383  bool conformMasks,
384  bool allowUnsafe
385 ) {
386  auto mi = readMaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks,
387  allowUnsafe);
389 }
390 
391 void ExposureFitsReader::_ensureReaders() {
392  if (!_metadataReader) {
393  auto metadataReader = std::make_unique<MetadataReader>(
394  _maskedImageReader.readPrimaryMetadata(),
395  _maskedImageReader.readImageMetadata(),
396  _maskedImageReader.readXY0()
397  );
398  _archiveReader = std::make_unique<ArchiveReader>(*metadataReader->metadata);
399  _metadataReader = std::move(metadataReader); // deferred for exception safety
400  }
401  assert(_archiveReader); // should always be initialized with _metadataReader.
402 }
403 
404 #define INSTANTIATE(ImagePixelT) \
405  template Exposure<ImagePixelT, MaskPixel, VariancePixel> ExposureFitsReader::read( \
406  lsst::geom::Box2I const &, \
407  ImageOrigin, \
408  bool, bool \
409  ); \
410  template Image<ImagePixelT> ExposureFitsReader::readImage( \
411  lsst::geom::Box2I const &, \
412  ImageOrigin, bool \
413  ); \
414  template ndarray::Array<ImagePixelT, 2, 2> ExposureFitsReader::readImageArray(\
415  lsst::geom::Box2I const &, \
416  ImageOrigin, \
417  bool \
418  ); \
419  template MaskedImage<ImagePixelT, MaskPixel, VariancePixel> ExposureFitsReader::readMaskedImage( \
420  lsst::geom::Box2I const &, \
421  ImageOrigin, \
422  bool, bool \
423  )
424 
426 INSTANTIATE(int);
427 INSTANTIATE(float);
428 INSTANTIATE(double);
430 
431 template Mask<MaskPixel> ExposureFitsReader::readMask(
432  lsst::geom::Box2I const &,
433  ImageOrigin,
434  bool,
435  bool
436 );
437 template ndarray::Array<MaskPixel, 2, 2> ExposureFitsReader::readMaskArray(
438  lsst::geom::Box2I const &,
439  ImageOrigin,
440  bool
441 );
442 
443 template Image<VariancePixel> ExposureFitsReader::readVariance(
444  lsst::geom::Box2I const &,
445  ImageOrigin,
446  bool
447 );
448 template ndarray::Array<VariancePixel, 2, 2> ExposureFitsReader::readVarianceArray(
449  lsst::geom::Box2I const &,
450  ImageOrigin,
451  bool
452 );
453 
454 
455 
456 }}} // lsst::afw::image
#define LOGLS_WARN(logger, message)
Log a warn-level message using an iostream-based interface.
Definition: Log.h:657
std::shared_ptr< T > readComponent(afw::fits::Fits *fitsFile, Component c)
lsst::geom::Box2I readBBox(ImageOrigin origin=PARENT)
Read the bounding box of the on-disk image.
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Definition: SkyWcs.h:115
A spatially-varying transmission curve as a function of wavelength.
#define LOG_LOGGER
Definition: Log.h:712
std::shared_ptr< daf::base::PropertyList > metadata
std::shared_ptr< ExposureInfo > readExposureInfo()
Read the ExposureInfo containing all non-image components.
CoordinateExpr< N > ne(Point< T, N > const &other) const noexcept
Definition: Point.cc:83
lsst::geom::Box2I readBBox(ImageOrigin origin=PARENT)
Read the bounding box of the on-disk image.
Image< VariancePixelT > readVariance(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the variance plane.
std::shared_ptr< Calib > readCalib()
Read the Exposure&#39;s photometric calibration.
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
A thin wrapper around std::map to allow aperture corrections to be attached to Exposures.
Definition: ApCorrMap.h:44
A class to contain the data, WCS, and other information needed to describe an image of the sky...
Definition: Exposure.h:72
std::string readVarianceDType() const
Read a string describing the pixel type of the on-disk image plane.
std::shared_ptr< CoaddInputs > readCoaddInputs()
Read the Exposure&#39;s coadd input catalogs.
ndarray::Array< MaskPixelT, 2, 2 > readMaskArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the mask plane.
py::object result
Definition: schema.cc:284
Image< VariancePixelT > readVariance(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the variance plane.
int stripFilterKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Filter-related keywords from the metadata.
Definition: Filter.cc:127
ndarray::Array< VariancePixelT, 2, 2 > readVarianceArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the variance plane.
std::shared_ptr< VisitInfo > readVisitInfo()
Read the Exposure&#39;s visit metadata.
Image< ImagePixelT > readImage(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the image plane.
ExposureFitsReader(std::string const &fileName)
Construct a FITS reader object.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:296
Rotation angle is unknown.
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71
Image< ImagePixelT > readImage(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the image plane.
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.
std::string readImageDType() const
Read a string describing the pixel type of the on-disk image plane.
A simple Persistable struct containing ExposureCatalogs that record the inputs to a coadd...
Definition: CoaddInputs.h:48
STL class.
LSST DM logging module built on log4cxx.
Filter readFilter()
Read the Exposure&#39;s filter.
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
Reports attempts to access elements using an invalid key.
Definition: Runtime.h:151
virtual char const * what(void) const noexcept
Return a character string summarizing this exception.
Definition: Exception.cc:99
std::shared_ptr< afw::geom::polygon::Polygon > readValidPolygon()
Read the polygon describing the region of validity for the Exposure.
#define LOGLS_DEBUG(logger, message)
Log a debug-level message using an iostream-based interface.
Definition: Log.h:617
A base class for image defects.
Definition: cameraGeom.dox:3
Represent a 2-dimensional array of bitmask pixels.
Definition: Mask.h:78
Lifetime-management for memory that goes into FITS memory files.
Definition: fits.h:120
std::string readImageDType() const
Read a string describing the pixel type of the on-disk image plane.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:129
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:74
std::shared_ptr< daf::base::PropertyList > readPrimaryMetadata()
Read the FITS header of one of the HDUs.
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
int stripCalibKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Calib-related keywords from the metadata.
Definition: Calib.cc:161
table::Box2IKey bbox
Definition: Detector.cc:166
T move(T... args)
std::string readMaskDType() const
Read a string describing the pixel type of the on-disk image plane.
Holds an integer identifier for an LSST filter.
Definition: Filter.h:141
std::shared_ptr< afw::geom::SkyWcs > readWcs()
Read the Exposure&#39;s world coordinate system.
std::shared_ptr< io::OutputArchive > _archive
Definition: Exposure.cc:211
Mask< MaskPixelT > readMask(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Read the mask plane.
ndarray::Array< VariancePixelT, 2, 2 > readVarianceArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the variance plane.
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > read(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, bool allowUnsafe=false)
Read the full MaskedImage.
std::shared_ptr< ApCorrMap > readApCorrMap()
Read the Exposure&#39;s aperture correction map.
std::string readMaskDType() const
Read a string describing the pixel type of the on-disk image plane.
T get(std::string const &name) const
Get the last value for a property name (possibly hierarchical).
Definition: PropertyList.cc:61
Information about a CCD or other imaging detector.
Definition: Detector.h:61
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > readMaskedImage(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Read the MaskedImage.
static InputArchive readFits(fits::Fits &fitsfile)
Read an object from an already open FITS object.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
Definition: SkyWcs.cc:476
std::string readVarianceDType() const
Read a string describing the pixel type of the on-disk image plane.
ndarray::Array< ImagePixelT, 2, 2 > readImageArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the image plane.
#define INSTANTIATE(ImagePixelT)
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:267
lsst::geom::Point2I readXY0(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Read the image origin from the on-disk image or a subimage thereof.
Cartesian polygons.
Definition: Polygon.h:58
std::shared_ptr< cameraGeom::Detector > readDetector()
Read the Exposure&#39;s detector.
ndarray::Array< MaskPixelT, 2, 2 > readMaskArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the mask plane.
Exposure< ImagePixelT, MaskPixelT, VariancePixelT > read(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Read the full Exposure.
std::shared_ptr< daf::base::PropertyList > readMetadata()
Read the flexible metadata associated with the Exposure.
std::shared_ptr< daf::base::PropertyList > readImageMetadata()
Read the FITS header of one of the HDUs.
std::shared_ptr< detection::Psf > readPsf()
Read the Exposure&#39;s point-spread function.
Mask< MaskPixelT > readMask(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Read the mask plane.
A multi-catalog archive object used to load table::io::Persistable objects.
Definition: InputArchive.h:31
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition: Runtime.h:167
#define LOG_GET(logger)
Returns a Log object associated with logger.
Definition: Log.h:83
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:75
MetadataReader(std::shared_ptr< daf::base::PropertyList > primaryMetadata, std::shared_ptr< daf::base::PropertyList > imageMetadata, lsst::geom::Point2I const &xy0)
std::shared_ptr< TransmissionCurve > readTransmissionCurve()
Read the Exposure&#39;s transmission curve.
An integer coordinate rectangle.
Definition: Box.h:54
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:59
ndarray::Array< ImagePixelT, 2, 2 > readImageArray(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool allowUnsafe=false)
Read the image plane.
RAII scoped guard for moving the HDU in a Fits object.
Definition: fits.h:723
lsst::geom::Point2I readXY0(lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Read the image origin from the on-disk image or a subimage thereof.