LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Interp.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008-2015 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 #if !defined(LSST_MEAS_ALGORITHMS_INTERP_H)
26 #define LSST_MEAS_ALGORITHMS_INTERP_H
27 // Interpolate over defects in a MaskedImage
29 //
30 #include <limits>
31 #include <vector>
32 #include "lsst/afw/image/Defect.h"
34 
35 namespace lsst {
36 namespace afw {
37 namespace detection {
38 
39  class Psf;
40 
41 }} // afw::detection
42 
43 namespace meas {
44 namespace algorithms {
45 namespace interp {
49  double const lpc_1_c1 = 0.7737;
50  double const lpc_1_c2 = -0.2737;
55  double const lpc_1s2_c1 = 0.7358;
56  double const lpc_1s2_c2 = -0.2358;
57  /*
58  * Used to debias min(x, y)
59  */
60  double const min2GaussianBias = -0.5641895835;
61 
62  template <typename MaskedImageT>
63  std::pair<bool, typename MaskedImageT::Image::Pixel> singlePixel(int x, int y, MaskedImageT const &image,
64  bool horizontal, double minval);
65 }
66 
71 public:
72  typedef boost::shared_ptr<Defect> Ptr;
73 
75  LEFT = 1,
80  WIDE,
85  };
86 
87  enum { WIDE_DEFECT = 11 };
88 
90  )
91  :
92  lsst::afw::image::DefectBase(bbox), _pos(static_cast<DefectPosition>(0)), _type(0) { }
93  virtual ~Defect() {}
94 
96  unsigned int type
97  ) {
98  _pos = pos;
99  _type = type;
100  }
101 
102  unsigned int getType() const { return _type; }
103  DefectPosition getPos() const { return _pos; }
104 private:
106  unsigned int _type;
107 };
108 
109 template <typename MaskedImageT>
110 void interpolateOverDefects(MaskedImageT &image,
111  lsst::afw::detection::Psf const &psf,
112  std::vector<Defect::Ptr> &badList,
113  double fallbackValue = 0.0,
114  bool useFallbackValueAtEdge=false
115  );
116 
117 }}} // lsst::meas::algorithms::interp
118 
119 #endif
int y
defect is wide at right boundary
Definition: Interp.h:83
defect is in middle, and wide
Definition: Interp.h:80
double const min2GaussianBias
Mean value of the minimum of two N(0,1) variates.
Definition: Interp.h:60
Encapsulate information about a bad portion of a detector.
Definition: Defect.h:42
boost::shared_ptr< Defect > Ptr
shared pointer to Defect
Definition: Interp.h:72
DefectBase(const geom::Box2I &bbox)
Definition: Defect.h:46
defect is in middle of frame
Definition: Interp.h:78
defect is near right boundary
Definition: Interp.h:82
unsigned int getType() const
Return the defect&#39;s interpolation type.
Definition: Interp.h:102
An integer coordinate rectangle.
Definition: Box.h:53
defect is at left boundary
Definition: Interp.h:75
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
void interpolateOverDefects(MaskedImageT &image, lsst::afw::detection::Psf const &psf, std::vector< Defect::Ptr > &badList, double fallbackValue=0.0, bool useFallbackValueAtEdge=false)
Process a set of known bad pixels in an image.
Definition: Interp.cc:2058
defect is near right, and wide
Definition: Interp.h:81
defect is wide at left boundary
Definition: Interp.h:77
DefectPosition _pos
Position of defect.
Definition: Interp.h:105
defect is near left, and wide
Definition: Interp.h:79
double x
unsigned int _type
Type of defect.
Definition: Interp.h:106
DefectPosition getPos() const
Return the position of the defect.
Definition: Interp.h:103
void classify(DefectPosition pos, unsigned int type)
Definition: Interp.h:95
std::pair< bool, typename MaskedImageT::Image::Pixel > singlePixel(int x, int y, MaskedImageT const &image, bool horizontal, double minval)
Definition: Interp.cc:2134
defect is near left boundary
Definition: Interp.h:76
Implementation of the Class MaskedImage.
Defect(const lsst::afw::geom::BoxI &bbox=lsst::afw::geom::BoxI())
Definition: Interp.h:89
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:68
defect is at right boundary
Definition: Interp.h:84
Encapsulate information about a bad portion of a detector.
Definition: Interp.h:70