Note that there are some explanatory texts on larger screens.

plurals
  1. POmatplotlib.mlab.griddata very slow and returns array of nan when valid data is input
    primarykey
    data
    text
    <p>I am trying to map an irregularly gridded dataset (raw satellite data) with associated latitudes and longitudes to a regularly gridded set of latitudes and longitudes given by <code>basemap.makegrid()</code>. I am using <code>matplotlib.mlab.griddata</code> with <code>mpl_toolkits.natgrid</code> installed. Below is a list of the variables being used as output by <code>whos</code> in ipython and some stats on the variables:</p> <pre><code>Variable Type Data/Info ------------------------------- datalat ndarray 666x1081: 719946 elems, type `float32`, 2879784 bytes (2 Mb) datalon ndarray 666x1081: 719946 elems, type `float32`, 2879784 bytes (2 Mb) gridlat ndarray 1200x1000: 1200000 elems, type `float64`, 9600000 bytes (9 Mb) gridlon ndarray 1200x1000: 1200000 elems, type `float64`, 9600000 bytes (9 Mb) var ndarray 666x1081: 719946 elems, type `float32`, 2879784 bytes (2 Mb) In [11]: var.min() Out[11]: -30.0 In [12]: var.max() Out[12]: 30.0 In [13]: datalat.min() Out[13]: 27.339874 In [14]: datalat.max() Out[14]: 47.05302 In [15]: datalon.min() Out[15]: -137.55658 In [16]: datalon.max() Out[16]: -108.41629 In [17]: gridlat.min() Out[17]: 30.394031556984299 In [18]: gridlat.max() Out[18]: 44.237140350357713 In [19]: gridlon.min() Out[19]: -136.17646180595321 In [20]: gridlon.max() Out[20]: -113.82353819404671 </code></pre> <p><code>datalat</code> and <code>datalon</code> are the orignal data coordinates</p> <p><code>gridlat</code> and <code>gridlon</code> are the coordinates to interpolate to</p> <p><code>var</code> contains the actual data</p> <p>Using these variables, when I call <code>griddata(datalon, datalat, var, gridlon, gridlat)</code> it has taken as long as 20 minutes to complete and returns an array of <code>nan</code>. From looking at the data, the latitudes and longitudes appear to be correct with the original coordinates overlapping a portion of the new area and a few data points lying outside of the new area. Does anyone have any suggestions? The nan values suggest that I'm doing something stupid...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload