[gradsusr] Manually Editing Grid Cell Using CSV

Perry, Aaron Aaron.Perry at lsc.vsc.edu
Mon Oct 22 04:56:48 EDT 2018


Thank you for that clarification Davide!


I am assuming that "i" and "j" are referring to X and Y? In that case, I should be using w2gr() (world coordinates to grid coordinates), right?


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/>
________________________________
From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Davide Sacchetti <davide.sacchetti at arpal.gov.it>
Sent: Monday, October 22, 2018 3:54:32 AM
To: GrADS Users Forum
Subject: Re: [gradsusr] Manually Editing Grid Cell Using CSV

This message is from an external sender. Please be careful when clicking on links and attachments.

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<https://twitter.com/AaronPerryWx><https://twitter.com/arnpry><https://twitter.com/AaronPerryWx>
Email: Aaron.Perry at lyndonstate.edu<http://Aaron.Perry@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/551c3fcb/attachment-0001.html>


More information about the gradsusr mailing list