[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDFJava #QQO-385265]: Unable to read grib data using OPENDAP
- Subject: [netCDFJava #QQO-385265]: Unable to read grib data using OPENDAP
- Date: Mon, 29 Jun 2015 14:37:18 -0600
Hi Ann,
Sorry, I probably should have commented my code a little to explain what's
going on.
There are two "shape" arrays we're concerned with: shape and readShape.
shape is the original shape of the variable (e.g. Temperature).
readShape is the size of the chunks that we're reading per loop iteration. In
my example, we're assuming that the variable is 4D and that its dimensions are
ordered time-z-y-x. We're going to read one time slice at a time (again, this
is common, but not required).
So, if we imagine that the original shape is [100][100][100][100], we're going
to use a readShape of [1][100][100][100], which is a chunk equal to one time
slice. There are 100 time slices total.
readShape will remain the same each iteration, but origin — the location within
the original shape from which we'll be reading — must change. We want something
like:
origin=[0][0][0][0]
origin=[1][0][0][0]
...
origin=[99][0][0][0]
We accomplish that by setting origin[0] = timeIndex, and running timeIndex from
0 to shape[0]-1 (shape[0] is the length of the time dimension).
Hopefully that clears things up for you. Let me know if you have other
questions.
Cheers,
Christian
Ticket Details
===================
Ticket ID: QQO-385265
Department: Support netCDF Java
Priority: Normal
Status: Closed