C - Discard the edges of an arbitrary level of a multidimensional array

Posted by Medivh on Stack Overflow See other posts from Stack Overflow or by Medivh
Published on 2010-04-27T07:06:49Z Indexed on 2010/04/27 7:13 UTC
Read the original article Hit count: 199

Filed under:
|
|

I have some geographical data, that I'm trying to parse into a usable format. The data is kept in NetCDF files, and is read out as a multidimensional array. My problem comes because the source of the geographical data has a strip of longitude on each side of the grid that overlaps the other side. That is, I have a longitude point of -1 degree, and another of 361 degrees.

Unfortunately, I've got time, latitude, and sometimes height as dimensions in this array as well, and I have no way of predicting in advance where each dimension will be in the list (or if it's a three dimensional array, or a four dimensional array). Further complicating the problem, the array can be of floats, doubles or integers, so I have to pass it around as a void.

Are there any NetCDF tools that I can use to pre-prepare the files? If not, how would you suggest I go about stripping the excess longitudes?

© Stack Overflow or respective owner

Related posts about c

    Related posts about multidimensional-array