[Thread Prev][Thread Next][Index]

Re: [ferret_users] calculations while masking/only for certain land covers



Hi,
The topic in the Users Guide to look up is "masking, IF-THEN_ELSE logic". Here's how it might look. If desert is represented by, say the value land_cover = 3, then
yes? let desert_mask = if land_cover eq 3 then 1
yes? let temperature_desert = temperature * desert_mask

yes? let ave_temp_desert = temperature_desert[T=@ave]
The "if land_cover eq 3 then 1"  statement defines a mask that is 1 if the land cover variable is 3, and missing otherwise.  Try "shade desert_mask" to see the variable you've defined.

You might want to assign units and a description to the variables, using LET/UNITS= /TITLE=  qualifiers. 

-Ansley


On 10/5/2012 9:00 AM, mpm33 wrote:
Hi all,

I am trying to take averages from a netcdf file for only a certain land cove type.  For example, I'd like to take a netcdf that has land cover and temperature fields in it and find the average temperature for all the grid-cells that are desert.  I was trying to use the IF statement but was having issues with that.  Does anyone know how I can do this? Thanks in advance!

Marc



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement