[SciPy-dev] bug in scipy.ndimage.interpolation.zoom ?

Nicolas Rougier Nicolas.Rougier at loria.fr
Fri Feb 20 11:14:45 EST 2009



In the zoom function, the faulty line seems to be:

zoom = (numpy.array(input.shape)-1)/(numpy.array(output_shape,float)-1)

that generates nan in the zoom array for each output dimension equal to
1. I'm not sure about the meaning of this -1, but a quick fix could be
to replace nan in zoom with 1 just after:

zoom = numpy.nan_to_num(zoom)+numpy.isnan(zoom)

Nicolas



On Fri, 2009-02-20 at 17:51 +0200, Stéfan van der Walt wrote:
> 2009/2/20 Nicolas Rougier <Nicolas.Rougier at loria.fr>:
> > I get the following result:
> >
> > [ 1.  1.  1.  1.  1.]
> > [ 1.  1.  1.  1.  1.]
> > [[ 0.  0.  0.  0.  0.]]
> >
> > Is that the expected behavior ?
> 
> Hmm, no -- that doesn't look right.  Unfortunately, I don't have time
> to hunt it right now.  Maybe you can take a look, or alternatively
> create a ticket?
> 
> Regards
> Stéfan
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev




More information about the SciPy-Dev mailing list