LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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 {
34 namespace afw {
35 namespace image {
36 
37 namespace {
38 
39 LOG_LOGGER _log = LOG_GET("afw.image.fits.ExposureFitsReader");
40 
41 } // namespace
42 
44 public:
47  int version;
49  if (primaryMetadata->exists(versionName)) {
50  version = primaryMetadata->getAsInt(versionName);
51  primaryMetadata->remove(versionName);
52  } else {
53  version = 0; // unversioned files are implicitly version 0
54  }
57  str(boost::format("Cannot read Exposure FITS version >= %i") %
59  }
60 
61  // Try to read WCS from image metadata, and if found, strip the keywords used
62  try {
63  wcs = afw::geom::makeSkyWcs(*imageMetadata, true);
65  LOGLS_DEBUG(_log, "No WCS found in FITS metadata");
66  }
67  if (wcs && any(xy0.ne(lsst::geom::Point2I(0, 0)))) {
68  wcs = wcs->copyAtShiftedPixelOrigin(lsst::geom::Extent2D(xy0));
69  }
70 
71  // Strip LTV1, LTV2 from imageMetadata, because we don't use it internally
72  imageMetadata->remove("LTV1");
73  imageMetadata->remove("LTV2");
74 
75  if (!imageMetadata->exists("INHERIT")) {
76  // New-style exposures put everything but the Wcs in the primary HDU, use
77  // INHERIT keyword in the others. For backwards compatibility, if we don't
78  // find the INHERIT keyword, we ignore the primary HDU metadata and expect
79  // everything to be in the image HDU metadata. Note that we can't merge them,
80  // because they're probably duplicates.
81  metadata = imageMetadata;
82  } else {
83  metadata = primaryMetadata;
84  }
85 
86  filter = Filter(metadata, true);
88 
89  visitInfo = std::make_shared<VisitInfo>(*metadata);
91 
92  calib = std::make_shared<Calib>(metadata);
94 
95  // Strip MJD-OBS and DATE-OBS from metadata; those may be read by
96  // either SkyWcs or VisitInfo or both, so neither can strip them.
97  metadata->remove("MJD-OBS");
98  metadata->remove("DATE-OBS");
99 
100  // Strip DETSER, DETNAME; these are added when writing an Exposure
101  // with a Detector
102  metadata->remove("DETNAME");
103  metadata->remove("DETSER");
104  }
105 
111 };
112 
114 public:
115  enum Component {
116  PSF = 0,
123  N_ARCHIVE_COMPONENTS
124  };
125 
127  auto popInt = [&metadata](std::string const& name) {
128  // The default of zero will cause archive.get to return a
129  // null/empty pointer, just as if a null/empty pointer was
130  // originally written to the archive.
131  int r = 0;
132  if (metadata.exists(name)) {
133  r = metadata.get<int>(name);
134  // We remove metadata entries to maintaing our practice
135  // of stripped metadata entries that have been used to
136  // construct more structured components.
137  metadata.remove(name);
138  }
139  return r;
140  };
141  _hdu = popInt("AR_HDU");
142  if (_hdu == 0) {
143  _state = ArchiveState::MISSING;
144  } else {
145  --_hdu; // Switch from FITS 1-indexed convention to LSST 0-indexed convention.
146  _state = ArchiveState::PRESENT;
147  }
148  _ids[PSF] = popInt("PSF_ID");
149  _ids[WCS] = popInt("SKYWCS_ID");
150  _ids[COADD_INPUTS] = popInt("COADD_INPUTS_ID");
151  _ids[AP_CORR_MAP] = popInt("AP_CORR_MAP_ID");
152  _ids[VALID_POLYGON] = popInt("VALID_POLYGON_ID");
153  _ids[TRANSMISSION_CURVE] = popInt("TRANSMISSION_CURVE_ID");
154  _ids[DETECTOR] = popInt("DETECTOR_ID");
155  }
156 
157  template <typename T>
159  if (!_ensureLoaded(fitsFile)) {
160  return nullptr;
161  }
162  return _archive.get<T>(_ids[c]);
163  }
164 
165 private:
166  bool _ensureLoaded(afw::fits::Fits* fitsFile) {
167  if (_state == ArchiveState::MISSING) {
168  return false;
169  }
170  if (_state == ArchiveState::PRESENT) {
171  afw::fits::HduMoveGuard guard(*fitsFile, _hdu);
173  _state = ArchiveState::LOADED;
174  }
175  assert(_state == ArchiveState::LOADED); // constructor body should guarantee it's not UNKNOWN
176  return true;
177  }
178 
179  enum class ArchiveState { UNKNOWN, MISSING, PRESENT, LOADED };
180 
181  int _hdu = 0;
182  ArchiveState _state = ArchiveState::UNKNOWN;
185 };
186 
187 ExposureFitsReader::ExposureFitsReader(std::string const& fileName) : _maskedImageReader(fileName) {}
188 
189 ExposureFitsReader::ExposureFitsReader(fits::MemFileManager& manager) : _maskedImageReader(manager) {}
190 
191 ExposureFitsReader::ExposureFitsReader(fits::Fits* fitsFile) : _maskedImageReader(fitsFile) {}
192 
193 ExposureFitsReader::~ExposureFitsReader() noexcept = default;
194 
196  return _maskedImageReader.readBBox(origin);
197 }
198 
200  return _maskedImageReader.readXY0(bbox, origin);
201 }
202 
203 std::string ExposureFitsReader::readImageDType() const { return _maskedImageReader.readImageDType(); }
204 
205 std::string ExposureFitsReader::readMaskDType() const { return _maskedImageReader.readMaskDType(); }
206 
208 
210  _ensureReaders();
211  return _metadataReader->metadata;
212 }
213 
215  _ensureReaders();
216  auto r = _archiveReader->readComponent<afw::geom::SkyWcs>(_getFitsFile(), ArchiveReader::WCS);
217  if (!r) {
218  r = _metadataReader->wcs;
219  }
220  return r;
221 }
222 
224  _ensureReaders();
225  return _metadataReader->filter;
226 }
227 
229  _ensureReaders();
230  return _metadataReader->calib;
231 }
232 
234  _ensureReaders();
235  return _archiveReader->readComponent<detection::Psf>(_getFitsFile(), ArchiveReader::PSF);
236 }
237 
239  _ensureReaders();
240  return _archiveReader->readComponent<afw::geom::polygon::Polygon>(_getFitsFile(),
242 }
243 
245  _ensureReaders();
246  return _archiveReader->readComponent<ApCorrMap>(_getFitsFile(), ArchiveReader::AP_CORR_MAP);
247 }
248 
250  _ensureReaders();
251  return _archiveReader->readComponent<CoaddInputs>(_getFitsFile(), ArchiveReader::COADD_INPUTS);
252 }
253 
255  _ensureReaders();
256  return _metadataReader->visitInfo;
257 }
258 
260  _ensureReaders();
261  return _archiveReader->readComponent<TransmissionCurve>(_getFitsFile(),
263 }
264 
266  _ensureReaders();
267  return _archiveReader->readComponent<cameraGeom::Detector>(_getFitsFile(), ArchiveReader::DETECTOR);
268 }
269 
271  auto result = std::make_shared<ExposureInfo>();
272  result->setMetadata(readMetadata());
273  result->setFilter(readFilter());
274  result->setCalib(readCalib());
275  result->setVisitInfo(readVisitInfo());
276  // When reading an ExposureInfo (as opposed to reading individual
277  // components), we warn and try to proceed when a component is present
278  // but can't be read due its serialization factory not being set up
279  // (that's what throws the NotFoundErrors caught below).
280  try {
281  result->setPsf(readPsf());
282  } catch (pex::exceptions::NotFoundError& err) {
283  LOGLS_WARN(_log, "Could not read PSF; setting to null: " << err.what());
284  }
285  try {
286  result->setCoaddInputs(readCoaddInputs());
287  } catch (pex::exceptions::NotFoundError& err) {
288  LOGLS_WARN(_log, "Could not read CoaddInputs; setting to null: " << err.what());
289  }
290  try {
291  result->setApCorrMap(readApCorrMap());
292  } catch (pex::exceptions::NotFoundError& err) {
293  LOGLS_WARN(_log, "Could not read ApCorrMap; setting to null: " << err.what());
294  }
295  try {
296  result->setValidPolygon(readValidPolygon());
297  } catch (pex::exceptions::NotFoundError& err) {
298  LOGLS_WARN(_log, "Could not read ValidPolygon; setting to null: " << err.what());
299  }
300  try {
301  result->setTransmissionCurve(readTransmissionCurve());
302  } catch (pex::exceptions::NotFoundError& err) {
303  LOGLS_WARN(_log, "Could not read TransmissionCurve; setting to null: " << err.what());
304  }
305  try {
306  result->setDetector(readDetector());
307  } catch (pex::exceptions::NotFoundError& err) {
308  LOGLS_WARN(_log, "Could not read Detector; setting to null: " << err.what());
309  }
310  // In the case of WCS, we fall back to the metadata WCS if the one from
311  // the archive can't be read.
312  _ensureReaders();
313  result->setWcs(_metadataReader->wcs);
314  try {
315  auto wcs = _archiveReader->readComponent<afw::geom::SkyWcs>(_getFitsFile(), ArchiveReader::WCS);
316  if (!wcs) {
317  LOGLS_DEBUG(_log, "No WCS found in binary table");
318  } else {
319  result->setWcs(wcs);
320  }
321  } catch (pex::exceptions::NotFoundError& err) {
322  auto msg = str(boost::format("Could not read WCS extension; setting to null: %s") % err.what());
323  if (result->hasWcs()) {
324  msg += " ; using WCS from FITS header";
325  }
326  LOGLS_WARN(_log, msg);
327  }
328  return result;
329 }
330 
331 template <typename ImagePixelT>
333  bool allowUnsafe) {
334  return _maskedImageReader.readImage<ImagePixelT>(bbox, origin, allowUnsafe);
335 }
336 
337 template <typename ImagePixelT>
338 ndarray::Array<ImagePixelT, 2, 2> ExposureFitsReader::readImageArray(lsst::geom::Box2I const& bbox,
339  ImageOrigin origin, bool allowUnsafe) {
340  return _maskedImageReader.readImageArray<ImagePixelT>(bbox, origin, allowUnsafe);
341 }
342 
343 template <typename MaskPixelT>
345  bool conformMasks, bool allowUnsafe) {
346  return _maskedImageReader.readMask<MaskPixelT>(bbox, origin, conformMasks, allowUnsafe);
347 }
348 
349 template <typename MaskPixelT>
350 ndarray::Array<MaskPixelT, 2, 2> ExposureFitsReader::readMaskArray(lsst::geom::Box2I const& bbox,
351  ImageOrigin origin, bool allowUnsafe) {
352  return _maskedImageReader.readMaskArray<MaskPixelT>(bbox, origin, allowUnsafe);
353 }
354 
355 template <typename VariancePixelT>
357  bool allowUnsafe) {
358  return _maskedImageReader.readVariance<VariancePixelT>(bbox, origin, allowUnsafe);
359 }
360 
361 template <typename VariancePixelT>
362 ndarray::Array<VariancePixelT, 2, 2> ExposureFitsReader::readVarianceArray(lsst::geom::Box2I const& bbox,
363  ImageOrigin origin,
364  bool allowUnsafe) {
365  return _maskedImageReader.readVarianceArray<VariancePixelT>(bbox, origin, allowUnsafe);
366 }
367 
368 template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
370  lsst::geom::Box2I const& bbox, ImageOrigin origin, bool conformMasks, bool allowUnsafe) {
371  return _maskedImageReader.read<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks,
372  /* needAllHdus= */ false,
373  allowUnsafe);
374 }
375 
376 template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
378  ImageOrigin origin,
379  bool conformMasks,
380  bool allowUnsafe) {
381  auto mi =
382  readMaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks, allowUnsafe);
384 }
385 
386 void ExposureFitsReader::_ensureReaders() {
387  if (!_metadataReader) {
388  auto metadataReader = std::make_unique<MetadataReader>(_maskedImageReader.readPrimaryMetadata(),
389  _maskedImageReader.readImageMetadata(),
390  _maskedImageReader.readXY0());
391  _archiveReader = std::make_unique<ArchiveReader>(*metadataReader->metadata);
392  _metadataReader = std::move(metadataReader); // deferred for exception safety
393  }
394  assert(_archiveReader); // should always be initialized with _metadataReader.
395 }
396 
397 #define INSTANTIATE(ImagePixelT) \
398  template Exposure<ImagePixelT, MaskPixel, VariancePixel> ExposureFitsReader::read( \
399  lsst::geom::Box2I const&, ImageOrigin, bool, bool); \
400  template Image<ImagePixelT> ExposureFitsReader::readImage(lsst::geom::Box2I const&, ImageOrigin, bool); \
401  template ndarray::Array<ImagePixelT, 2, 2> ExposureFitsReader::readImageArray(lsst::geom::Box2I const&, \
402  ImageOrigin, bool); \
403  template MaskedImage<ImagePixelT, MaskPixel, VariancePixel> ExposureFitsReader::readMaskedImage( \
404  lsst::geom::Box2I const&, ImageOrigin, bool, bool)
405 
407 INSTANTIATE(int);
408 INSTANTIATE(float);
409 INSTANTIATE(double);
411 
412 template Mask<MaskPixel> ExposureFitsReader::readMask(lsst::geom::Box2I const&, ImageOrigin, bool, bool);
413 template ndarray::Array<MaskPixel, 2, 2> ExposureFitsReader::readMaskArray(lsst::geom::Box2I const&,
414  ImageOrigin, bool);
415 
416 template Image<VariancePixel> ExposureFitsReader::readVariance(lsst::geom::Box2I const&, ImageOrigin, bool);
417 template ndarray::Array<VariancePixel, 2, 2> ExposureFitsReader::readVarianceArray(lsst::geom::Box2I const&,
418  ImageOrigin, bool);
419 
420 } // namespace image
421 } // namespace afw
422 } // namespace lsst
#define LOGLS_WARN(logger, message)
Log a warn-level message using an iostream-based interface.
Definition: Log.h:633
static std::string const & getFitsSerializationVersionName()
Get the version of FITS serialization version info name.
Definition: ExposureInfo.cc:49
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:688
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.
static int getFitsSerializationVersion()
Get the version of FITS serialization that this ExposureInfo understands.
Definition: ExposureInfo.cc:44
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:593
A base class for image defects.
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:168
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.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
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.
table::Key< int > version
Definition: PhotoCalib.cc:272
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:75
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.