[Thread Prev][Thread Next][Index]

Re: [ferret_users] Re: Average with ferret vs nco



Or to get rid of the area weight on lat/lon grid,
use let xm=xin[x=@sum,y=@sum]/xin[x=@ngd,y=@ngd]

this will do simple averages.
Muyin

Ansley Manke wrote:

Hi Tony,
Yes, if the grid is defined with units of degrees longitude and latitude, then Ferret does compute with weighted averages. A way to compare with the nco computation is to set the units of the X and Y axis to something else

yes? set axis/units=" " `temperature,return=xaxis`
yes? set axis/units=" " `temperature,return=yaxis`

And then compute the average - this will treat the units of the axes as just numbers, and might compare with the nco computation.

Ansley

Tony Jolibois wrote:

Hi Ansley,

You're right for the correction, nco do not compute weighted average, ferret yes, I think this is the difference (I tested average on longitude only I have the same result with nco and ferret).
Thanks for your reponse,
Tony

Ansley Manke wrote:

Hi Tony,
Could you send us the grid information, that is the output of:

ncdump -h mercatorPsy3v1R1v_med_levitus_1998_M01.nc

One thing that could make a difference is whether the averaging computes the area for each grid cell based on the latitude correction for the location of each cell. Also, whether the grid is irregularly-spaced might have some impact.
Ansley

Tony Jolibois wrote:

Hi all,

I have to compute averages on longitude and latitude axes to have a one value result, data are ocean model outputs (depth=0).
When I use ferret and nco to compute these averages, I don't find the same result, I don't understand why. With nco I find a temperature_averaged = 14.06548 and with ferret I find 14.38.

Source file : mercatorPsy3v1R1v_med_levitus_1998_M01.nc (levitus climatology over Mediterranean sea)

* With nco :

ncwa -a latitude,longitude -d depth,0,0 mercatorPsy3v1R1v_med_levitus_1998_M01.nc mercatorPsy3v1R1v_med_levitus_1998_M01_averaged.nc
result : temperature_averaged = 14.06548

* With ferret :

yes? use mercatorPsy3v1R1v_med_levitus_1998_M01.nc
yes? define variable/unit="degC"/title="Temperature (degC)" temperature_averaged = temperature[x=@AVE,y=@AVE,z=0]
yes? list temperature_averaged
VARIABLE : Temperature (degC) (degC)
DATA SET : MERCATOR PSY3V1R1 VITRINE CLIM (with bathy mask)
FILENAME : mercatorPsy3v1R1v_med_levitus_1998_M01.nc
LONGITUDE: 6.1W(-6.1) to 45.1E(45.1)
LATITUDE : 30N to 48N
DEPTH (m): 0
14.38
yes?

Can someone help me ?
Tony

--
Tony Jolibois

CLS - Direction Océanographie Spatiale
8-10 rue hermès - 31520 Ramonville Saint-Agne
tjolibois@cls.fr

Tél : +33 (0) 561 393 797
Fax : +33 (0) 561 393 782


Click here <https://www.mailcontrol.com/sr/kLAXQ2OAfY+sg8rlqvO39eQW5+zPrcG%21+EgUFuWX7Qd21ga+VaqQIGy%21cYV+Gz6EGOSEfbdsqI84clXU5dBDqudA%21wHWYCkn2B7LV20df%215fKeR8dJPQzxXwarnKoyYCTTb8lrBLkxS%2104YlmMYgQgf1u3gfn8tFXuBGI263SbjrcpSnPdvffsPPhvPXK%2199DghS21ev4dbn5ZxYJVKoj2FRgKP94rKf> to report this email as spam.

--
Tony Jolibois

CLS - Direction Océanographie Spatiale
8-10 rue hermès - 31520 Ramonville Saint-Agne
tjolibois@cls.fr

Tél : +33 (0) 561 393 797
Fax : +33 (0) 561 393 782







[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement