[gradsusr] Manually Editing Grid Cell Using CSV

Perry, Aaron Aaron.Perry at lsc.vsc.edu
Fri Oct 19 10:17:28 EDT 2018


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<https://twitter.com/AaronPerryWx><https://twitter.com/arnpry><https://twitter.com/AaronPerryWx>
Email: Aaron.Perry at lyndonstate.edu<http://Aaron.Perry@lyndonstate.edu/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20181019/7dfc6bcc/attachment.html>


More information about the gradsusr mailing list