Re: Some useful climatology and regression functions

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 29 2011 - 09:28:00 MDT

Hi Chad,

I'm going through some old ncl-talk emails, and am not sure we ever responded to this one.

I've created a ticket for this, NCL-1172, and we will try to get them in the next release of NCL. We may have some further questions when it comes time to document these functions.

Thanks for the contribution!

--Mary

On May 10, 2011, at 12:21 AM, Chad Herman wrote:

> I've been building some NCL functions to simplify calculations I do on a daily basis. I often use CRUTEM's netCDf data and find it annoying that there is a redundant dimension (t, unspecified, latitude, longitude). That inspired me to write a function ("squeeze") that will strip out redundant dimensions while preserving dimension names, coordinate variables and meta data.
>
> I also found that the current crop of climatology functions didn't do what I needed. clmMonTLL will calculate the climatology, but I needed to specify the minimum number of years to calculate a valid mean. I sometimes deal with single time series which need to transformed into anomalies. There's no function do that, so I was motivated to write my own functions.
>
> I've create two generic functions: clmMonTXXX and calcMonAnomTXXX. Whether you have a single 1D time series (like station data), maybe an irregular 2D time series (multiple stations), 3D like (time, lat, lon) or 4D (time, lev, lat, lon), clmMonTXXX will inspect the input variable's rank and figure out how to calculate the climatology. You can specify how many years of data must be present to calculate a valid mean. This function also updates (if necessary) variable attributes like valid_min, valid_max or valid_range.
>
> calcMonAnomTXXX will take a given 1D, 2D, 3D or 4D variable as well as the result of clmMonTXXX and calculate anomalies. It will also update the aforementioned meta data.
>
> I needed more summary statistics in my linear regression calculations so I wrote a regression function ("linreg") to return a lot more information than regcoef and regline. I'm planning on extending this function or creating a new one to accommodate multiple explanatory variables.
>
> I hope these functions find good use in the NCL community. If you uncover any bugs or have useful suggestions, let me know. That's what the "reply all" button is for.
>
> Chad
> <clm.ncl><squeeze.ncl><linreg.ncl>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 29 09:28:05 2011

This archive was generated by hypermail 2.1.8 : Tue Aug 02 2011 - 14:31:37 MDT