LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Functions | Variables
lsst::meas::algorithms::interp Namespace Reference

Functions

template<typename MaskedImageT >
std::pair< bool, typename MaskedImageT::Image::Pixel > singlePixel (int x, int y, MaskedImageT const &image, bool horizontal, double minval)
 Return a boolean status (true: interpolation is OK) and the interpolated value for a pixel, ignoring pixels given by badmask.
 
 interpolateOverDefects (image, psf, badList, fallbackValue=0.0, useFallbackValueAtEdge=False, fwhm=1.0, useLegacyInterp=True, maskNameList=None, **kwargs)
 

Variables

double const lpc_1_c1 = 0.7737
 LPC coefficients for sigma = 1, S/N = infty.
 
double const lpc_1_c2 = -0.2737
 
double const lpc_1s2_c1 = 0.7358
 LPC coefficients for sigma = 1/sqrt(2), S/N = infty.
 
double const lpc_1s2_c2 = -0.2358
 
double const min2GaussianBias = -0.5641895835
 Mean value of the minimum of two N(0,1) variates.
 

Function Documentation

◆ interpolateOverDefects()

lsst.meas.algorithms.interp.interpolateOverDefects ( image,
psf,
badList,
fallbackValue = 0.0,
useFallbackValueAtEdge = False,
fwhm = 1.0,
useLegacyInterp = True,
maskNameList = None,
** kwargs )

Definition at line 7 of file interp.py.

17):
18 if useLegacyInterp:
19 return legacyInterpolateOverDefects(
20 image, psf, badList, fallbackValue, useFallbackValueAtEdge
21 )
22 else:
23 gp = InterpolateOverDefectGaussianProcess(image, fwhm=fwhm,
24 defects=maskNameList, **kwargs)
25 return gp.run()

◆ singlePixel()

template<typename MaskedImageT >
std::pair< bool, typename MaskedImageT::Image::Pixel > lsst::meas::algorithms::interp::singlePixel ( int x,
int y,
MaskedImageT const & image,
bool horizontal,
double minval )

Return a boolean status (true: interpolation is OK) and the interpolated value for a pixel, ignoring pixels given by badmask.

Interpolation can either be vertical or horizontal

Note
: This is a pretty expensive routine, so use only after suitable thought.
Parameters
xx: column coordinate of the pixel in question
yy: row coordinate of the pixel in question
imageimage: in this image
horizontalhorizontal: interpolate horizontally?
minvalminval: minimum acceptable value

Definition at line 2125 of file Interp.cc.

2131 {
2132#if defined(SDSS)
2133 BADCOLUMN defect; /* describe a bad column */
2134 PIX *data; /* temp array to interpolate in */
2135 int i;
2136 int i0, i1; /* data corresponds to range of
2137 {row,col} == [i0,i1] */
2138 int ndata; /* dimension of data */
2139 static int ndatamax = 40; /* largest allowable defect. XXX */
2140 int nrow, ncol; /* == reg->n{row,col} */
2141 PIX *val; /* pointer to pixel (rowc, colc) */
2142 int z1, z2; /* range of bad {row,columns} */
2143
2144 shAssert(badmask != NULL && badmask->type == shTypeGetFromName("OBJMASK"));
2145 shAssert(reg != NULL && reg->type == TYPE_PIX);
2146 nrow = reg->nrow;
2147 ncol = reg->ncol;
2148
2149 if (horizontal) {
2150 for (z1 = colc - 1; z1 >= 0; z1--) {
2151 if (!phPixIntersectMask(badmask, z1, rowc)) {
2152 break;
2153 }
2154 }
2155 z1++;
2156
2157 for (z2 = colc + 1; z2 < ncol; z2++) {
2158 if (!phPixIntersectMask(badmask, z2, rowc)) {
2159 break;
2160 }
2161 }
2162 z2--;
2163
2164 i0 = (z1 > 2) ? z1 - 2 : 0; /* origin of available required data */
2165 i1 = (z2 < ncol - 2) ? z2 + 2 : ncol - 1; /* end of " " " " */
2166
2167 if (i0 < 2 || i1 >= ncol - 2) { /* interpolation will fail */
2168 return (-1); /* failure */
2169 }
2170
2171 ndata = (i1 - i0 + 1);
2172 if (ndata > ndatamax) {
2173 return (-1); /* failure */
2174 }
2175
2176 data = alloca(ndata * sizeof(PIX));
2177 for (i = i0; i <= i1; i++) {
2178 data[i - i0] = reg->ROWS[rowc][i];
2179 }
2180 val = &data[colc - i0];
2181 } else {
2182 for (z1 = rowc - 1; z1 >= 0; z1--) {
2183 if (!phPixIntersectMask(badmask, colc, z1)) {
2184 break;
2185 }
2186 }
2187 z1++;
2188
2189 for (z2 = rowc + 1; z2 < nrow; z2++) {
2190 if (!phPixIntersectMask(badmask, colc, z2)) {
2191 break;
2192 }
2193 }
2194 z2--;
2195
2196 i0 = (z1 > 2) ? z1 - 2 : 0; /* origin of available required data */
2197 i1 = (z2 < nrow - 2) ? z2 + 2 : nrow - 1; /* end of " " " " */
2198
2199 if (i0 < 2 || i1 >= ncol - 2) { /* interpolation will fail */
2200 return (-1); /* failure */
2201 }
2202
2203 ndata = (i1 - i0 + 1);
2204 if (ndata > ndatamax) {
2205 return (-1); /* failure */
2206 }
2207
2208 data = alloca(ndata * sizeof(PIX));
2209 for (i = i0; i <= i1; i++) {
2210 data[i - i0] = reg->ROWS[i][colc];
2211 }
2212 val = &data[rowc - i0];
2213 }
2214
2215 defect.x1 = z1 - i0;
2216 defect.x2 = z2 - i0;
2217 classify_defects(&defect, 1, ndata);
2218 do_defect(&defect, 1, data, ndata, minval);
2219
2220 return (*val);
2221#endif
2222
2224}
char * data
Definition BaseRecord.cc:61
T make_pair(T... args)
ImageT val
Definition CR.cc:146

Variable Documentation

◆ lpc_1_c1

double const lsst::meas::algorithms::interp::lpc_1_c1 = 0.7737

LPC coefficients for sigma = 1, S/N = infty.

Definition at line 51 of file Interp.h.

◆ lpc_1_c2

double const lsst::meas::algorithms::interp::lpc_1_c2 = -0.2737

Definition at line 52 of file Interp.h.

◆ lpc_1s2_c1

double const lsst::meas::algorithms::interp::lpc_1s2_c1 = 0.7358

LPC coefficients for sigma = 1/sqrt(2), S/N = infty.

These are the coeffs to use when interpolating at 45degrees to the row/column

Definition at line 57 of file Interp.h.

◆ lpc_1s2_c2

double const lsst::meas::algorithms::interp::lpc_1s2_c2 = -0.2358

Definition at line 58 of file Interp.h.

◆ min2GaussianBias

double const lsst::meas::algorithms::interp::min2GaussianBias = -0.5641895835

Mean value of the minimum of two N(0,1) variates.

Definition at line 62 of file Interp.h.