[Met_help] [rt.rap.ucar.edu #71273] History for Adding binary files

John Halley Gotway via RT met_help at ucar.edu
Thu Apr 16 13:58:10 MDT 2015


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Hi John. 
I have 3 hourly Binary files like this . -bash-3.2$ ls -l *.bin-rw-r--r--    1 model    staff       2304000 Jan 22 16:20 3B42.110422.06z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 22 16:20 3B42.110422.09z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:16 3B42.110422.12z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:16 3B42.110422.15z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:16 3B42.110422.18z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:17 3B42.110422.21z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:17 3B42.110423.00z.7.precipitation.bin-rw-r--r--    1 model    staff       2304000 Jan 27 14:18 3B42.110423.03z.7.precipitation.bin

-rw-r--r--    1 model    staff       2304000 Jan 27 14:22 3B42_daily.2011.04.22.7.bin-rw-r--r--    1 model    staff       2304000 Mar 26 16:54 Obs22apr2011.bin

I had added these files using a Grads script. which is like this. 'reinit''open rfaccum.ctl''define rf=sum(data,t=1,t=8)''d rf''printim figure1.gif''set lon 0.125 359.875''set lat -49.875 49.875''set z 1''set fwrite  Obs22apr2011.bin''set gxout fwrite''d rf''disable fwrite'

When I use the file  Obs22apr2011.bin and try to convert to netcdf, it gives me error like this. 
aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ Rscript ../trmm_to_nc/trmmbin2nc_mod-20110422BNG.R Obs22apr2011.bin mync

ERROR: Can't figure out the accumulation interval!

Just want to know if U can help me with the Rscript. 
 		 	   		  

----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: Adding binary files
From: John Halley Gotway
Time: Fri Apr 03 13:22:07 2015

Geeta,

I see that you're having problems running an Rscript to convert TRMM
binary
files into a NetCDF format that MET can read.

You have some options to consider...

The trouble with binary data is that it doesn't contain any metadata
describing what it is, such as the variable name or time information.
Instead, you often have to parse that information from name of the
file.
It looks like you've processed 8 3-houlry TRMM binary files into a
single
output file, but you've created your own naming convention.  The
script is
erroring out because it doesn't understand your file naming
convention.

If you rename that file following the 3B42 naming convention for daily
precip accumulations, it'll run fine.  You can see that naming
convention
here:

ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42_V7/Daily/2013/

# Rename file and rerun script
cp Obs22apr2011.bin 3B42_daily.2011.04.22.7.bin
Rscript trmmbin2nc_mod-20110422BNG.R 3B42_daily.2011.04.22.7.bin
out.nc

If you prefer your naming convention, you could edit that Rscript to
parse
it an use it.

Another option is this... you could run each of those 3-hourly 3B42
files
through the trmmbin2nc script and then run a pcp_combine "-add"
command to
add them together.

I'd suggest doing it both ways for at least one case to make sure you
end
up with the same result in the output NetCDF file.

Thanks,
John


On Wed, Apr 1, 2015 at 2:43 AM, Geeta Geeta via RT <met_help at ucar.edu>
wrote:

>
> Wed Apr 01 02:43:44 2015: Request 71273 was acted upon.
> Transaction: Ticket created by geeta124 at hotmail.com
>        Queue: met_help
>      Subject: Adding binary files
>        Owner: Nobody
>   Requestors: geeta124 at hotmail.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273 >
>
>
> Hi John.
> I have 3 hourly Binary files like this . -bash-3.2$ ls -l *.bin-rw-
r--r--
>   1 model    staff       2304000 Jan 22 16:20
> 3B42.110422.06z.7.precipitation.bin-rw-r--r--    1 model    staff
>  2304000 Jan 22 16:20 3B42.110422.09z.7.precipitation.bin-rw-r--r--
1
> model    staff       2304000 Jan 27 14:16
> 3B42.110422.12z.7.precipitation.bin-rw-r--r--    1 model    staff
>  2304000 Jan 27 14:16 3B42.110422.15z.7.precipitation.bin-rw-r--r--
1
> model    staff       2304000 Jan 27 14:16
> 3B42.110422.18z.7.precipitation.bin-rw-r--r--    1 model    staff
>  2304000 Jan 27 14:17 3B42.110422.21z.7.precipitation.bin-rw-r--r--
1
> model    staff       2304000 Jan 27 14:17
> 3B42.110423.00z.7.precipitation.bin-rw-r--r--    1 model    staff
>  2304000 Jan 27 14:18 3B42.110423.03z.7.precipitation.bin
>
> -rw-r--r--    1 model    staff       2304000 Jan 27 14:22
> 3B42_daily.2011.04.22.7.bin-rw-r--r--    1 model    staff
2304000 Mar
> 26 16:54 Obs22apr2011.bin
>
> I had added these files using a Grads script. which is like this.
> 'reinit''open rfaccum.ctl''define rf=sum(data,t=1,t=8)''d
rf''printim
> figure1.gif''set lon 0.125 359.875''set lat -49.875 49.875''set z
1''set
> fwrite  Obs22apr2011.bin''set gxout fwrite''d rf''disable fwrite'
>
> When I use the file  Obs22apr2011.bin and try to convert to netcdf,
it
> gives me error like this.
> aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ Rscript
> ../trmm_to_nc/trmmbin2nc_mod-20110422BNG.R Obs22apr2011.bin mync
>
> ERROR: Can't figure out the accumulation interval!
>
> Just want to know if U can help me with the Rscript.
>
>

------------------------------------------------
Subject: Adding binary files
From: Geeta Geeta
Time: Tue Apr 07 05:34:50 2015

John.
This is what I got when I run pcp_combine.

aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
../bin/pcp_combine -add \3B42.20110422.06.7.nc 'name="pcp";
level="(*,*)";'\ 3B42.20110422.12.7.nc 'name="pcp"; level="(*,*)";'\
test.nc
DEBUG 1: Reading input file: 3B42.20110422.06.7.nc
NetCDF: Attribute not found
aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ ncdump -h
3B42.20110422.06.7.ncnetcdf \3B42.20110422.06.7 {
dimensions:
    time = UNLIMITED ; // (1 currently)
    longitude = 1440 ;
    latitude = 400 ;
variables:
    double time(time) ;
        time:units = "hours since 2011-4-22 6" ;
    double longitude(longitude) ;
        longitude:units = "degrees_east" ;
        longitude:long_name = "Longitude" ;
    double latitude(latitude) ;
        latitude:units = "degrees_north" ;
        latitude:long_name = "Latitude" ;
    float pcp(time, latitude, longitude) ;
        pcp:comments = "Unknown1 variable comment" ;
        pcp:long_name = "precipitation (mm/hr)" ;
        pcp:units = "" ;
        pcp:grid_name = "grid-1" ;
        pcp:grid_type = "linear" ;
        pcp:level_description = "Earth surface" ;
        pcp:time_statistic = "instantaneous" ;
        pcp:missing_value = -9999.9f ;
    float err(time, latitude, longitude) ;
        err:comments = "Unknown1 variable comment" ;
        err:long_name = "relative error (mm/hr)" ;
        err:units = "" ;
        err:grid_name = "grid-1" ;
        err:grid_type = "linear" ;
        err:level_description = "Earth surface" ;
        err:time_statistic = "instantaneous" ;
        err:missing_value = -9999.9f ;
    float source(time, latitude, longitude) ;
        source:comments = "Unknown1 variable comment" ;
        source:long_name = "source" ;
        source:units = "" ;
        source:grid_name = "grid-1" ;
        source:grid_type = "linear" ;
        source:level_description = "Earth surface" ;My Question is
after combning the 8 files, How will I extract data for my domain???
Geeta

> Subject: Re: [rt.rap.ucar.edu #71273] Adding binary files
> From: met_help at ucar.edu
> To: geeta124 at hotmail.com
> Date: Fri, 3 Apr 2015 13:22:08 -0600
>
> Geeta,
>
> I see that you're having problems running an Rscript to convert TRMM
binary
> files into a NetCDF format that MET can read.
>
> You have some options to consider...
>
> The trouble with binary data is that it doesn't contain any metadata
> describing what it is, such as the variable name or time
information.
> Instead, you often have to parse that information from name of the
file.
> It looks like you've processed 8 3-houlry TRMM binary files into a
single
> output file, but you've created your own naming convention.  The
script is
> erroring out because it doesn't understand your file naming
convention.
>
> If you rename that file following the 3B42 naming convention for
daily
> precip accumulations, it'll run fine.  You can see that naming
convention
> here:
>
>
ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42_V7/Daily/2013/
>
> # Rename file and rerun script
> cp Obs22apr2011.bin 3B42_daily.2011.04.22.7.bin
> Rscript trmmbin2nc_mod-20110422BNG.R 3B42_daily.2011.04.22.7.bin
out.nc
>
> If you prefer your naming convention, you could edit that Rscript to
parse
> it an use it.
>
> Another option is this... you could run each of those 3-hourly 3B42
files
> through the trmmbin2nc script and then run a pcp_combine "-add"
command to
> add them together.
>
> I'd suggest doing it both ways for at least one case to make sure
you end
> up with the same result in the output NetCDF file.
>
> Thanks,
> John
>
>
> On Wed, Apr 1, 2015 at 2:43 AM, Geeta Geeta via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Wed Apr 01 02:43:44 2015: Request 71273 was acted upon.
> > Transaction: Ticket created by geeta124 at hotmail.com
> >        Queue: met_help
> >      Subject: Adding binary files
> >        Owner: Nobody
> >   Requestors: geeta124 at hotmail.com
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273 >
> >
> >
> > Hi John.
> > I have 3 hourly Binary files like this . -bash-3.2$ ls -l *.bin-
rw-r--r--
> >   1 model    staff       2304000 Jan 22 16:20
> > 3B42.110422.06z.7.precipitation.bin-rw-r--r--    1 model    staff
> >  2304000 Jan 22 16:20 3B42.110422.09z.7.precipitation.bin-rw-r--
r--    1
> > model    staff       2304000 Jan 27 14:16
> > 3B42.110422.12z.7.precipitation.bin-rw-r--r--    1 model    staff
> >  2304000 Jan 27 14:16 3B42.110422.15z.7.precipitation.bin-rw-r--
r--    1
> > model    staff       2304000 Jan 27 14:16
> > 3B42.110422.18z.7.precipitation.bin-rw-r--r--    1 model    staff
> >  2304000 Jan 27 14:17 3B42.110422.21z.7.precipitation.bin-rw-r--
r--    1
> > model    staff       2304000 Jan 27 14:17
> > 3B42.110423.00z.7.precipitation.bin-rw-r--r--    1 model    staff
> >  2304000 Jan 27 14:18 3B42.110423.03z.7.precipitation.bin
> >
> > -rw-r--r--    1 model    staff       2304000 Jan 27 14:22
> > 3B42_daily.2011.04.22.7.bin-rw-r--r--    1 model    staff
2304000 Mar
> > 26 16:54 Obs22apr2011.bin
> >
> > I had added these files using a Grads script. which is like this.
> > 'reinit''open rfaccum.ctl''define rf=sum(data,t=1,t=8)''d
rf''printim
> > figure1.gif''set lon 0.125 359.875''set lat -49.875 49.875''set z
1''set
> > fwrite  Obs22apr2011.bin''set gxout fwrite''d rf''disable fwrite'
> >
> > When I use the file  Obs22apr2011.bin and try to convert to
netcdf, it
> > gives me error like this.
> > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ Rscript
> > ../trmm_to_nc/trmmbin2nc_mod-20110422BNG.R Obs22apr2011.bin mync
> >
> > ERROR: Can't figure out the accumulation interval!
> >
> > Just want to know if U can help me with the Rscript.
> >
> >
>

------------------------------------------------
Subject: Adding binary files
From: Randy Bullock
Time: Wed Apr 08 11:39:02 2015

Hello Geeta -

This is just to let you know that John is on vacation this week, so
you
probably won't get an answer from him until then.

Randy

On Tue, Apr 7, 2015 at 5:34 AM, Geeta Geeta via RT <met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273 >
>
> John.
> This is what I got when I run pcp_combine.
>
> aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
> ../bin/pcp_combine -add \3B42.20110422.06.7.nc 'name="pcp";
> level="(*,*)";'\ 3B42.20110422.12.7.nc 'name="pcp"; level="(*,*)";'\
> test.nc
> DEBUG 1: Reading input file: 3B42.20110422.06.7.nc
> NetCDF: Attribute not found
> aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
> aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ ncdump -h
> 3B42.20110422.06.7.ncnetcdf \3B42.20110422.06.7 {
> dimensions:
>     time = UNLIMITED ; // (1 currently)
>     longitude = 1440 ;
>     latitude = 400 ;
> variables:
>     double time(time) ;
>         time:units = "hours since 2011-4-22 6" ;
>     double longitude(longitude) ;
>         longitude:units = "degrees_east" ;
>         longitude:long_name = "Longitude" ;
>     double latitude(latitude) ;
>         latitude:units = "degrees_north" ;
>         latitude:long_name = "Latitude" ;
>     float pcp(time, latitude, longitude) ;
>         pcp:comments = "Unknown1 variable comment" ;
>         pcp:long_name = "precipitation (mm/hr)" ;
>         pcp:units = "" ;
>         pcp:grid_name = "grid-1" ;
>         pcp:grid_type = "linear" ;
>         pcp:level_description = "Earth surface" ;
>         pcp:time_statistic = "instantaneous" ;
>         pcp:missing_value = -9999.9f ;
>     float err(time, latitude, longitude) ;
>         err:comments = "Unknown1 variable comment" ;
>         err:long_name = "relative error (mm/hr)" ;
>         err:units = "" ;
>         err:grid_name = "grid-1" ;
>         err:grid_type = "linear" ;
>         err:level_description = "Earth surface" ;
>         err:time_statistic = "instantaneous" ;
>         err:missing_value = -9999.9f ;
>     float source(time, latitude, longitude) ;
>         source:comments = "Unknown1 variable comment" ;
>         source:long_name = "source" ;
>         source:units = "" ;
>         source:grid_name = "grid-1" ;
>         source:grid_type = "linear" ;
>         source:level_description = "Earth surface" ;My Question is
after
> combning the 8 files, How will I extract data for my domain???
> Geeta
>
> > Subject: Re: [rt.rap.ucar.edu #71273] Adding binary files
> > From: met_help at ucar.edu
> > To: geeta124 at hotmail.com
> > Date: Fri, 3 Apr 2015 13:22:08 -0600
> >
> > Geeta,
> >
> > I see that you're having problems running an Rscript to convert
TRMM
> binary
> > files into a NetCDF format that MET can read.
> >
> > You have some options to consider...
> >
> > The trouble with binary data is that it doesn't contain any
metadata
> > describing what it is, such as the variable name or time
information.
> > Instead, you often have to parse that information from name of the
file.
> > It looks like you've processed 8 3-houlry TRMM binary files into a
single
> > output file, but you've created your own naming convention.  The
script
> is
> > erroring out because it doesn't understand your file naming
convention.
> >
> > If you rename that file following the 3B42 naming convention for
daily
> > precip accumulations, it'll run fine.  You can see that naming
convention
> > here:
> >
> >
>
ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42_V7/Daily/2013/
> >
> > # Rename file and rerun script
> > cp Obs22apr2011.bin 3B42_daily.2011.04.22.7.bin
> > Rscript trmmbin2nc_mod-20110422BNG.R 3B42_daily.2011.04.22.7.bin
out.nc
> >
> > If you prefer your naming convention, you could edit that Rscript
to
> parse
> > it an use it.
> >
> > Another option is this... you could run each of those 3-hourly
3B42 files
> > through the trmmbin2nc script and then run a pcp_combine "-add"
command
> to
> > add them together.
> >
> > I'd suggest doing it both ways for at least one case to make sure
you end
> > up with the same result in the output NetCDF file.
> >
> > Thanks,
> > John
> >
> >
> > On Wed, Apr 1, 2015 at 2:43 AM, Geeta Geeta via RT
<met_help at ucar.edu>
> > wrote:
> >
> > >
> > > Wed Apr 01 02:43:44 2015: Request 71273 was acted upon.
> > > Transaction: Ticket created by geeta124 at hotmail.com
> > >        Queue: met_help
> > >      Subject: Adding binary files
> > >        Owner: Nobody
> > >   Requestors: geeta124 at hotmail.com
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273
> >
> > >
> > >
> > > Hi John.
> > > I have 3 hourly Binary files like this . -bash-3.2$ ls -l
> *.bin-rw-r--r--
> > >   1 model    staff       2304000 Jan 22 16:20
> > > 3B42.110422.06z.7.precipitation.bin-rw-r--r--    1 model
staff
> > >  2304000 Jan 22 16:20 3B42.110422.09z.7.precipitation.bin-rw-r--
r--
> 1
> > > model    staff       2304000 Jan 27 14:16
> > > 3B42.110422.12z.7.precipitation.bin-rw-r--r--    1 model
staff
> > >  2304000 Jan 27 14:16 3B42.110422.15z.7.precipitation.bin-rw-r--
r--
> 1
> > > model    staff       2304000 Jan 27 14:16
> > > 3B42.110422.18z.7.precipitation.bin-rw-r--r--    1 model
staff
> > >  2304000 Jan 27 14:17 3B42.110422.21z.7.precipitation.bin-rw-r--
r--
> 1
> > > model    staff       2304000 Jan 27 14:17
> > > 3B42.110423.00z.7.precipitation.bin-rw-r--r--    1 model
staff
> > >  2304000 Jan 27 14:18 3B42.110423.03z.7.precipitation.bin
> > >
> > > -rw-r--r--    1 model    staff       2304000 Jan 27 14:22
> > > 3B42_daily.2011.04.22.7.bin-rw-r--r--    1 model    staff
>  2304000 Mar
> > > 26 16:54 Obs22apr2011.bin
> > >
> > > I had added these files using a Grads script. which is like
this.
> > > 'reinit''open rfaccum.ctl''define rf=sum(data,t=1,t=8)''d
rf''printim
> > > figure1.gif''set lon 0.125 359.875''set lat -49.875 49.875''set
z
> 1''set
> > > fwrite  Obs22apr2011.bin''set gxout fwrite''d rf''disable
fwrite'
> > >
> > > When I use the file  Obs22apr2011.bin and try to convert to
netcdf, it
> > > gives me error like this.
> > > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ Rscript
> > > ../trmm_to_nc/trmmbin2nc_mod-20110422BNG.R Obs22apr2011.bin mync
> > >
> > > ERROR: Can't figure out the accumulation interval!
> > >
> > > Just want to know if U can help me with the Rscript.
> > >
> > >
> >
>
>

------------------------------------------------
Subject: Adding binary files
From: John Halley Gotway
Time: Mon Apr 13 13:48:31 2015

Hello Geeta,

I see that you're having trouble running the pcp_combine tool.  I'll
tried
working through the same steps that I suggested you try...

# Get the trmmbin2nc.R script
wget http://www.dtcenter.org/met/users/downloads/Rscripts/trmmbin2nc.R

# Get some 3-houlry TRMM binary data
wget
ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/3B42_V7/201104/3B42.110422.06z.7.precipitation.bin
wget
ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/3B42_V7/201104/3B42.110422.09z.7.precipitation.bin

# Reformat using Rscript
Rscript trmmbin2nc.R 3B42.110422.06z.7.precipitation.bin
3B42.110422.06z.7.precipitation.nc
Rscript trmmbin2nc.R 3B42.110422.09z.7.precipitation.bin
3B42.110422.09z.7.precipitation.nc

# Add together using pcp_combine
pcp_combine -add \
   3B42.110422.06z.7.precipitation.nc 'name="APCP_03"; level="(*,*)";'
\
   3B42.110422.09z.7.precipitation.nc 'name="APCP_03"; level="(*,*)";'
\
   3B42.110422.09z.7.precipitation_APCP_06.nc

# Plot the resulting output
plot_data_plane 3B42.110422.09z.7.precipitation_APCP_06.nc
3B42.110422.09z.7.precipitation_APCP_06.ps 'name="APCP_06";
level="(*,*)";'

The resulting image is attached.  I'd suggest following similar steps.
If
you need to change the region over which the precip data is extracted,
open
up the file "trmmbin2nc.R" and edit the section at the top labelled
"Output
domain specification".

Hope that helps.

John

On Wed, Apr 8, 2015 at 11:39 AM, Randy Bullock via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273 >
>
> Hello Geeta -
>
> This is just to let you know that John is on vacation this week, so
you
> probably won't get an answer from him until then.
>
> Randy
>
> On Tue, Apr 7, 2015 at 5:34 AM, Geeta Geeta via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273 >
> >
> > John.
> > This is what I got when I run pcp_combine.
> >
> > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
> > ../bin/pcp_combine -add \3B42.20110422.06.7.nc 'name="pcp";
> > level="(*,*)";'\ 3B42.20110422.12.7.nc 'name="pcp";
level="(*,*)";'\
> > test.nc
> > DEBUG 1: Reading input file: 3B42.20110422.06.7.nc
> > NetCDF: Attribute not found
> > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
> > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$ ncdump -h
> > 3B42.20110422.06.7.ncnetcdf \3B42.20110422.06.7 {
> > dimensions:
> >     time = UNLIMITED ; // (1 currently)
> >     longitude = 1440 ;
> >     latitude = 400 ;
> > variables:
> >     double time(time) ;
> >         time:units = "hours since 2011-4-22 6" ;
> >     double longitude(longitude) ;
> >         longitude:units = "degrees_east" ;
> >         longitude:long_name = "Longitude" ;
> >     double latitude(latitude) ;
> >         latitude:units = "degrees_north" ;
> >         latitude:long_name = "Latitude" ;
> >     float pcp(time, latitude, longitude) ;
> >         pcp:comments = "Unknown1 variable comment" ;
> >         pcp:long_name = "precipitation (mm/hr)" ;
> >         pcp:units = "" ;
> >         pcp:grid_name = "grid-1" ;
> >         pcp:grid_type = "linear" ;
> >         pcp:level_description = "Earth surface" ;
> >         pcp:time_statistic = "instantaneous" ;
> >         pcp:missing_value = -9999.9f ;
> >     float err(time, latitude, longitude) ;
> >         err:comments = "Unknown1 variable comment" ;
> >         err:long_name = "relative error (mm/hr)" ;
> >         err:units = "" ;
> >         err:grid_name = "grid-1" ;
> >         err:grid_type = "linear" ;
> >         err:level_description = "Earth surface" ;
> >         err:time_statistic = "instantaneous" ;
> >         err:missing_value = -9999.9f ;
> >     float source(time, latitude, longitude) ;
> >         source:comments = "Unknown1 variable comment" ;
> >         source:long_name = "source" ;
> >         source:units = "" ;
> >         source:grid_name = "grid-1" ;
> >         source:grid_type = "linear" ;
> >         source:level_description = "Earth surface" ;My Question is
after
> > combning the 8 files, How will I extract data for my domain???
> > Geeta
> >
> > > Subject: Re: [rt.rap.ucar.edu #71273] Adding binary files
> > > From: met_help at ucar.edu
> > > To: geeta124 at hotmail.com
> > > Date: Fri, 3 Apr 2015 13:22:08 -0600
> > >
> > > Geeta,
> > >
> > > I see that you're having problems running an Rscript to convert
TRMM
> > binary
> > > files into a NetCDF format that MET can read.
> > >
> > > You have some options to consider...
> > >
> > > The trouble with binary data is that it doesn't contain any
metadata
> > > describing what it is, such as the variable name or time
information.
> > > Instead, you often have to parse that information from name of
the
> file.
> > > It looks like you've processed 8 3-houlry TRMM binary files into
a
> single
> > > output file, but you've created your own naming convention.  The
script
> > is
> > > erroring out because it doesn't understand your file naming
convention.
> > >
> > > If you rename that file following the 3B42 naming convention for
daily
> > > precip accumulations, it'll run fine.  You can see that naming
> convention
> > > here:
> > >
> > >
> >
>
ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42_V7/Daily/2013/
> > >
> > > # Rename file and rerun script
> > > cp Obs22apr2011.bin 3B42_daily.2011.04.22.7.bin
> > > Rscript trmmbin2nc_mod-20110422BNG.R 3B42_daily.2011.04.22.7.bin
> out.nc
> > >
> > > If you prefer your naming convention, you could edit that
Rscript to
> > parse
> > > it an use it.
> > >
> > > Another option is this... you could run each of those 3-hourly
3B42
> files
> > > through the trmmbin2nc script and then run a pcp_combine "-add"
command
> > to
> > > add them together.
> > >
> > > I'd suggest doing it both ways for at least one case to make
sure you
> end
> > > up with the same result in the output NetCDF file.
> > >
> > > Thanks,
> > > John
> > >
> > >
> > > On Wed, Apr 1, 2015 at 2:43 AM, Geeta Geeta via RT
<met_help at ucar.edu>
> > > wrote:
> > >
> > > >
> > > > Wed Apr 01 02:43:44 2015: Request 71273 was acted upon.
> > > > Transaction: Ticket created by geeta124 at hotmail.com
> > > >        Queue: met_help
> > > >      Subject: Adding binary files
> > > >        Owner: Nobody
> > > >   Requestors: geeta124 at hotmail.com
> > > >       Status: new
> > > >  Ticket <URL:
> https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71273
> > >
> > > >
> > > >
> > > > Hi John.
> > > > I have 3 hourly Binary files like this . -bash-3.2$ ls -l
> > *.bin-rw-r--r--
> > > >   1 model    staff       2304000 Jan 22 16:20
> > > > 3B42.110422.06z.7.precipitation.bin-rw-r--r--    1 model
staff
> > > >  2304000 Jan 22 16:20 3B42.110422.09z.7.precipitation.bin-rw-
r--r--
> > 1
> > > > model    staff       2304000 Jan 27 14:16
> > > > 3B42.110422.12z.7.precipitation.bin-rw-r--r--    1 model
staff
> > > >  2304000 Jan 27 14:16 3B42.110422.15z.7.precipitation.bin-rw-
r--r--
> > 1
> > > > model    staff       2304000 Jan 27 14:16
> > > > 3B42.110422.18z.7.precipitation.bin-rw-r--r--    1 model
staff
> > > >  2304000 Jan 27 14:17 3B42.110422.21z.7.precipitation.bin-rw-
r--r--
> > 1
> > > > model    staff       2304000 Jan 27 14:17
> > > > 3B42.110423.00z.7.precipitation.bin-rw-r--r--    1 model
staff
> > > >  2304000 Jan 27 14:18 3B42.110423.03z.7.precipitation.bin
> > > >
> > > > -rw-r--r--    1 model    staff       2304000 Jan 27 14:22
> > > > 3B42_daily.2011.04.22.7.bin-rw-r--r--    1 model    staff
> >  2304000 Mar
> > > > 26 16:54 Obs22apr2011.bin
> > > >
> > > > I had added these files using a Grads script. which is like
this.
> > > > 'reinit''open rfaccum.ctl''define rf=sum(data,t=1,t=8)''d
rf''printim
> > > > figure1.gif''set lon 0.125 359.875''set lat -49.875
49.875''set z
> > 1''set
> > > > fwrite  Obs22apr2011.bin''set gxout fwrite''d rf''disable
fwrite'
> > > >
> > > > When I use the file  Obs22apr2011.bin and try to convert to
netcdf,
> it
> > > > gives me error like this.
> > > > aditya at agniilap:~/geeta/installs/met/RUN_MET-22apr2011$
Rscript
> > > > ../trmm_to_nc/trmmbin2nc_mod-20110422BNG.R Obs22apr2011.bin
mync
> > > >
> > > > ERROR: Can't figure out the accumulation interval!
> > > >
> > > > Just want to know if U can help me with the Rscript.
> > > >
> > > >
> > >
> >
> >
>
>

------------------------------------------------


More information about the Met_help mailing list