[gradsusr] Extract values from a netcdf file in GRADS

Ngaina Joshua jngaina at gmail.com
Sat Oct 4 04:57:03 EDT 2014


*Dear Olaguera,*
*This is a simple script I use. *









































*'reinit'****Open your netcdf file 'sdfopen
C:\Users\Joshua\Documents\precipitation.nc <http://precipitation.nc>'***
Set the longitudes and latitudes of you stations e.g in East
Africalon.1=36.4lon.2=36lon.3=36.8lon.4=35.3lat.1=-0.4lat.2=1.3lat.3=-1.3lat.4=0.5lat.5=-0.5***set
names of stations corresponding to your
coordinatessta.1=Kenyasta.2=Ugandasta.3=Tanzaniasta.4=Rwandasta.5=Burundii=1while(i<=5)ln=lon.ilt=lat.istn=sta.i'set
lon 'ln'set lat 'lt'set t 1'****** pr is your variable***define where your
values will be extracted to e.g****** %g 1 1 will extract your values in
one continues column'fprintf pr
C:\Users\Joshua\Documents\precipitation-data\'stn.txt %g 1
1'i=i+1endwhile***Also ensure the fprintf file is in the same folder with
your grads scriptsay 'I AM HOME AND DRY...........'*
I hope it helps

Kind Regards
Joshua

On Sat, Oct 4, 2014 at 8:48 AM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> Hi all,
> I'd like to extract values of rainfall from selected stations froma
>  netcdf file with lat lon.
> What is the simplest way of doing this?
> Any suggestions?
> I tried to use the fprintf.gs from GRADS but theres an error saying
> Invalid arguments of Lat anf Lon.
>
>
> Thanks for any help.
>
> *Lyndon Mark P. Olaguera*
> Assistant Instructor
> Ateneo de Manila University
> 426 6001
> loc 5695
>
> _______________________________________________
> 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/20141004/b05feb2a/attachment.html 


More information about the gradsusr mailing list