Re: Reading Binary files with mixed-dimensions

From: David F Porter <PorterDF_at_nyahnyahspammersnyahnyah>
Date: Tue, 29 Jan 2008 13:40:06 -0700

Dave,

Well, I'm trying to read in the Japanese Reanalysis data, of which
there is no documentation for how the binary was written. Most of the
data is in GRIB, but monthly means are in binary. I've tried both
direct and sequential access routines in NCL (attempting to just read
in the first record of the file), and neither worked. But then again,
I'm not positive of the order of the data in the files either.

To clarify, each file is for 1 time period (6-hourlies in GRIB,
monthlies in binary). Each file contains 10 variables. The problem
is, 4 variables are [lon,lat,lev] , one is the same but a different
number of levels, and then 5 are just [lon,lat]. To make things more
interesting, I'm not sure of the order that each variable was written
(it is slow communicating with the JMA).

I tried converting it to netCDF using IDL, which I've had success
doing with other binary files by just pointing to the starting byte
for each variable. I used the order of the variables in the
documentation (anl_mdl listed here http://jra.kishou.go.jp/elements_en.html
  and also the order of variables given by the NCL function
printFileVarSummary() after reading in the corresponding 6-hourly GRIB
files (the same dimensions, just different time and format).

Dave Porter

On Jan 23, 2008, at 4:27 PM, Dave Allured wrote:

> Dave,
>
> Can you be more specific as to the type of binary file? Fortran
> "unformatted sequential access"; plain binary such as written by
> Fortran direct access; or something else? I just want to be sure
> I'm on the right wavelength before responding.
>
> Also, assuming one of the first two: So the record length varies
> within each file? Does each file have its own unique layout, or is
> each variable found in exactly the same position in every file?
>
> Dave Allured
> CU/CIRES Climate Diagnostics Center (CDC)
> http://cires.colorado.edu/science/centers/cdc/
> NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
> http://www.cdc.noaa.gov/
>
> David F Porter wrote:
>> Sorry if this has been covered, by I've exhausted the search
>> function with no real results.
>> I am looking to read in some large 4-Byte Float big-endian binary
>> data onto my little-endian machine. The problem I am having is
>> that each file corresponds to ONE time period, but each variable in
>> the file has different dimensions, some 2D and some 3D. Because of
>> the varying sizes, I feel that I cannot simply use the "record
>> number". Also, I only want some of the variables (to save space
>> after loading 300 of these files).
>> I'm not sure if it matters at this point, but the variables are on
>> a gaussian grid.
>> Dave
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 29 2008 - 13:40:06 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 31 2008 - 22:46:00 MST