[gradsusr] looping program

Muhammad Yunus Ahmad Mazuki ukm.yunus at gmail.com
Mon Dec 17 23:32:14 EST 2012


I would like to raise a question. You used "TDEF    300 LINEAR
13:00Z10apr2004  4mn". Every 4 minutes means, there's 150 data point for 10
hours for one day. How many file are you templating? What are the times in
the files? If you said 10 days, that means 1500 data point for for 10 hours
for 10 days.

But if your files are hours and minutes, and jumps from 2200 day 1 to 1300
day 2, if I'm not wrong, that 1300 day 2 will be registered as 2300 day 1
in GrADS. You can check by typing "set t 150" and "set t 151" to see the
date registered to it. You can also use

'R1=ave(R,time=1,time=150)+ave(R,time=151,time=300)'

I believe you intend to only template 2 files, and your tdef is correct.
But are there only two file in the folder you're working on?, if there's
more, that might be a problem.

Yunus


On Tue, Dec 18, 2012 at 10:03 AM, wendi harjupa <wendiharjupa at gmail.com>wrote:

> Dear Jennifer
>
> Thank you very much for your detail explanation.
> It help me much.
>
> Best regards,
> wendi
>
> On Tue, Dec 18, 2012 at 3:46 AM, Jennifer Adams <jma at cola.iges.org> wrote:
>
>>
>> On Dec 17, 2012, at 1:13 PM, Jeff Duda wrote:
>>
>> Remove LITTLE_ENDIAN from your options line.  There's no such option.
>>
>> This statement is incorrect. "Little endian" is a perfectly acceptable
>> keyword for the OPTIONS entry.
>> Please consult the documentation before making declarations like this in
>> the forum!!!
>>
>>
>>
>> On Mon, Dec 17, 2012 at 5:13 AM, wendi harjupa <wendiharjupa at gmail.com>wrote:
>>
>>> Dear Mr. Jeff
>>>
>>> I have tried the script that you sent but, still I could not do this
>>> would you please help me more.
>>>
>>> Here some question
>>> 1. Is my control file ok?
>>>     I want to use single control file
>>>
>> You didn't mention what your file names look like. Do they match your
>> template substitution strings?
>> The way you have it set up, the file 20040410/1013.dat should contain 15
>> grids, one for every 4 minutes. If not, then something is wrong with the
>> way you've set it up but you need to tell us more about your data files
>> first.
>>
>>
>> 2. base on my gs and control file below, I got error message
>>>    'Cannot contour grid - all undefined values'
>>>
>> This means there is no data file for the time specified in your dimension
>> environment, or else (if the file exists) all the data in that file are the
>> same as the missing value.
>>
>>
>>    'Cannot plot color bar: No shading information'
>>>
>> If you try to query the shade levels when no plot has been drawn (due to
>> error mentioned above), then this is the error message you will get.
>>
>>    'No hardcopy metafile open'
>>>
>> This is because you have use the 'disable print' command without using
>> 'enable print' first. If all you want is the image output from the printim
>> command, then remove the 'disable print' from your script.
>>
>> --Jennifer
>>
>>
>>    what the meaning of error message??
>>>
>>> below is control file (*try.ctl)* file
>>>
>>> DSET /misc/home/wendi/data1/radar/kototabang/XDR/data/*
>>> %y4%m2%d2/%d2%h2.dat*
>>> TITLE  RADAR
>>> OPTIONS  TEMPLATE LITTLE_ENDIAN
>>> UNDEF  -1000
>>> XDEF    321 LINEAR    99.688120996    0.004492369
>>> YDEF    321 LINEAR    -1.083708891    0.004522556
>>> ZDEF    39  LINEAR   1.0 0.5
>>> TDEF    300 LINEAR 13:00Z10apr2004  4mn
>>> VARS    2
>>> ref 39  99  Reflectivity(dBZ)
>>> vel 39  99  Doppler Velocity(m/s)
>>> ENDVARS
>>>
>>> this is my gs file (averaging for 2 days only)
>>>
>>> 'reinit'
>>> 'open *try.ctl*'
>>> 'set grads off'
>>> 'set mproj latlon'
>>> 'set mpdset hires'
>>> 'set gxout shaded'
>>> 'set lon 100  100.82'
>>> 'set lat -0.7  0'
>>> 'set z 5'
>>> 'set parea 1 7.5 2.8 8.3'
>>> 'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'
>>> 'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'
>>> 'set t 1 300'
>>> 'R=pow(10, ref/10)'
>>>
>>> 'R1=ave(R,time=13Z10apr2004,time=22Z10apr2004)+ave(R,time=13Z11apr2004,time=22Z11apr2004)'
>>> 'R2=R1/2'
>>> 'R3=log10 (R2)'
>>> 'd 10*R3'
>>> 'run /misc/home/wendi/grads-2.0.1/cbarn 0.7 0.7 7.4 5.5'
>>> 'draw string  7.2 8.1 [dBz]'
>>> 'draw xlab longitude'
>>> 'draw ylab latitude'
>>> 'set mproj latlon'
>>> 'set mpdset hires'
>>> 'set grid off'
>>>
>>> 'close 1'
>>>
>>> 'printim baru.gif white'
>>> 'disable print'
>>>
>>> 'close 1'
>>>
>>> Thank you very much for your help
>>> best regards,
>>> wendi
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Dec 16, 2012 at 7:03 PM, wendi harjupa <wendiharjupa at gmail.com>wrote:
>>>
>>>> Dear Mr. Jeff
>>>>
>>>> Thank you very much for your detail explanation
>>>> I will try it.
>>>>
>>>> Best regards,
>>>> wendi
>>>>
>>>>
>>>> On Sat, Dec 15, 2012 at 2:24 AM, Jeff Duda <jeffduda319 at gmail.com>wrote:
>>>>
>>>>> Wendi,
>>>>> Assuming your radar data are available at the same time every day,
>>>>> create an overall average and add daily averages to it.  Then take the
>>>>> average of the averages at the end.  If you have differing numbers of radar
>>>>> valid times each day, you should take a weighted average based on the
>>>>> number of data slices available each day.
>>>>>
>>>>> Do you plan to access each day's radar data using a separate control
>>>>> file or using a single control file?  This distinction makes a difference
>>>>> in how best to code your script.  You could either do it one day at a time,
>>>>> or sum all days in one line.  That is, you could do it like this:
>>>>>
>>>>> 'reinit'
>>>>> 'sumaverage = 0'
>>>>> dd = 1
>>>>> while (dd <= 10)
>>>>> 'open [DAY dd CONTROL FILE]'
>>>>> 'set grads off'
>>>>> 'set mproj latlon'
>>>>> 'set mpdset hires'
>>>>> 'set gxout shaded'
>>>>> 'set lon 100  100.82'
>>>>> 'set lat -0.7  0'
>>>>> 'set z 3600'
>>>>> 'set parea 1 7.5 2.8 8.3'
>>>>> 'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'
>>>>> 'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'
>>>>> 'set t 1 3600'
>>>>> 'R=pow(10, ref/10)'
>>>>>
>>>>> day = dd + 9
>>>>> 'R1=ave(R,time=13Z'dd'APR2004,time=22Z'dd'APR2004)'
>>>>> 'sumaverage = sumaverage + R1'
>>>>> dd = dd + 1
>>>>> endwhile
>>>>> 'average = sumaverage / 10'
>>>>> ...color table options...
>>>>> ...map options...
>>>>> 'd average'
>>>>> 'printim try.gif white'
>>>>>
>>>>> OR like this
>>>>>
>>>>> 'reinit'
>>>>> 'open [ALL INCLUSIVE CONTROL FILE]'
>>>>> 'set grads off'
>>>>> 'set mproj latlon'
>>>>> 'set mpdset hires'
>>>>>  'set gxout shaded'
>>>>> 'set lon 100  100.82'
>>>>> 'set lat -0.7  0'
>>>>> 'set z 3600'
>>>>> 'set parea 1 7.5 2.8 8.3'
>>>>> 'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'
>>>>> 'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'
>>>>> 'set t 1 3600'
>>>>> 'R=pow(10, ref/10)'
>>>>>
>>>>> 'R1=ave(R,time=13Z10APR2004,time=22Z10APR2004)+ave(R,time=13Z11APR2004,time=22Z11APR2004)+ave(R,time=13Z12APR2004,time=22Z12APR2004)+ave(R,time=13Z13APR2004,time=22Z13APR2004)+ave(R,time=13Z14APR2004,time=22Z14APR2004)+ave(R,time=13Z15APR2004,time=22Z15APR2004)+ave(R,time=13Z16APR2004,time=22Z16APR2004)+ave(R,time=13Z17APR2004,time=22Z17APR2004)+ave(R,time=13Z18APR2004,time=22Z18APR2004)+ave(R,time=13Z19APR2004,time=22Z19APR2004)'
>>>>> ...color table options...
>>>>> ...map options...
>>>>> 'd R1/10'
>>>>> 'printim try.gif white'
>>>>>
>>>>> Jeff
>>>>>
>>>>>
>>>>> On Fri, Dec 14, 2012 at 12:20 AM, wendi harjupa <
>>>>> wendiharjupa at gmail.com> wrote:
>>>>>
>>>>>> Dear Jeff
>>>>>>
>>>>>> Thank you very much for your solution,
>>>>>>
>>>>>> I need to make average for 10 days, how to make loop for the next day
>>>>>> (same time/13-22)??
>>>>>>
>>>>>> Best regards,
>>>>>> On Fri, Dec 14, 2012 at 1:06 PM, Jeff Duda <jeffduda319 at gmail.com>wrote:
>>>>>>
>>>>>>> Change the line
>>>>>>> 'R1=ave(R, t=1, t=3600)'
>>>>>>>
>>>>>>> to
>>>>>>>
>>>>>>> 'R1=ave(R,time=13Z10APR2004,time=22Z10APR2004)'
>>>>>>>
>>>>>>> Jeff Duda
>>>>>>>
>>>>>>>  On Thu, Dec 13, 2012 at 8:42 PM, wendi harjupa <
>>>>>>> wendiharjupa at gmail.com> wrote:
>>>>>>>
>>>>>>>>  Dear Sir/Madam
>>>>>>>>
>>>>>>>> Please I need your help.
>>>>>>>> I have one set data (10 days data)
>>>>>>>>
>>>>>>>> How to make looping to make reflectivity average for only 10 hours
>>>>>>>> on every day (13hrs-22hrs only)??
>>>>>>>>
>>>>>>>> Below is my ctl and gs script
>>>>>>>>
>>>>>>>> try.ctl
>>>>>>>>
>>>>>>>> DSET
>>>>>>>> /misc/home/wendi/data1/radar/kototabang/XDR/data/%y4%m2%d2/%d2%h2.dat
>>>>>>>> TITLE  RADAR
>>>>>>>> OPTIONS  TEMPLATE LITTLE_ENDIAN
>>>>>>>> UNDEF  -1000
>>>>>>>> XDEF    321 LINEAR    99.688120996    0.004492369
>>>>>>>> YDEF    321 LINEAR    -1.083708891    0.004522556
>>>>>>>> ZDEF    39  LINEAR   1.0 0.5
>>>>>>>> TDEF    3600 LINEAR 00:00Z10apr2004  4mn
>>>>>>>> VARS    2
>>>>>>>> ref 39  99  Reflectivity(dBZ)
>>>>>>>> vel 39  99  Doppler Velocity(m/s)
>>>>>>>> ENDVARS
>>>>>>>>
>>>>>>>>
>>>>>>>> script.gs
>>>>>>>>
>>>>>>>> 'reinit'
>>>>>>>> 'open try.ctl'
>>>>>>>> 'set grads off'
>>>>>>>> 'set mproj latlon'
>>>>>>>> 'set mpdset hires'
>>>>>>>> 'set gxout shaded'
>>>>>>>> 'set lon 100  100.82'
>>>>>>>> 'set lat -0.7  0'
>>>>>>>> 'set z 3600'
>>>>>>>> 'set parea 1 7.5 2.8 8.3'
>>>>>>>> 'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'
>>>>>>>> 'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'
>>>>>>>> 'set t 1 3600'
>>>>>>>> 'R=pow(10, ref/10)'
>>>>>>>>
>>>>>>>> 'R1=ave(R, t=1, t=3600)'
>>>>>>>> 'set t 1'
>>>>>>>> 'R2=log10 (R1)'
>>>>>>>> 'd 10*R2'
>>>>>>>> 'run /misc/home/wendi/grads-2.0.1/cbarn 0.7 0.7 7.4 5.5'
>>>>>>>> 'draw string  7.2 8.1 [dBz]'
>>>>>>>> 'draw xlab longitude'
>>>>>>>> 'draw ylab latitude'
>>>>>>>> 'set mproj latlon'
>>>>>>>> 'set mpdset hires'
>>>>>>>> 'set grid off'
>>>>>>>>
>>>>>>>> 'close 1'
>>>>>>>>
>>>>>>>> 'printim try.gif white'
>>>>>>>> 'disable print'
>>>>>>>>
>>>>>>>> 'close 1'
>>>>>>>>
>>>>>>>> Thank you very much for your help
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> wendi
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> -------------
>>>>>>>> Wendi Harjupa. ST
>>>>>>>> Shimane University Graduate School of Engineering Sciences
>>>>>>>> Department of Electronic Control Systems
>>>>>>>> Remote Sensing Laboratory
>>>>>>>> s119447
>>>>>>>> Cellphone : +81-080-4268-6676
>>>>>>>> email : wendi at rslab.riko.shimane-u.ac.jp
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> gradsusr mailing list
>>>>>>>> gradsusr at gradsusr.org
>>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jeff Duda
>>>>>>> Graduate research assistant
>>>>>>> University of Oklahoma School of Meteorology
>>>>>>> Center for Analysis and Prediction of Storms
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> gradsusr mailing list
>>>>>>> gradsusr at gradsusr.org
>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> -------------
>>>>>> Wendi Harjupa. ST
>>>>>> Shimane University Graduate School of Engineering Sciences
>>>>>> Department of Electronic Control Systems
>>>>>> Remote Sensing Laboratory
>>>>>> s119447
>>>>>> Cellphone : +81-080-4268-6676
>>>>>> email : wendi at rslab.riko.shimane-u.ac.jp
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> gradsusr mailing list
>>>>>> gradsusr at gradsusr.org
>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Jeff Duda
>>>>> Graduate research assistant
>>>>> University of Oklahoma School of Meteorology
>>>>> Center for Analysis and Prediction of Storms
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> gradsusr mailing list
>>>>> gradsusr at gradsusr.org
>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> -------------
>>>> Wendi Harjupa. ST
>>>> Shimane University Graduate School of Engineering Sciences
>>>> Department of Electronic Control Systems
>>>> Remote Sensing Laboratory
>>>> s119447
>>>> Cellphone : +81-080-4268-6676
>>>> email : wendi at rslab.riko.shimane-u.ac.jp
>>>>
>>>>
>>>
>>>
>>> --
>>> -------------
>>> Wendi Harjupa. ST
>>> Shimane University Graduate School of Engineering Sciences
>>> Department of Electronic Control Systems
>>> Remote Sensing Laboratory
>>> s119447
>>> Cellphone : +81-080-4268-6676
>>> email : wendi at rslab.riko.shimane-u.ac.jp
>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>>
>>
>>
>> --
>> Jeff Duda
>> Graduate research assistant
>> University of Oklahoma School of Meteorology
>> Center for Analysis and Prediction of Storms
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>  --
>> Jennifer M. Adams
>> IGES/COLA
>> 4041 Powder Mill Road, Suite 302
>> Calverton, MD 20705
>> jma at cola.iges.org
>>
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
>
> --
> -------------
> Wendi Harjupa. ST
> Shimane University Graduate School of Engineering Sciences
> Department of Electronic Control Systems
> Remote Sensing Laboratory
> s119447
> Cellphone : +81-080-4268-6676
> email : wendi at rslab.riko.shimane-u.ac.jp
>
>
> _______________________________________________
> 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/20121218/f8f4e144/attachment-0003.html 


More information about the gradsusr mailing list