[gradsusr] Printing a lot of maps from NetCDF file

James T. Potemra jimp at hawaii.edu
Thu May 12 16:37:32 EDT 2011


Hi Chris:

Sure, all you have to do is add a loop for time, go from 1 to 365, then 
use your title variable (ymd) as you image name,

'reinit'
'sdfopen /cygdrive/c/ab.nc'
*i = 1
while ( i <=365 )
   'set t 'i*
   'set lon -20 40'
   'set lat 30 70'
   'set gxout contour'
   'set cint 5'
   'set clab forced'
   'set ccolor 1'
   'set cthick 10'
   'set map 1'
   'set timelab off'
   'set grads off'
   'set cterp on'
   'set csmooth on'
   'd slp/100'
   'q time'
   res=subwrd(result,3)
   ymd=substr(res,4,12)
   say ymd
   'draw title 'ymd
   *'printim 'ymd'.png x1024 y768 white'
   i = i + 1
   'clear'
endwhile
*
I think this should work.

Jim

Krzysiek wrote:
> Dear Grads Users,
> I have just created a simple script:
>
> 'reinit'
> 'sdfopen /cygdrive/c/ab.nc'
> 'set lon -20 40'
> 'set lat 30 70'
> 'set gxout contour'
> 'set cint 5'
> 'set clab forced'
> 'set ccolor 1'
> 'set cthick 10'
> 'set map 1'
> 'set timelab off'
> 'set grads off'
> 'set cterp on'
> 'set csmooth on'
> 'd slp/100'
> 'q time'
> res=subwrd(result,3)
> ymd=substr(res,4,12)
> say ymd
> 'draw title 'ymd
> 'printim slp.png x1024 y768 white'
> return
>
> NetCDF file contain daily data from 1jan1990 to 31dec1990 and I would 
> like to print (at one go) maps which concern all days (365 maps, png 
> format). Moreover, this files should be named by the title of particular 
> map (I arranged in script date format like 01JAN1990, 02JAN1990 
> ......etc.).
> If anyone knows how to change my scripts in order to do what I want?
>
> Regards
>
> Chris
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>   



More information about the gradsusr mailing list