[gradsusr] Templates for TRMM data
Subash Yeggina
subash.yeggina at gmail.com
Mon Feb 7 00:08:56 EST 2011
Thanks a lot Rahiz. That would do .. It is still wandering in me if at all
I can use templates to create a .ctl(descriptor file) to access all the
files.(http://www.iges.org/grads/gadoc/templates.html).
Thanks,
Subash
On Mon, Feb 7, 2011 at 2:42 AM, Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk
> wrote:
> The following code would allow you to open multiple files but you need to
> make a list of files you want to open as *.txt (e.g. inputfiles.txt)
>
> n = 10 # where n is the total number of files in inputfiles.txt
> m = 1
> while(m< n+1)
> ifile = 'inputfiles.txt'
> rec = read(ifile)
>
> IO = sublin(rec,1)
> if(IO = 1)
> say ifile' > File open error'
> endif
> if (IO = 0)
> a = subwrd(rec,2)
> endif
>
> 'sdfopen 'a''
> say ''a''
> 'quit'
> m = m +1
> endwhile
>
>
> If you're using GrADS in Linux/Unix environment, the following would work
> as well;
>
> #!/bin/bash
>
> for i in $(ls *.nc); do
>
> cat > grads.gs << EOF
> 'sdfopen $i'
> say '$i'
> 'quit'
> EOF
> grads -blc 'run grads.gs'
>
> done
>
>
> HTH,
> ---
>
> Muhammad Rahiz
> Researcher & DPhil Candidate (Climate Systems & Policy)
> School of Geography & the Environment
> University of Oxford
>
> On Sun, 6 Feb 2011, Subash Yeggina wrote:
>
> Hi! Muhammad,
>> sdfopen inputfile.nc is to read one file. I would like to know how to
>> read
>> all the files using 'templates'.
>>
>>
>> Thanks,
>> Subash
>>
>> On Sun, Feb 6, 2011 at 9:50 PM, Muhammad Rahiz
>> <muhammad.rahiz at ouce.ox.ac.uk> wrote:
>>
>> sdfopen inputfile.nc
>>
>>
>>
>> Muhammad Rahiz
>> Researcher & DPhil Candidate (Climate Systems & Policy)
>> School of Geography & the Environment
>> University of Oxford
>>
>> On Sun, 6 Feb 2011, Subash Yeggina wrote:
>>
>> > Hi! All,
>> > I have 1 year 3B42 3hr TRMM data in NetCDF format. My question is
>> how to
>> > write the template file to read all the data is GrADS.
>> >
>> >
>> > Thanks & Regards,
>> > Subash
>> >
>> >
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110207/fae8f742/attachment-0003.html
More information about the gradsusr
mailing list