[gradsusr] Finding the maximum value and location of masked area

Justin Hicks jhicks2014 at gmail.com
Mon Jun 5 13:35:45 EDT 2017


GrADS users,

I'm having a few issues trying to find the maximum value of a variable for
a shapefile. I found some documentation online of how to find the lat/lon
location of the maximum value (with no shapefile), using:

*helps display lat

'd maxloc(max('var',x=1,x=360),y=1,y=180)'


*helps display lon

'd maxloc(max('var',y=1,y=180),x=1,x=360)'


This code works, but I'm having issues using the 'maskout' function
with this code.

This is the display code I currently have that uses the maskout
function with respect to the variables 'rainfsfc' and 'mask'...it is
tested and works perfectly:


d maskout(rainfsfc.1*86400,lterp(mask.2(time=00Z01JAN1948),rainfsfc.1))


I want to combine the two sets of display code to get the location of
the maximum value within that shapefile, so I tried:


d maxloc(max(maskout(rainfsfc.1*86400,lterp(mask.2(time=00Z01JAN1948),rainfsfc.1)),x=1,x=360),y=1,y=180)

and

d maxloc(max(maskout(rainfsfc.1*86400,lterp(mask.2(time=00Z01JAN1948),rainfsfc.1)),y=1,y=180),x=1,x=360)


However, these two did not work and I ended up with this error:

Error from LTERP: The destination grid is a constant
Operation Error:  Error from lterp function


Is there an easier way to get this to output a lat/lon coordinate of the
maximum value for this shapefile?


Thanks,

-Justin








-- 
*Justin Hicks*

*UndergraduateAtmospheric Sciences Major*

*GIS MinorUniversity of Maryland-College Park*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170605/f3326dd7/attachment.html 


More information about the gradsusr mailing list