[gradsusr] gradsusr Digest, Vol 12, Issue 5
Zilore Mumba
zmumba at gmail.com
Mon Feb 7 02:42:22 EST 2011
Thanks Zablone, and all those who looked at query. Sorry i used
fprintf some time ago, so I was remembering it as sprintf.
Thanks so much for your time.
Zilore
On Mon, Feb 7, 2011 at 2:59 AM, <gradsusr-request at gradsusr.org> wrote:
> Send gradsusr mailing list submissions to
> gradsusr at gradsusr.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://gradsusr.org/mailman/listinfo/gradsusr
> or, via email, send a message with subject or body 'help' to
> gradsusr-request at gradsusr.org
>
> You can reach the person managing the list at
> gradsusr-owner at gradsusr.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gradsusr digest..."
>
>
> Today's Topics:
>
> 1. Re: Sprintf to write binary to ascii (Zablone Owiti)
> 2. Templates for TRMM data (Subash Yeggina)
> 3. Re: Templates for TRMM data (Muhammad Rahiz)
> 4. Re: Templates for TRMM data (Subash Yeggina)
> 5. Re: Templates for TRMM data (Muhammad Rahiz)
> 6. [gradsusr^ unability to run some coomands & iterations
> (Mario Caffera)
> 7. Re: Templates for TRMM data (Subash Yeggina)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 5 Feb 2011 23:14:28 -0800 (PST)
> From: Zablone Owiti <zablonowiti at yahoo.com>
> Subject: Re: [gradsusr] Sprintf to write binary to ascii
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID: <337580.72400.qm at web161319.mail.bf1.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Zilore,
> I know fprintf (and NOT Sprintf) used to write out binary data to ascii format. Depending on your requirement, you can use it to write out the whole data (lets say gridded binary data) and also write out the corresponding latitudes and longitudes on separate files. This procedure is demonstrated in the following link:http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file
>
> You can also use it to write out data averaged over a particular domain or grid box as in the example of a .CTL file below:
>
> 'sdfopen H:/griddata/data.cdf'
> 'set lon 10'
> 'set lat 15'
> 'set t 1 516'
> 'define pc2sst = aave(sst,lon=-165,lon=-80,lat=-5,lat=5)'
> 'set t 1 516'
> 'fprintf rain raingcpc.txt %g 12 1'
>
> NB: In the last line, rain is the variable, raingcpc.txt is the outputfilename, 12 is the number of values in each line (i.e monthly data in this case so that each line is Jan to Dec for each year), and 1 is the number of spaces between the values in each row/ line.
>
> Hope this will help
>
>
> ===================================================
> ZABLONE OWITI
> GRADUATE STUDENT
> Nanjing University of Information, Science and Technology
> College of International Education
> Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China
> Tel: +86-25-58731402
> Fax: +86-25-58731456
> Mob. 15077895632
> Website: www.nuist.edu.cn
> ====================================================
> "The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."
>
>
>
>
> From: Zilore Mumba <zmumba at gmail.com>
> To: gradsusr at gradsusr.org
> Cc:
> Sent: Saturday, 5 February 2011 7:31 PM
> Subject: [gradsusr] Sprintf to write binary to ascii
>
> Hello Grads users,
> I tohught there was a command like "sprintf" to write binary data in
> grads to ascii.
> Help will be appreciated
> Zilore
> _______________________________________________
> 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/20110205/6640dc2c/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Sun, 6 Feb 2011 17:57:39 +0530
> From: Subash Yeggina <subash.yeggina at gmail.com>
> Subject: [gradsusr] Templates for TRMM data
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
> <AANLkTimvjkWaZ94P4H6XnyCs8zB28893T9TH0PUdRkaz at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110206/74ba6f54/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Sun, 6 Feb 2011 16:20:08 +0000 (GMT)
> From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
> Subject: Re: [gradsusr] Templates for TRMM data
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
> <alpine.LFD.2.00.1102061619290.4354 at localhost6.localdomain6>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>
> 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
>>
>>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 7 Feb 2011 00:16:30 +0530
> From: Subash Yeggina <subash.yeggina at gmail.com>
> Subject: Re: [gradsusr] Templates for TRMM data
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
> <AANLkTi=mOarQgh1mNzykbrH0Lxxa89iDWdH=W0q+6zzr at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110207/472d63e9/attachment-0001.html
>
> ------------------------------
>
> Message: 5
> Date: Sun, 6 Feb 2011 21:12:56 +0000 (GMT)
> From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
> Subject: Re: [gradsusr] Templates for TRMM data
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
> <alpine.LFD.2.00.1102062101360.6873 at localhost6.localdomain6>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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
>>
>>
>>
>>
>
> ------------------------------
>
> Message: 6
> Date: Sun, 6 Feb 2011 21:07:48 -0800 (PST)
> From: Mario Caffera <rmcaffera at yahoo.com>
> Subject: [gradsusr] [gradsusr^ unability to run some coomands &
> iterations
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID: <425163.27957.qm at web57305.mail.re1.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hi grads users.
>
> I never be able to do any iteration in grads, nor apply any command as "while" "if" or "for". It appears some explanations like "unknown command" or so on.
> I'm running grads in a Win32 mahine. Could be that the cause?
>
> thanks in advance
>
> Mario
>
> --- On Sun, 2/6/11, Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk> wrote:
>
>> From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
>> Subject: Re: [gradsusr] Templates for TRMM data
>> To: "GrADS Users Forum" <gradsusr at gradsusr.org>
>> Date: Sunday, February 6, 2011, 7:12 PM
>> 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
>> >
>> >
>> >
>> >
>> -----Inline Attachment Follows-----
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 7 Feb 2011 10:38:56 +0530
> From: Subash Yeggina <subash.yeggina at gmail.com>
> Subject: Re: [gradsusr] Templates for TRMM data
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
> <AANLkTimFFMMeLtT5Oh9JAY_xQg8p6GsAkFkUVMD+dfhf at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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.html
>
> ------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> End of gradsusr Digest, Vol 12, Issue 5
> ***************************************
>
More information about the gradsusr
mailing list