LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Interp.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 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  class Psf;
39  }
40 }
41 
42 namespace meas {
43 namespace algorithms {
44 
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,
114  );
115 
116 }}}
117 
118 #endif
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
int y
DefectBase(const geom::Box2I &bbox)
Definition: Defect.h:46
defect is in middle of frame
Definition: Interp.h:78
void interpolateOverDefects(MaskedImageT &mimage, lsst::afw::detection::Psf const &, std::vector< Defect::Ptr > &_badList, double fallbackValue)
Process a set of known bad pixels in an image.
Definition: Interp.cc:1895
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
double max
Definition: attributes.cc:218
int x
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
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:1967
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