Namespace lsst::ip::isr

namespace isr

Functions

template<typename PixelT>
int applyLookupTable(afw::image::Image<PixelT> &image, ndarray::Array<PixelT, 1, 1> const &table, PixelT indOffset)

Add the values in a lookup table to an image, e.g. for non-linearity correction

The algorithm is as follows: numOutOfRange = 0 For each i,j of the image: lookupInd = int(indOffset + image[i,j]) if lookupInd not in range [0, table.size() - 1]: set lookupInd to nearest edge and increment numOutOfRange image[i,j] += table[lookupInd] return numOutOfRange

Return

the number of pixels whose values were out of range

Parameters
  • [inout] image: image to which to add the values; modified in place

  • [in] table: lookup table

  • [in] indOffset: scalar added to image value before truncating to lookup column

template<typename PixelT>
size_t maskNans(afw::image::MaskedImage<PixelT> const &mi, afw::image::MaskPixel maskVal, afw::image::MaskPixel allow = 0)

Parameters
  • mi: Input image

  • maskVal: Bit mask value to give a NaN

  • allow: Retain NANs with this bit mask (0 to mask all NANs)

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’.

Return

Number of pixels masked

template<typename ImagePixelT, typename FunctionT>
void fitOverscanImage(std::shared_ptr<lsst::afw::math::Function1<FunctionT>> &overscanFunction, lsst::afw::image::MaskedImage<ImagePixelT> const &overscan, double ssize = 1., int sigma = 1)