Dear Scott & Jeff,
Sorry for the delay in replying, I was off office for a while.
2008/12/9 Scott Sinclair <scott.sinclair.za@...287...>:
As Jeff noted earlier, the number of elements in an array can't be
increased simply by reshaping it, so the error message isn't too
mysterious, if carefully considered.
Sure, I got lost because I tried to follow the solution previously
presented in the posting I referred to, since the example data I
provided are identical in format to that used in that solution (a
3-column space delimited file, with the first two representing the
longitude and latitude, and the 3rd representing the variable of
1. You have a small number of scattered data values in 'grid.dat' with
their locations specified by lat/lon co-ordinates.
2. You want to create a regular square/rectangular grid that spans
your region of interest and assign the values in 'grid.dat' to the
grid box in which they fall, with all other regions of the grid being
3. You then want to plot the masked rectangular grid onto a Basemap instance.
You did understood it very correctly, and of course offered a much
better description than I could provide myself using my pidgin English
:-). Indeed, there is just one detail to add to the above problem
description, and this is the fact that the "region of interest" may
span the entire world (land or sea, depending on the biological
organism under study).
The attached script shows one way to do this (using the imshow
method), I've left the task assigning the data values to the correct
grid box for you..
Thank you very much, I feel somewhat ashamed! Anyway, the final
product of this project will be made freely available under GPL, so it
will belong to everyone (and due credit will be given to all of you
meteorologists, physicists, mathematicians, etc. that have been so
Returning to the techical aspects of the problem, it is indeed the
assignment of data values to the correct grid box that lays in the
core of the second part of my question -- it may indeed be not so
difficult as the previous requirement, that is to build the data file
(with the data values of interest) *before* the grid analysis, from
simple lat-long files for each species under study (usually up to 20,
but may be more). But I will develop this further.
One more detail: is it possible to plot the value of the variable of
interest, corresponding to each square of the grid, inside the
With warmest regards,
Dr. Mauro J. Cavalcanti
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."