[Thread Prev][Thread Next][Index]

Re: [ferret_users] Re: [ferret_users] plot a variable according to altitude

Hi Patrick,

Thanks for your reply.

Yes, I know conditionnal variables. But in my case, I have too many Z0 values in my DEM, so, I can't do this computation manually for each Z0.



Le 07/09/2016 15:57, Patrick Brockmann a écrit :
Le Mercredi 7 Septembre 2016 10.31 CEST, Francois Delclaux <francois.delclaux@xxxxxxxxxxxxxxxxxxx> a écrit:
Hi Ferret users,

I have a DEM Z(x,y) and a map precipitation P(x,y)

Now I would like to plot (or save in a ascii file), for each cell which
has the same elevation, the average of all the  precipitation values
which are at this elevation.
In other word, for a given Z0 elevation, I would like to have the
average of Precipitation values which are at Z0 elevation.

What the best way for doing that ?
Hi François,

Are you aware of conditionnal variables in ferret ?

You can easilly define a mask on a variable by selecting a specific value (or range)
Then multiply this mask with the quantity to analyze and
then list the average.

An example using levitus_climatology

yes? use levitus_climatology
yes? let mask = if salt gt 35 and salt le 37 then 1
yes? let temp_at_mask = temp * mask
yes? list temp_at_mask[i=@ave,j=@ave,k=1]
you get 22.86

Hope that will help


UMR HydroSciences - CC 57
Université Montpellier
163 rue Auguste Broussonnet
34090  Montpellier      FRANCE

mailto: francois.delclaux@xxxxxxxxxxxxxxxxxxx
Tel : (33) (0)4 67 14 90 11      Fax : (33) (0)4 67 14 47 74

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

Privacy Policy | Disclaimer | Accessibility Statement