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>
89 const int width = overscan.
getWidth();
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);
97 for (
int y = 0;
y < height; ++
y) {
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>;
An include file to include the public header files for lsst::afw::math.
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
boost::uint16_t MaskPixel
int getWidth() const
Return the number of columns in the image.
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)
definition of the Trace messaging facilities
estimate sample standard deviation
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)
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
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
Ref< MaskPixelT >::type mask()
Return (a reference to) the mask part of the Pixel pointed at by the iterator.
An iterator to the MaskedImage.
Results from minimizing a function.
A class to manipulate images, masks, and variance as a single object.
A Function taking one argument.
std::vector< double > parameterList
fit parameters
A pixel of a MaskedImage.
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
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
size_t maskNans(afw::image::MaskedImage< PixelT > const &mi, afw::image::MaskPixel maskVal, afw::image::MaskPixel allow=0)
int getHeight() const
Return the number of rows in the image.
template size_t maskNans< double >(afw::image::MaskedImage< double > const &, afw::image::MaskPixel, afw::image::MaskPixel)