[gradsusr] Manually Editing Grid Cell Using CSV

Davide Sacchetti davide.sacchetti at arpal.gov.it
Mon Oct 22 08:12:12 EDT 2018


yes,
first display your temp once, so that grads knows the grid, then use
w2gr
Bye



On Mon, 2018-10-22 at 08:56 +0000, Perry, Aaron wrote:
> 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
> Email: Aaron.Perry at 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
> > Email: Aaron.Perry at lyndonstate.edu
> > 
> > 
> > _______________________________________________ 
> > gradsusr mailing list 
> > gradsusr at gradsusr.org 
> > http://gradsusr.org/mailman/listinfo/gradsusr 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr




More information about the gradsusr mailing list