31 namespace lsst {
namespace ip {
namespace isr {
34 template <
typename ImageT>
36 double igain = 1.0 / gain;
41 int ind =
static_cast<int>(ptr.image() + 0.5);
45 }
else if (ind >= _max) {
49 PixelT p =
PixelT(_table[ind], (*ptr).mask(), _table[ind] * igain);
53 if ((nPixTooHigh > 0) || (nPixTooLow > 0)) {
55 pex::logging::TTrace<1>(
"lsst.ip.isr.LookupTableReplace.apply",
56 "Data truncated; %d pixels were < 0; %d pixels were >= %d", nPixTooLow, nPixTooHigh, _max);
60 template <
typename PixelT>
68 if (!(ptr.mask() & allow) && (!utils::lsst_isfinite(ptr.image()) ||
69 !utils::lsst_isfinite(ptr.variance()))) {
71 ptr.
mask() |= maskVal;
78 template<
typename ImagePixelT,
typename FunctionT>
90 std::vector<double> values(height);
91 std::vector<double> errors(height);
92 std::vector<double> positions(height);
94 std::vector<double> parameters(overscanFunction->getNParameters(), 0.);
95 std::vector<double> stepsize(overscanFunction->getNParameters(), ssize);
105 MaskedImage mi = MaskedImage(overscan, bbox);
126 std::string
between(std::string &s,
char ldelim,
char rdelim) {
127 std::string::iterator
b(s.begin());
128 std::string::iterator e(s.end());
129 std::string::iterator lp;
130 std::string::iterator rp;
134 if((lp = std::find(
b, e, ldelim)) != e)
135 if((rp = std::find(++lp, e, rdelim)) != e)
136 result = std::string(lp, rp);
157 template class CountMaskedPixels<float>;
158 template class CountMaskedPixels<double>;
162 template class LookupTableMultiplicative<float>;
163 template class LookupTableMultiplicative<double>;
166 template class LookupTableReplace<int>;
168 template class LookupTableReplace<float>;
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
An include file to include the public header files for lsst::afw::math.
std::vector< double > parameterList
fit parameters
Ref< MaskPixelT >::type mask()
Return (a reference to) the mask part of the Pixel pointed at by the iterator.
std::string between(std::string &s, char ldelim, char rdelim)
Implementation of the templated Instrument Signature Removal stage of the nightly LSST Image Processi...
void fitOverscanImage(boost::shared_ptr< lsst::afw::math::Function1< FunctionT > > &overscanFunction, lsst::afw::image::MaskedImage< ImagePixelT > const &overscan, double ssize=1., int sigma=1)
boost::uint16_t MaskPixel
int getHeight() const
Return the number of rows in the image.
estimate sample standard deviation
definition of the Trace messaging facilities
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
void apply(lsst::afw::image::MaskedImage< ImageT > &image, float gain=1.0) const
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)
template size_t maskNans< float >(afw::image::MaskedImage< float > const &, afw::image::MaskPixel, afw::image::MaskPixel)
An integer coordinate rectangle.
afw::table::Key< double > sigma
table::Key< table::Array< Kernel::Pixel > > image
An iterator to the MaskedImage.
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
void ImageT ImageT int float saturatedPixelValue int const width
Results from minimizing a function.
A class to manipulate images, masks, and variance as a single object.
A Function taking one argument.
void ImageT ImageT int float saturatedPixelValue int const height
A pixel of a MaskedImage.
int getWidth() const
Return the number of columns in the image.
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
Compute Image Statistics.
afw::table::Key< double > b
size_t maskNans(afw::image::MaskedImage< PixelT > const &mi, afw::image::MaskPixel maskVal, afw::image::MaskPixel allow=0)
template size_t maskNans< double >(afw::image::MaskedImage< double > const &, afw::image::MaskPixel, afw::image::MaskPixel)