[Thread Prev][Thread Next][Index]

Re: [ferret_users] How can I change land value to missing value?



Hi Lu,
The 2-D coordinate variables do not need anything done to them, just the property variables.  For each variable,
define a new variable which is the same as U wherever U is not 0.
LET u_new = IF u NE 0 THEN u
there is an implied "ELSE missing"    So "u_new" will be missing everywhere that the value of "u" is 0.

Now, you will want to keep other attributes of the variables such as their units and so forth. You would add qualifiers on the LET command,  /UNITS= /TITLE= and so forth to define those attributes.

The above method is unfortunate because you wind up working with variables that have different names from the originals. Now, there's another way to do this a bit more elegantly and completely.  Rename the original variables to a dummy name, and then make definitions to fix the variables, renaming them back to the original names
yes? USE the_data.nc
yes? SET VAR/NAME=u_input u

yes? LET u = IF u_input NE 0 THEN u_input
And, you can copy all the attributes of the input variable to the new variable:
yes? SET ATT/LIKE=u_input  u

yes? SHOW ATTRIBUTE/ALL  u    ! check what you have done.

Ansley

Lu Wang wrote:
Dear users,

I am now using POP model output.  In these data files, land values are set to 0.0. The x,y coordinates of property variables (e.g. temperature, u, v,w) are grid numbers. Longitude and latitude information of each grid can be got in two separated  variables.

How can I change the land values 0.0 to missing value (e.g. -1E+34).

Any suggestion will be appreciated.


Lu



--
Have a nice day !

Lu WANG, Ph.D candidate
Department of Atmospheric Science,
School of Physics, Peking University,
Beijing, China, 100871

currently Visiting Student,
Department of Atmospheric & Oceanic Science,
University of Maryland, College Park, US, 20742

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement