[Thread Prev][Thread Next][Index]

Re: [ferret_users] ferret - repeat command - range = 70:80:.25 -error



Dear all,
There was a mistake in the go file name: I am sending again.

!1. repeat.jnl

use rfclim.nc

set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48

rep/range=1:36/name=m (rep/range=1:32/name=n go plot.jnl)




On Mon, Sep 21, 2015 at 8:39 PM, simon EK <simonambat@xxxxxxxxx> wrote:
Dear Andre/Ansley/Andrew/Russ/Ferreters,

Thank you so much for all the help and contributions.
I wanted to draw graphs of daily  rainfall climatology   from a .25x.25 grid dataset
I wanted to plot it for all grid points from 8N to 15N/73E to 82N and save in respective grid file names.

Finally the issue is solved -  Thanks to Andre/Ansley/Andrew/Russ.
The code is as follows:
===========================================================================

!1. repeat.jnl

use rfclim.nc

set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48

rep/range=1:36/name=m (rep/range=1:32/name=n go test3.jnl)


!2. plot.jnl

def symb xx (73.+(`m`*0.25))

def symb xx_str `floatstr(($xx),"(f5.2)")`

def symb yy (8.+(`n`*0.25))

def symb yy_str `floatstr(($yy),"(f5.2)")`

plot/x=`($xx)`/y=`($yy)` rf_clim[l=1:365]

frame/format=gif/file="rfclim-`floatstr(($yy),"(f5.2)")`-`floatstr(($xx),"(f5.2)")`.gif"

=========================================================

Thanking you all so much,

Regards
Simon

On Mon, Sep 21, 2015 at 7:22 AM, Andrew Wittenberg - NOAA Federal <andrew.wittenberg@xxxxxxxx> wrote:
  NOAA/PMEL TMAP
  FERRET v6.95 (rc3)
  Linux 2.6.32-573.3.1.el6.x86_64 64-bit - 09/15/15
  20-Sep-15 21:49

yes? let files = "rfclim-10.5x" +
floatstr(76+.25*x[gx=1:10:1],"(f5.2)") + ".gif"
yes? list files
             VARIABLE : "rfclim-10.5x" +
FLOATSTR(76+.25*X[GX=1:10:1],"(f5.2)") + ".gif"
             SUBSET   : 10 points (X)
 1    /  1:"rfclim-10.5x76.25.gif"
 2    /  2:"rfclim-10.5x76.50.gif"
 3    /  3:"rfclim-10.5x76.75.gif"
 4    /  4:"rfclim-10.5x77.00.gif"
 5    /  5:"rfclim-10.5x77.25.gif"
 6    /  6:"rfclim-10.5x77.50.gif"
 7    /  7:"rfclim-10.5x77.75.gif"
 8    /  8:"rfclim-10.5x78.00.gif"
 9    /  9:"rfclim-10.5x78.25.gif"
 10   / 10:"rfclim-10.5x78.50.gif"

Andrew

On Sun, Sep 20, 2015 at 9:07 PM, Russ Fiedler <russell.fiedler@xxxxxxxx> wrote:
>
> Hi Simon,
>
> If you use grave accents trailing zeros get removed when evaluating numbers.
> If you convert to a string using floatstr and fortran format editors then
> you preserve the trailing zeros for your filenames. For instance
>
>
> yes? rep/name=m/range=1:10:1 (def symb xxx `76.+m*0.25` ; def sym xxx_str
> `floatstr(($xxx),"(f5.2)")` ;say ($xxx) ($xxx_str))
>
> Note that if you put ($xxx_str) between grave accents you'll strip the zeros
> off again!
>
> Cheers,
> Russ
>
>
>
> On 20/09/15 03:32, simon EK wrote:
>
> Dear Andre,
> I request one more help.
>
> Pl. see the logic of the code given by you:
> =====================================================
> rep/name=m/range=1:10:1 (def symb xxx (76.+(`m`*0.25)) ; say `($xxx)`)
> ========t=============================================
>
> The output generated is as follows:
> ========
> 76.25
> 76.5
> 76.75
> 77
> 77.25
> 77.5
> 77.75
> 78
> 78.25
> 78.5
> =======
> Instead, I would like to have the output as follows:
> ========
> 76.25
> 76.50
> 76.75
> 77.00
> 77.25
> 77.50
> 77.75
> 78.00
> 78.25
> 78.50
> =======
> The requirement is that, while generating file names, due to this issue,
> file names are not in order.
> I tried my level best, but could not solve.
> Is there any formatting provision?
>
> Regards,
> Simon
>
>
> On Sat, Sep 19, 2015 at 1:06 PM, simon EK <simonambat@xxxxxxxxx> wrote:
>>
>> Dear Andre,
>>
>> Thank you so much.
>> I got enough idea from your code.
>>
>> Regards
>> Simon
>>
>> On Sat, Sep 19, 2015 at 12:54 PM, simon EK <simonambat@xxxxxxxxx> wrote:
>>>
>>> Dear Andre,
>>> Really great! It works perfectly well.
>>> I really appreciate the way you worked on  the solution.
>>> These are the file names generated:
>>> ===========================================================
>>> rfclim-10.5x76.25.gif
>>> rfclim-10.5x76.5.gif
>>> rfclim-10.5x76.75.gif
>>> rfclim-10.5x77.25.gif
>>> rfclim-10.5x77.5.gif
>>> rfclim-10.5x77.75.gif
>>> rfclim-10.5x77.gif
>>> rfclim-10.5x78.25.gif
>>> rfclim-10.5x78.5.gif
>>> rfclim-10.5x78.75.gif
>>> rfclim-10.5x78.gif
>>> rfclim-10.5x79.25.gif
>>> rfclim-10.5x79.5.gif
>>> rfclim-10.5x79.75.gif
>>> rfclim-10.5x79.gif
>>> rfclim-10.5x80.25.gif
>>> rfclim-10.5x80.5.gif
>>> rfclim-10.5x80.gif
>>> ============================================================
>>>
>>>
>>> On Fri, Sep 18, 2015 at 9:20 PM, Andre Paim <paim.oceano@xxxxxxxxx>
>>> wrote:
>>>>
>>>> There is one way around it that might help you (I've tried this to save
>>>> files and it worked). Just check to make sure I've put the right number in
>>>> here
>>>>
>>>> 1. repeat.jnl
>>>> ===================================================
>>>> use rfclim_1901_2013.nc
>>>> set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48
>>>>         ! Repeat on 10.5deg Latitude
>>>> rep/range=1:18/name=m (go test.jnl)
>>>> ===================================================
>>>>
>>>> 2. test.jnl
>>>> ===============================
>>>> def symb xxx (76.+(`m`*0.25))
>>>> let rf = rf_clim[y=10.5N, l=1:365]
>>>> plot/x=`($xxx)`  rf
>>>> frame/format=gif/file="rfclim-10-5x($xxx).gif"
>>>> ===============================
>>>>
>>>>
>>>>
>>>> On 17 September 2015 at 23:10, simon EK <simonambat@xxxxxxxxx> wrote:
>>>>>
>>>>> Dear Andre, Ansley,
>>>>>
>>>>> Thank you so much for the timely help.
>>>>> The solution works  well without any error.
>>>>>
>>>>> The code I used is:
>>>>> 1. repeat.jnl
>>>>> ===================================================
>>>>> use rfclim_1901_2013.nc
>>>>> set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48
>>>>>         ! Repeat on 10.5deg Latitude
>>>>> repeat/x=76.25:79.75:.25 (go test.jnl)
>>>>> ===================================================
>>>>>
>>>>> 2. test.jnl
>>>>> ===============================
>>>>> let rf = rf_clim[y=10.5N, l=1:365 ]
>>>>> plot  rf
>>>>> frame/format=gif/file="rfclim-10-5x`x`.gif"
>>>>> ===============================
>>>>>
>>>>> But there is a problem in creation of the graph files.
>>>>> It seems that x assumes only integers in creating file name. The files
>>>>> created are:
>>>>> =================
>>>>> rfclim-10-5x76.gif
>>>>> rfclim-10-5x77.gif
>>>>> rfclim-10-5x78.gif
>>>>> rfclim-10-5x79.gif
>>>>> rfclim-10-5x80.gif
>>>>> ================
>>>>> Value of x ranges from 76.25 to 79.75 in steps of .25. The gif images
>>>>> are created, but files names are not created for decimal values.
>>>>>
>>>>> How to resolve this, any idea?
>>>>>
>>>>> On Fri, Sep 18, 2015 at 1:50 AM, Andre Paim <paim.oceano@xxxxxxxxx>
>>>>> wrote:
>>>>>>
>>>>>> Dear Simon,
>>>>>>
>>>>>> Why don't you just use X in your repeat? Something like:
>>>>>>
>>>>>> repeat/x=8:30:.25 (go test.jnl)
>>>>>>
>>>>>> And then
>>>>>>
>>>>>> 2. test.jnl
>>>>>> ================================================
>>>>>> let rf = rf_clim[ y=10.5N, l=1:365 ]
>>>>>> plot  rf
>>>>>> frame/format=gif/file="rfclim-10-5x`x`.gif"
>>>>>> ================================================
>>>>>>
>>>>>> That might solve your problem.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 17 September 2015 at 13:50, simon EK <simonambat@xxxxxxxxx> wrote:
>>>>>>>
>>>>>>> hi all,
>>>>>>>
>>>>>>> I have grided rainfall dataset with .25x.25 deg resolution.
>>>>>>> I want to plot a graph of daily rainfall for each grid point along
>>>>>>> the lonitude with .25 deg interval and I tried using repeat command. But I
>>>>>>> get error.
>>>>>>> the script i used:
>>>>>>>
>>>>>>> 1. repeat.jnl
>>>>>>> ===============================================
>>>>>>> use rfclim_1901_2013.nc
>>>>>>> set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48
>>>>>>> ! Repeat on 77.5deg Longitude
>>>>>>> repeat/name=a/range=8:30:.25 (go test.jnl)
>>>>>>> ===============================================
>>>>>>>
>>>>>>> 2. test.jnl
>>>>>>> ================================================
>>>>>>> let rf = rf_clim[x=`a`, y=10.5N, l=1:365 ]
>>>>>>> plot  rf
>>>>>>> frame/format=gif/file="rfclim-10-5x`a`.gif"
>>>>>>> ====================================================
>>>>>>>
>>>>>>> While running, I get the following error:
>>>>>>> yes? go repeat-plot-long.jnl
>>>>>>> use rfclim_1901_2013.nc
>>>>>>> set region/x=66.4E:100.1E/y=6.4N:38.6N/t=01-JAN 12:00 to 31-DEC 17:48
>>>>>>> ! Repeat on 77.5deg Longitude
>>>>>>> repeat/name=a/range=8:30:.25 (go test.jnl)
>>>>>>>  **ERROR: command syntax: .25
>>>>>>> repeat/name=a/range=8:30:.25 (go test.jnl)
>>>>>>> Command file, command group, or REPEAT execution aborted
>>>>>>>  **ERROR: invalid command: Delta value on REPEAT must be nonzero
>>>>>>>
>>>>>>> Can somebody help me in resolving the issue?
>>>>>>>
>>>>>>>> Regards
>>>>>>>> Simon
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement