parabolic_turning_point only uses 3 points because the parabola has
three unknowns.  Any more points, and you have to do some fitting, and
that brings its own problems.  No need to fit with only three

points.


repair_2dimage_nonfinite fixes one non-finite number at a time.  The
routine will fail if *all* the pixels around the location of a given
non-finite entry are also non-finite.  One way around this would be

to detect this condition and increase the size of the neighbourhood
until it is no longer true.  That should be easy to do.



On Tue, Apr 29, 2014 at 11:01 AM, rhewett <notifications@github.com> wrote:

> In sunpy/image/coalignment.py:
>
> > +    Parameters
> > +    ----------
> > +    y : ndarray
> > +        An one dimensional numpy array of shape 3.
> > +
> > +    Returns
> > +    -------
> > +    location : float
> > +        A digit, the location of the parabola maximum.
> > +    """
> > +    numerator = -0.5 * y.dot([-1, 0, 1])
> > +    denominator = y.dot([1, -2, 1])
> > +    return numerator / denominator
> > +
> > +
> > +def repair_2dimage_nonfinite(z):
>
> I think that would work.
>
> Out of curiosity, how does this routine handle blocks of nans? And is
> there interest in increasing the size of the filter window?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/sunpy/sunpy/pull/903/files#r12097500>
> .
>