[Thread Prev][Thread Next][Index]

Re: [ferret_users] computing annual seasonal averages



Hi Tristan,
You just need to define a time axis covering the time range of your data, with four points in each year - time coordinates in the middle of each January, April, July, October. Then regrid your data to that, using the @AVE regridding transformation, and save only every fourth point. You should be able to use the time axis of your data to create the seasonal time axis.  Here's a dataset with a long time axis.  These steps will work for any time axis - just make sure you get the right delta values when defining the seasonal axis and the subsampling to get down to just winter timesteps.  Also make sure to start at the right place -- if you wanted to have the 3-month axis centered on February, or if the time series started in July, you'd need to adjust for that.  (also have a look at DEFINE AXIS/EDGES if you want to be really careful about the axis definition)

yes? use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
yes? list/L=1:5 t[gt=air]
             VARIABLE : T
                        axis TIME
             DATA SET : COADS Surface Marine Observations (1854-1993)
             FILENAME : coads_air.cdf
             FILEPATH : http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/
             SUBSET   : 5 points (TIME)
 15-JAN-1854 00 / 1:  56261.
 15-FEB-1854 00 / 2:  56292.
 15-MAR-1854 00 / 3:  56320.
 15-APR-1854 00 / 4:  56351.
 15-MAY-1854 00 / 5:  56381.
 
  ! Use a variable containing the time coordinates to define a new
  ! 
seasonal time axis.

yes? let tcoords = t[gt=air]
yes? define axis/t/units="`air,return=tunits`"/t0="`air,return=t0`" \
...? t_seas = tmonth[L=1:`air,return=Lsize`:3]
 !-> define axis/t/units="days"/t0="01-JAN-1700 00:00:00" t_seas = tcoords [L=1:1680:3]

  ! Regrid the variable to the seasonal time axis
yes? let air_seas  = air[gt=t_seas@ave]

  ! Now every fourth point is the winter average for each year.
yes? let air_winter = air_seas[L=1:`air_seas,return=Lsize`:4]
 !-> DEFINE VARIABLE air_winter = air_seas[L=1:560:4]

  ! Do whatever we like with this new winter value
yes? save/clobber/file=seas.nc air_winter[x=300:360@ave,y=20:40@ave]
 LISTing to file seas.nc


Tristan Hauser wrote:
Hello all,
  
For a given variable I'm trying to compute the Dec-Jan-Feb (i.e. winter)
average for each specific year of a multiple-year data set so I can
compare these to the average winter value for the entire data set.  I
can't find how to tell Ferret to compute a DJF average in such a way
that I have a distinct seasonal average from each year.  The second
part, an average winter value for the entire data set is
straightforward.  Any pointers?

Thank you for your time,
Tristan Hauser 

  

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement