[gradsusr] Manually Editing Grid Cell Using CSV
Davide Sacchetti
davide.sacchetti at arpal.gov.it
Mon Oct 22 03:54:32 EDT 2018
set defval command wants I and J, not LON and LAT
... just this ...
Bye
Davide
From: "Perry, Aaron" <Aaron.Perry at lsc.vsc.edu>
To: GrADS Usr <gradsusr at gradsusr.org>
Sent: 19/10/2018 4:17 PM
Subject: [gradsusr] Manually Editing Grid Cell Using CSV
Hello All,
I am trying to manually edit specific grid cells using values from a CSV file.
I have written a function to try to accomplish this but, I am having some troubles actually changing the grid cell values.
The variable that I am trying to edit has been defined as "temp"...
i.e. 'define temp = TMAX2m.1'
CSV File Sample:
82.9 31.04250 -86.31167
69.0 30.21889 -96.37417
50.0 41.00928 -74.73628
62.0 36.61056 -83.73722
66.9 34.28028 -87.60028
GrADS Function:
istat = 0
while (istat != 2)
data = read("/home/weather/values")
istat = sublin(data,1)
if (istat = 2)
break
endif
linez = sublin(data,2)
newval = subwrd(linez,1)
lat = subwrd(linez,2)
lon = subwrd(linez,3)
'q defval temp 'lon' 'lat
oldval = subwrd(result,2)
say 'Old: ('lat','lon') :'oldval
'set defval temp 'lon' 'lat' 'newval
say 'New: ('lat','lon') :'newval
endwhile
rc = close("/home/weather/values")
What am I doing wrong?
Aaron Perry
Class of 2016
Lyndon State College
Lyndonville, VT 05851
Twitter: @AaronPerryWx
Email: Aaron.Perry at lyndonstate.edu
_______________________________________________
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/20181022/37b1c7bf/attachment.html>
More information about the gradsusr
mailing list