[Thread Prev][Thread Next][Index]

Re: Anomaly Problem



Hi Steve,
I thought some more about the anomoly question you posted last week,
and in fact the solution does not require the @ASN  transformation.
Note that in using @ASN one can sometimes get incorrect results, if
for example you assigned the value at one time to the time axis point at
another time of year.   I have not studied the solution that Brent proposed
to see if it might cause any such trouble but in any event  @ASN must be
used with care.

You can easily create the seasonal climatology, using standard regridding,
and then subtract the mean at each location to get the anomoly.

The error message you got is due to the fact that the average still has the
time range of the original data, 1988-1991, while the climatology has a range
in  the year 0000 as it is not in any year.

A simple solution is to form the average from the climatology variable,
then it has the same time axis range and can be easily subtracted from
the seasonal climatology to get the anomoly you want.   Here is an
example using the COADS dataset (obtained from CDC via DODS)

-----------------example--------------

! Get the standard climatological axes
   USE climatological_axes.cdf
   CAN DATA climatological_axes

! Get some monthly data
   USE "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/coads/2degree/std/sst.mean.nc";

! Move the time axis back 31 days so will  be centered on Ja, Ap, Jy, Oct
! -- time units are hours

   DEF GRID/T=seasonal_reg season_old

   LET tnew = T[GT=season_old] - 24*31
   DEF AXIS/T/UNITS=hours/T0=1-jan-0000/MODULO tseason_new=tnew

   LET sst_new=sst[T=1-sep-1988:31-aug-1991]        !set a subset on the time axis

! Define the seasonal climatology variable and the average
   LET sst_seas = sst_new[gt=tseason_new@mod]
   LET sstavg= sst_seas[L=1:4@ave]

! here is the seasonaly-averaged data
   LIST/X=153W/Y=20s sst_seas

! here is the anomoly.
   LIST/X=153W/Y=20s sst_seas - sstavg


-----------original message-----------
Hello,

I am running into problems calculating seasonal anomalies.
Specifically, I created a seasonal climatology for a variable, create an
average for the entire time of record for the same variable, then try to
take the difference:
**********************
use climatological_axes.cdf
def grid/t=seasonal_reg season_old
let tnew =t[g=season_old] - 24*31 ! Move the time axis back 31 days so
will  be centered on Ja, Ap, Jy, Oc -- time units are hours
def axis/from_data/t/name=tseason_new/units=hours/t0=1-jan-0000/modulo
tnew
def grid/t=tseason_new season_new
**********************
set data precip97_01.nc
**********************
let precip_new=precip[d=2,t=1-sep-1998:31-aug-2001] ! create a new time
axis for variable

let avgPrec=precip[d=2,t=1-sep-1998:31-aug-2001@ave]    !create avg of
precip from 1sep98-31aug01

list/x=153w/y=20s precip_new[d=2,gt=season_new@mod, l=4]-avgPrec
_______________________________________________________________
The result I get from Ferret is:

list/x=153w/y=20s precip_new[d=2,gt=season_new@mod, l=4]-avgPrec
 **ERROR: illegal limits: AVGPREC is not in the range T=01-JAN
00:12:24:15-DEC-1901 05:49
          Axis extremes are T=31-DEC-1996 12:00:31-AUG-2001 12:00
list/x=153w/y=20s precip_new[d=2,gt=season_new@mod, l=4]-avgPrec
Command file, command group, or REPEAT execution aborted


I experimented around with the @asn function using stuff I saw from the
mail archives and manual but couldn't get this to work either.  Can
anyone help me with this?  Thanks.


Scocks
TAMU





[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement