Skip to content

Commit

Permalink
Add apCorrMap interface to Exposure
Browse files Browse the repository at this point in the history
Fowards everything to ExposureInfo, but we have such an interface for
several other such components.
  • Loading branch information
parejkoj committed Jul 25, 2023
1 parent baf8900 commit 8b7d701
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/lsst/afw/image/Exposure.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ class Exposure {

std::shared_ptr<geom::SkyWcs const> getWcs() const { return _info->getWcs(); }

std::shared_ptr<ApCorrMap const> getApCorrMap() const { return _info->getApCorrMap(); }

/// Return the Exposure's Detector information
std::shared_ptr<lsst::afw::cameraGeom::Detector const> getDetector() const {
return _info->getDetector();
Expand Down Expand Up @@ -313,6 +315,9 @@ class Exposure {
/// Does this Exposure have a Wcs?
bool hasWcs() const { return _info->hasWcs(); }

/// Set the Exposure's aperture correction map.
void setApCorrMap(std::shared_ptr<ApCorrMap const> apCorrMap) { _info->setApCorrMap(apCorrMap); }

/// Get the ExposureInfo that aggregates all the non-image components. Never null.
std::shared_ptr<ExposureInfo> getInfo() { return _info; }

Expand Down
4 changes: 4 additions & 0 deletions python/lsst/afw/image/_exposure/_exposure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "lsst/afw/image/FilterLabel.h"
#include "lsst/afw/image/Exposure.h"
#include "lsst/afw/detection/Psf.h"
#include "lsst/afw/image/ApCorrMap.h"

namespace py = pybind11;
using namespace pybind11::literals;
Expand Down Expand Up @@ -135,6 +136,9 @@ PyExposure<PixelT> declareExposure(lsst::utils::python::WrapperCollection &wrapp
cls.def_property_readonly("visitInfo",
[](ExposureT &self) { return self.getInfo()->getVisitInfo(); });

cls.def("setApCorrMap", &ExposureT::setApCorrMap, "apCorrMap"_a);
cls.def_property_readonly("apCorrMap", [](ExposureT &self) { return self.getApCorrMap(); });

cls.def("subset", &ExposureT::subset, "bbox"_a, "origin"_a = PARENT);

cls.def("writeFits", (void(ExposureT::*)(std::string const &) const) & ExposureT::writeFits);
Expand Down

0 comments on commit 8b7d701

Please sign in to comment.