Re: Importing GPCP (precip) unformatted binary data

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 23 Jul 2007 15:39:27 -0600

Hello,

Mike's comment about netCDF is true. I would suggest the following URL.
It is more up-to-date than the URL Mike suggested.
     http://www.cdc.noaa.gov/cdc/data.gpcp.html

     To decode the dates:

          f = addfile ("precip.mon.mean.nc" , "r")
          time = f->time
          yyyymm = ut_calendar(time, -1)
          print(yyyymm)

===========================
To answer your specific question about the binary is more complicated.

[1] There several important pieces of information you did not include:

            (a) Is the GPCP binary file "big endian" or "little endian" ?
            (b) What is the endian of your machine
            (c) Was the GPCP binary file written with fortran direct access
                  [same a C block IO] or fortran sequential files?
fbinread indicates
                 it is a flat binary file.

[2] If the file was written on a big endian machine and you are reading the
      file on a little endian machine then you should precede
      the reading of the file with:
              *setfileoption*("bin","ReadByteOrder","BigEndian")

      If the GPCP binary is little endian and you are reading on a big
endian
              *setfileoption*("bin","ReadByteOrder","LittleEndian")

[3] I thing you are providing the fbinread function with the wrong order.
      (/144,72,12/) should be (/12,72,144/). The former looks like
fortran order.

Good Luck
D

     
Michael Notaro wrote:
> Mike,
>
> You could try the netcdf version of the dataset. It is easier to work
> with.
>
> http://www.cgd.ucar.edu/cas/catalog/satellite/gpcp/gpcp.html
> http://www.cdc.noaa.gov/cdc/data.gpcp.html
> http://www.jisao.washington.edu/data/gpcp/
>
> Mike
>
> On Jul 23, 2007, at 4:03 PM, Michael Tosca wrote:
>
>> I am trying to import GPCP data via my NCL script. Here is the syntax
>> i am using:
>>
>> gpcp=fbinread("/mtosca/el_nino_fire/gpcp_v2_psg.1998",(/144,72,12/),"float")
>>
>> it seems to import fine, but gives very strange values, i.e. on the
>> order of e38, and there are even some NEGATIVE values, which makes no
>> sense to me. How could precip be negative? I try to assign attributes
>> to the dimensions using a dataset i created of lat, lon values of
>> 2.5x2.5 resolution. I keep getting 'segmentation fault'. any ideas?
>>
>> does anyone have previous use with GPCP data? The readme file
>> indicates that each file is "12 grids of size 144x72 containing
>> big-endian REAL*4 values."
>>
>> Thanks!
>> -Mike
>>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 23 2007 - 15:39:27 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 26 2007 - 16:42:26 MDT