Clipping a NetCDF File in 2.2

Johnathan Kool jkool at rsmas.miami.edu
Wed Apr 25 16:29:23 MDT 2007


There's probably a simple solution to this, but it's escaping me, so I
thought I'd try posting.  I've managed to successfully load in my NetCDF
files using the NetCDF API 2.2, and am now trying to extract a subset of
data from them - exactly what the MultiArrayProxy and ClipMap functions
provide (see:
http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg00043.html)
, but I'm at a loss as to how to generate a MultiArray from the original
NetCDF data.  I've come across examples of how to generate MultiArrays from
scratch, and I can extract Arrays from my data, but not MultiArrays.  It
also looks like MultiArrays are possibly an older feature(?), so there may
be a better, more up-to-date way that I'm missing.

 

These are my variables:

 

[   float Longitude(Longitude=2294);

     :units = "degrees_east";

     :valid_range = 98.84f, 282.28f; // float

     :step = 0.8f; // float

     :standard_name = "longitude";

     :axis = "x";

,    float Latitude(Latitude=1362);

     :units = "degrees_north";

     :valid_range = -20.057325f, 65.86738f; // float

     :step = 0.8f; // float

     :standard_name = "latitude";

     :axis = "y";

,    int layer(layer=20);

     :units = "layer";

,    float uvel(layer=20, Latitude=1362, Longitude=2294);

     :_FillValue = 1.0E34f; // float

     :units = "ms-1";

     :standard_name = "eastward_sea_water_velocity";

     :long_name = "eastward_sea_water_velocity";

     :unit_long = "meter_per_second";

     :missing_value = 1.0E34f; // float

     :valid_range = -229.31992f, 80.65831f; // float

]

 

And I'm looking to subset uvel based on Latitude, Longitude and layer (e.g.
if Lat ranges from 20-40, Lon from 0-10 and layer from 0-10, I'd like to
extract the uvels for 25-35, 3-7 and 5-8 respectively).  Any constructive
advice, examples or links would definitely be appreciated.

 

Thank you!

 

J



More information about the Netcdf-java mailing list