asinh
to Control the Dynamic Range of
Data that can be Negative
I[i]
, with one value (say
I[0]
) missing, how should we go about replacing it? Due
to laziness on the part of RHL, we restrict ourselves to 1-dimensional
interpolation; the adopted algorithm would trivially extend to working
in 2-d, but the book-keeping is a little intimidating.
The simplest solution would be to interpolate linearily,
I'[0] = (I[-1] + I[1])/2,but this doesn't perform well for marginally sampled data.
We know something about the auto-correlation present in our data, as it has been convolved with the PSF; we should look for interpolation schemes that minimise errors when interpolating over missing data in a signal consisting solely of the PSF.
I'[0] = (-I[-2] + 3*I[-1] + 3*I[1] - I[2])/4for a reasonably wide range of FWHM (providing that the data is at least marginally sampled). This is the filter that we've adopted for the photometric pipeline.
-I[0]
; consider Fourier transforming this ---
it's clear that we'll have power -I[0]
at the Nyquist limit,
which is the value that we want. The formula giving the Nyquist power is
... - I[-3] + I[-2] - I[-1] - I[1] + I[2] - I[3] + ...so our estimate becomes
I'[0] = ... + I[-3] - I[-2] + I[-1] + I[1] - I[2] + I[3] + ...and the formula given above is seen as a suitably belled version of this result.
The basic idea is to divide the I[i] into signal and noise, I[i] == s[i] + n[i], and then to estimate value of pixel ?, S[?], as a weighted sum:
S[?] = Sum_i d_i I[i] == Sum_i d_i (s[i] + n[i])
We can then attempt to mimimise the expectation value, E, of the squared residual S[?] - s[?]:
E == <(S[?] - s[?])^2> = <(Sum_i d_i (s[i] + n[i]) - s[?])^2>i.e., differentiating with respect to d_i,
<(s[i] + n[i])(S[?] - Sum_j d_j (s[j] + n[j]))> = 0or
< s[i]S[?] > = Sum_j d_j < (s[i] + n[i])(s[j] + n[j]) > = Sum_j d_j < s[i]s[j] > + < n[i]n[j] >if we assume that signal and noise are uncorrelated. If we assume that our images consists of uncorrelated PSFs, then <s[i]s[j]> == e^{-(i-j)^2/alpha^2} and <n[i]n[j]> == N_i delta_{ij} and we may invert this matrix equation to estimate the d_i. Details (and figures) are provided in Linear Prediction and Interpolation.
regStatsFromQuartiles
constructs a histogram
of pixel intensities for an image, and derives any of a wide range of
parameters. See the source code for details.
This is achieved by inserting extra knots at cleverly chosen places, and seems to work well in practice.
asinh
to Control the Dynamic Range of Data that can be Negativeasinh(x/Delta)
instead of lg(x)
, where Delta
is
some constant with magnitude comparable to the expected error in x. This has
the nice property of being (within a scale) a simple logarithm for x >> Delta,
and approximately linear for x <~ Delta.
For more details, see the paper by Szalay, Lupton, and Gunn.
mode = median - (Q25 + Q75 - 2*median)/eta^2where eta ~ 0.673 is the 75th percentile of an N(0,1) Gaussian. We can then estimate the mode as
5.4*median - 2.2*(Q25 + Q75)The variance of this estimate is approximately
(4.78)^2 sigma^2/N;much worse then the mean (with variance
sigma^2/N
),
and 3.8 times worse than the median (whose variance is
(pi/2)sigma^2/N
).