LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Namespaces | Classes | Enumerations | Functions | Variables
lsst::ip::isr Namespace Reference

Namespaces

 assembleCcdTask
 
 fringe
 
 isr
 
 isrTask
 
 version
 

Classes

class  LookupTableMultiplicative
 
class  LookupTableReplace
 
class  CountMaskedPixels
 

Enumerations

enum  StageId {
  ISR_LINid = 0x1, ISR_OSCANid = 0x2, ISR_TRIMid = 0x4, ISR_BIASid = 0x8,
  ISR_DFLATid = 0x10, ISR_ILLUMid = 0x20, ISR_BADPid = 0x40, ISR_SATid = 0x80,
  ISR_FRINid = 0x100, ISR_DARKid = 0x200, ISR_PUPILid = 0x400, ISR_CRREJid = 0x800,
  ISR_BACKSUBid = 0x1000
}
 

Functions

template<typename PixelT >
size_t maskNans (afw::image::MaskedImage< PixelT > const &mi, afw::image::MaskPixel maskVal, afw::image::MaskPixel allow=0)
 
template<typename ImagePixelT , typename FunctionT >
void fitOverscanImage (boost::shared_ptr< lsst::afw::math::Function1< FunctionT > > &overscanFunction, lsst::afw::image::MaskedImage< ImagePixelT > const &overscan, double ssize=1., int sigma=1)
 
template<typename ImagePixelT , typename FunctionT >
void fitOverscanImage (boost::shared_ptr< afw::math::Function1< FunctionT > > &overscanFunction, afw::image::MaskedImage< ImagePixelT > const &overscan, double ssize, int sigma)
 
std::string between (std::string &s, char ldelim, char rdelim)
 
template void fitOverscanImage (boost::shared_ptr< afw::math::Function1< double > > &overscanFunction, afw::image::MaskedImage< float > const &overscan, double ssize, int sigma)
 
template void fitOverscanImage (boost::shared_ptr< afw::math::Function1< double > > &overscanFunction, afw::image::MaskedImage< double > const &overscan, double ssize, int sigma)
 
template size_t maskNans< float > (afw::image::MaskedImage< float > const &, afw::image::MaskPixel, afw::image::MaskPixel)
 
template size_t maskNans< double > (afw::image::MaskedImage< double > const &, afw::image::MaskPixel, afw::image::MaskPixel)
 

Variables

std::string const & ISR_LIN = "ISR_LIN"
 Linearization. More...
 
std::string const & ISR_OSCAN = "ISR_OSCAN"
 Overscan. More...
 
std::string const & ISR_TRIM = "ISR_TRIM"
 Trim. More...
 
std::string const & ISR_BIAS = "ISR_BIAS"
 Bias. More...
 
std::string const & ISR_DFLAT = "ISR_DFLAT"
 Dome flat. More...
 
std::string const & ISR_ILLUM = "ISR_ILLUM"
 Illumination correction. More...
 
std::string const & ISR_BADP = "ISR_BADP"
 Bad pixel mask. More...
 
std::string const & ISR_SAT = "ISR_SAT"
 Saturated pixels. More...
 
std::string const & ISR_FRING = "ISR_FRING"
 Fringe correction. More...
 
std::string const & ISR_DARK = "ISR_DARK"
 Dark correction. More...
 
std::string const & ISR_PUPIL = "ISR_PUPIL"
 Pupil correction. More...
 
std::string const & ISR_CRREJ = "ISR_CRREJ"
 Cosmic ray rejection. More...
 
std::string const & ISR_BACKSUB = "ISR_BACKSUB"
 Background subtraction. More...
 

Enumeration Type Documentation

Enumerator
ISR_LINid 

Linearization.

ISR_OSCANid 

Overscan.

ISR_TRIMid 

Trim.

ISR_BIASid 

Bias.

ISR_DFLATid 

Dome flat.

ISR_ILLUMid 

Illumination correction.

ISR_BADPid 

Bad pixel mask.

ISR_SATid 

Saturated pixels.

ISR_FRINid 

Fringe correction.

ISR_DARKid 

Dark correction.

ISR_PUPILid 

Pupil correction.

ISR_CRREJid 

Cosmic ray rejection.

ISR_BACKSUBid 

Cosmic ray rejection.

Definition at line 85 of file isr.h.

85  {
86  ISR_LINid = 0x1,
87  ISR_OSCANid = 0x2,
88  ISR_TRIMid = 0x4,
89  ISR_BIASid = 0x8,
90  ISR_DFLATid = 0x10,
91  ISR_ILLUMid = 0x20,
92  ISR_BADPid = 0x40,
93  ISR_SATid = 0x80,
94  ISR_FRINid = 0x100,
95  ISR_DARKid = 0x200,
96  ISR_PUPILid = 0x400,
97  ISR_CRREJid = 0x800,
98  ISR_BACKSUBid = 0x1000,
99  };
Linearization.
Definition: isr.h:86
Cosmic ray rejection.
Definition: isr.h:97
Saturated pixels.
Definition: isr.h:93
Illumination correction.
Definition: isr.h:91
Dome flat.
Definition: isr.h:90
Bad pixel mask.
Definition: isr.h:92
Cosmic ray rejection.
Definition: isr.h:98
Fringe correction.
Definition: isr.h:94
Pupil correction.
Definition: isr.h:96
Dark correction.
Definition: isr.h:95

Function Documentation

std::string lsst::ip::isr::between ( std::string &  s,
char  ldelim,
char  rdelim 
)

Definition at line 126 of file Isr.cc.

126  {
127  std::string::iterator b(s.begin());
128  std::string::iterator e(s.end());
129  std::string::iterator lp;
130  std::string::iterator rp;
131 
132  std::string result;
133 
134  if((lp = std::find(b, e, ldelim)) != e)
135  if((rp = std::find(++lp, e, rdelim)) != e)
136  result = std::string(lp, rp);
137 
138  return result;
139 }
afw::table::Key< double > b
template<typename ImagePixelT , typename FunctionT >
void lsst::ip::isr::fitOverscanImage ( boost::shared_ptr< afw::math::Function1< FunctionT > > &  overscanFunction,
afw::image::MaskedImage< ImagePixelT > const &  overscan,
double  ssize,
int  sigma 
)

afw::geom::Box2I bbox = afw::geom::Box2I( afw::geom::Point2I(0, y), afw::geom::Point2I(0, width) ); The above was how this was defined before ticket #1556. As I understand it the following is the new way to do this

Definition at line 79 of file Isr.cc.

84  {
85  typedef afw::image::MaskedImage<ImagePixelT> MaskedImage;
86 
87 
88  const int height = overscan.getHeight();
89  const int width = overscan.getWidth();
90  std::vector<double> values(height);
91  std::vector<double> errors(height);
92  std::vector<double> positions(height);
93 
94  std::vector<double> parameters(overscanFunction->getNParameters(), 0.);
95  std::vector<double> stepsize(overscanFunction->getNParameters(), ssize);
96 
97  for (int y = 0; y < height; ++y) {
104  afw::geom::Box2I bbox = afw::geom::Box2I(afw::geom::Point2I(0,y), afw::geom::Point2I(width,y));
105  MaskedImage mi = MaskedImage(overscan, bbox);
106  afw::math::Statistics stats = afw::math::makeStatistics(*(mi.getImage()), afw::math::MEAN | afw::math::STDEV);
107 
108  values[y] = stats.getValue(afw::math::MEAN);
109  errors[y] = stats.getValue(afw::math::STDEV);
110  positions[y] = y;
111 
112  }
113  afw::math::FitResults fitResults = afw::math::minimize(
114  *overscanFunction,
115  parameters,
116  stepsize,
117  values,
118  errors,
119  positions,
120  sigma
121  );
122 
123  overscanFunction->setParameters(fitResults.parameterList);
124 }
int y
estimate sample mean
Definition: Statistics.h:67
estimate sample standard deviation
Definition: Statistics.h:68
FitResults minimize(lsst::afw::math::Function1< ReturnT > const &function, std::vector< double > const &initialParameterList, std::vector< double > const &stepSizeList, std::vector< double > const &measurementList, std::vector< double > const &varianceList, std::vector< double > const &xPositionList, double errorDef)
Point< int, 2 > Point2I
Definition: PSF.h:39
afw::table::Key< double > sigma
Definition: GaussianPsf.cc:43
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
Definition: Statistics.cc:1082
template void lsst::ip::isr::fitOverscanImage ( boost::shared_ptr< afw::math::Function1< double > > &  overscanFunction,
afw::image::MaskedImage< float > const &  overscan,
double  ssize,
int  sigma 
)
template void lsst::ip::isr::fitOverscanImage ( boost::shared_ptr< afw::math::Function1< double > > &  overscanFunction,
afw::image::MaskedImage< double > const &  overscan,
double  ssize,
int  sigma 
)
template<typename ImagePixelT , typename FunctionT >
void lsst::ip::isr::fitOverscanImage ( boost::shared_ptr< lsst::afw::math::Function1< FunctionT > > &  overscanFunction,
lsst::afw::image::MaskedImage< ImagePixelT > const &  overscan,
double  ssize = 1.,
int  sigma = 1 
)
template<typename PixelT >
size_t lsst::ip::isr::maskNans ( afw::image::MaskedImage< PixelT > const &  mi,
afw::image::MaskPixel  maskVal,
afw::image::MaskPixel  allow = 0 
)

Mask NANs in an image

NANs in the image or variance that are not already masked by the 'allow' value are masked with the 'maskVal'.

Returns
Number of pixels masked
Parameters
miInput image
maskValBit mask value to give a NaN
allowAllow NANs with this bit mask (0 to disallow all NANs)

Definition at line 61 of file Isr.cc.

63 {
64  typedef typename afw::image::MaskedImage<PixelT>::x_iterator x_iterator;
65  size_t nPix = 0;
66  for (int y = 0; y != mi.getHeight(); ++y) {
67  for (x_iterator ptr = mi.row_begin(y), end = mi.row_end(y); ptr != end; ++ptr) {
68  if (!(ptr.mask() & allow) && (!utils::lsst_isfinite(ptr.image()) ||
69  !utils::lsst_isfinite(ptr.variance()))) {
70  nPix += 1;
71  ptr.mask() |= maskVal;
72  }
73  }
74  }
75  return nPix;
76 }
int y
template size_t lsst::ip::isr::maskNans< double > ( afw::image::MaskedImage< double > const &  ,
afw::image::MaskPixel  ,
afw::image::MaskPixel   
)
template size_t lsst::ip::isr::maskNans< float > ( afw::image::MaskedImage< float > const &  ,
afw::image::MaskPixel  ,
afw::image::MaskPixel   
)

Variable Documentation

std::string const& lsst::ip::isr::ISR_BACKSUB = "ISR_BACKSUB"

Background subtraction.

Definition at line 83 of file isr.h.

std::string const& lsst::ip::isr::ISR_BADP = "ISR_BADP"

Bad pixel mask.

Definition at line 77 of file isr.h.

std::string const& lsst::ip::isr::ISR_BIAS = "ISR_BIAS"

Bias.

Definition at line 74 of file isr.h.

std::string const& lsst::ip::isr::ISR_CRREJ = "ISR_CRREJ"

Cosmic ray rejection.

Definition at line 82 of file isr.h.

std::string const& lsst::ip::isr::ISR_DARK = "ISR_DARK"

Dark correction.

Definition at line 80 of file isr.h.

std::string const& lsst::ip::isr::ISR_DFLAT = "ISR_DFLAT"

Dome flat.

Definition at line 75 of file isr.h.

std::string const& lsst::ip::isr::ISR_FRING = "ISR_FRING"

Fringe correction.

Definition at line 79 of file isr.h.

std::string const& lsst::ip::isr::ISR_ILLUM = "ISR_ILLUM"

Illumination correction.

Definition at line 76 of file isr.h.

std::string const& lsst::ip::isr::ISR_LIN = "ISR_LIN"

Linearization.

Signature strings associated with each stage of the ISR

Note
Added to Exposure metadata after stage processing
As implementation detail, no more than 8 characters for fits compliance?

Definition at line 71 of file isr.h.

std::string const& lsst::ip::isr::ISR_OSCAN = "ISR_OSCAN"

Overscan.

Definition at line 72 of file isr.h.

std::string const& lsst::ip::isr::ISR_PUPIL = "ISR_PUPIL"

Pupil correction.

Definition at line 81 of file isr.h.

std::string const& lsst::ip::isr::ISR_SAT = "ISR_SAT"

Saturated pixels.

Definition at line 78 of file isr.h.

std::string const& lsst::ip::isr::ISR_TRIM = "ISR_TRIM"

Trim.

Definition at line 73 of file isr.h.