LSSTApplications  11.0-22-g33de520,13.0+153,14.0+52,14.0+57,14.0-1-g013352c+36,14.0-1-g13ef843+9,14.0-1-g4b114ac+14,14.0-1-g7257b6a+12,14.0-1-g8b7e855+51,14.0-13-g7a60b79+2,14.0-14-g87d16e8+10,14.0-14-gbf7a6f8a,14.0-17-g4f4ea82+5,14.0-2-g319577b+11,14.0-2-ga5af9b6+10,14.0-22-gc48c03f+3,14.0-3-g20413be+3,14.0-46-g76222d5f+3,14.0-47-g0a51fac97,14.0-5-g744ff5f+2,14.0-5-g86eb1bd+31,14.0-6-gd5b81a9+6,14.0-6-ge2c9487+42,14.0-8-g7f6dd6b+6,14.0-8-gb81b6e9+4,14.0-9-g11010eb,14.0-9-g330837b+5
LSSTDataManagementBasePackage
BinnedWcs.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2014 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 #ifndef LSST_MEAS_ALGORITHMS_BINNEDWCS_H
26 #define LSST_MEAS_ALGORITHMS_BINNEDWCS_H
27 
28 #include <memory>
29 
30 #include "lsst/pex/exceptions.h"
31 #include "lsst/afw/image/Wcs.h"
32 #include "lsst/afw/geom/Point.h"
33 
34 
35 namespace lsst { namespace meas { namespace algorithms {
36 
40 
41 class BinnedWcs : public afw::image::Wcs, public std::enable_shared_from_this<BinnedWcs> {
42 public:
43  BinnedWcs(PTR(afw::image::Wcs) parent, unsigned int xBin, unsigned int yBin, afw::geom::Point2I xy0);
44  virtual ~BinnedWcs() {}
45 
46  virtual PTR(afw::image::Wcs) clone() const {
47  return PTR(afw::image::Wcs)(std::make_shared<BinnedWcs>(_parent, _xBin, _yBin, _xy0));
48  }
50 
51  PTR(afw::image::Wcs) getParent() const { return _parent; }
52  unsigned int getXBin() const { return _xBin; }
53  unsigned int getYBin() const { return _yBin; }
54  afw::geom::Point2I getXY0() const { return _xy0; }
55 
56  virtual bool hasDistortion() const { return _parent->hasDistortion(); }
57  virtual bool isPersistable() const { return false; }
58 
59  virtual void flipImage(int flipLR, int flipTB, afw::geom::Extent2I dimensions) const {
61  }
62  virtual void rotateImageBy90(int nQuarter, afw::geom::Extent2I dimensions) const {
64  }
67  return PTR(daf::base::PropertyList)(); // unreached
68  }
69 
72 
73 protected:
74  virtual void pixelToSkyImpl(double pixel1, double pixel2, afw::geom::Angle skyTmp[2]) const;
76 
77 private:
78  void notImplemented() const {
79  throw LSST_EXCEPT(NotImplementedException, "Feature has not been implemented");
80  }
82  unsigned int const _xBin, _yBin;
85 };
86 
87 }}} // namespace lsst::meas::algorithms
88 
89 #endif // LSST_MEAS_ALGORITHMS_BINNED_WCS_H
afw::geom::Point2I const _xy0
Definition: BinnedWcs.h:83
unsigned int const _xBin
Definition: BinnedWcs.h:82
virtual void rotateImageBy90(int nQuarter, afw::geom::Extent2I dimensions) const
Rotate image by nQuarter times 90 degrees.
Definition: BinnedWcs.h:62
virtual afw::geom::Point2D skyToPixelImpl(afw::geom::Angle sky1, afw::geom::Angle sky2) const
Worker routine for skyToPixel.
Definition: BinnedWcs.cc:55
Class for storing ordered metadata with comments.
Definition: PropertyList.h:73
unsigned int getXBin() const
Definition: BinnedWcs.h:52
virtual boost::shared_ptr< afw::image::Wcs > clone() const
Definition: BinnedWcs.h:46
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:104
virtual void flipImage(int flipLR, int flipTB, afw::geom::Extent2I dimensions) const
Flip CD matrix around the y-axis.
Definition: BinnedWcs.h:59
#define PTR(...)
Definition: base.h:41
afw::geom::AffineTransform getBinnedToOriginal() const
Definition: BinnedWcs.h:70
afw::geom::AffineTransform const _binnedToOriginal
Definition: BinnedWcs.h:84
boost::shared_ptr< afw::image::Wcs > const _parent
Definition: BinnedWcs.h:81
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:44
afw::geom::AffineTransform getOriginalToBinned() const
Definition: BinnedWcs.h:71
A class representing an angle.
Definition: Angle.h:102
afw::geom::Point2I getXY0() const
Definition: BinnedWcs.h:54
An exception that indicates the feature has not been implemented.
Definition: BinnedWcs.h:39
A base class for image defects.
Definition: cameraGeom.dox:3
An affine coordinate transformation consisting of a linear transformation and an offset.
boost::shared_ptr< afw::image::Wcs > upcast()
Definition: BinnedWcs.h:49
afw::geom::AffineTransform const _originalToBinned
Definition: BinnedWcs.h:84
BinnedWcs(boost::shared_ptr< afw::image::Wcs > parent, unsigned int xBin, unsigned int yBin, afw::geom::Point2I xy0)
Definition: BinnedWcs.cc:29
virtual void pixelToSkyImpl(double pixel1, double pixel2, afw::geom::Angle skyTmp[2]) const
Worker routine for pixelToSky.
Definition: BinnedWcs.cc:48
Include files required for standard LSST Exception handling.
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
virtual boost::shared_ptr< daf::base::PropertyList > getFitsMetadata() const
Return a PropertyList containing FITS header keywords that can be used to save the Wcs...
Definition: BinnedWcs.h:65
virtual bool isPersistable() const
Whether the Wcs is persistable using afw::table::io archives.
Definition: BinnedWcs.h:57
boost::shared_ptr< afw::image::Wcs > getParent() const
Definition: BinnedWcs.h:51
#define LSST_EXCEPTION_TYPE(t, b, c)
Macro used to define new types of exceptions without additional data.
Definition: Exception.h:68
unsigned int const _yBin
Definition: BinnedWcs.h:82
virtual bool hasDistortion() const
Definition: BinnedWcs.h:56
unsigned int getYBin() const
Definition: BinnedWcs.h:53