[Thread Prev][Thread Next][Index]

Re: [ferret_users] Manipulating Data in netCDF files using conditionalstatements



Hi Waylon,
This is the concept of "masking" which is easy to do in Ferret.  Say your variable is my_var, in a file called my_data.nc

yes? USE my_data.nc
yes? LET mask = IF my_var GT 2000 THEN 0 ELSE 1
yes? LET new_var = mask * my_var
or, you can define the new variable in one step
yes? USE my_data.nc
yes? LET new_var = IF my_var GT 2000 ELSE 0 ELSE my_var


Waylon.Collins wrote:
Dear Ferret User List,

Does anyone have a ferret script that will alter data values of variables (already written to netCDF files) based on conditional statements? For example, I want to replace any value (of a particular variable) with the value of zero, if the value is greater than 2000.

Waylon


-- 
~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~> 
Ansley Manke, NOAA/PMEL   ansley.b.manke@noaa.gov
7600 Sand Point Way NE, Seattle WA
Phone 206-526-6246,  FAX 206-526-6744


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement