-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 27/10/14 16:54, sajid pareeth wrote:
> Hi Martin
>
> Thanks for the hint.
>
> I would like to try the gradient search method of resampling. I
> changed the pyresample branch to "feature-gradient". Did you mean,
> gradient_search method as the bilinear? Or is there specific
> bilinear algorithm implemented other than gradient_search.
Hi Sajid,
With the "nearest" method, you can get n nearest neighbours, but it's
a bit difficult to perform bilinear interpolation since you don't know
which of the n neighbours to interpolate from.
The gradient search however can give you the location of the output
grid point in terms of lines and columns in the unprojected data. So
it's trivial to get the 4 surrounding neighbours to interpolate from.
> I am getting an error while trying the fast_gradient_search method
> on MODIS MYD021KM dataset.
>
> The co|de is: | | res
> =fast_gradient_search(g[0.8585].data.astype(np.float64),g[0.8585].area.lons,g[0.8585].area.lats,area,10)
>
>
|
>
> I am getting the following error
>
> | Traceback(most recent call last): File"<stdin>",line
> 1,in<module> File"pyresample/_gradient_search.pyx",line
> 32,inpyresample._gradient_search.fast_gradient_search
> (/home/sajid/.pyxbld/temp.linux-x86_64-2.7/pyrex/pyresample/_gradient_search.c:1597)
>
>
> deffast_gradient_search(np.ndarray[DTYPE_t,ndim=2]data,np.ndarray[DTYPE_t,ndim=2]source_x,np.ndarray[DTYPE_t,ndim=2]source_y,area_extent,size):
>
>
ValueError:Bufferdtype mismatch,expected 'DTYPE_t'but got 'float'
> |
I'm not really sure what's happening here, but do you run from the
gradient_search.py script ? At the moment, it just a draft, so just
insert your changes into the ifmain part of the .py file.
Best regards,
Martin
> Please advice..
>
> Regards
>
> Sajid
>
>
> On Monday, October 27, 2014 12:18:33 PM UTC+1, Martin Raspaud
> wrote:
>
> Hi Sajid,
>
> When it comes to bilinear interpolation, as fas as I know, it's
> not implemented in pyresample at the moment.
>
> However, I'm working on a new way of resampling using gradient
> search, and there we have bilinear interpolation: have a look at t
> <
https://groups.google.com/d/optout>.
iQEcBAEBAgAGBQJUTz7WAAoJEBdvyODiyJI4jmQH/iDe4w0VDaL90ZqxCLe3NVFy
Uu7uMRZYUSIv15zndt+R7eP1C3C5BASE+9d1bJrCK5t+WCnxPIoELX/dGGuZG5tY
CHEkMyJYk0jypAmIMT1pMmSiR+ZwZzgwoVMRHNdN8KtcjFZJVE3mDh+xZmziclVM
l2o6GBXDWDNSUwDZToxv+/nE3khmjWb7AOIXq52x2rJ9ckTVEgJol+owx3jW8+OI
b/NVoCYiIQWLyqSYqAu5GPV2Rbp9vSBW3tqK5KBM3FFsXAo0xjyd9IIq7gxneQ+Y
+GFSxvMdB6FhXti2Gqt14bVGKjOZNnq5HfZdFPUqvejlr12LpABkKfBtMcAOOy8=
=JfWW
-----END PGP SIGNATURE-----