CCGCRV

Section: User Commands (1)
Updated: local
Index Return to Main Contents
 

NAME

ccgcrv - Apply ccg curve fitting routines to time series data  

SYNOPSIS

ccgcrv [ options ] [ file ]
 

DESCRIPTION

ccgcrv applies the standard ccg curve fitting routines to a time series data set. This curve fit consists of a function fit to the data where the function is a combination of a polynomial and annual harmonics. The residuals from this fit are then smoothed using a low pass filter.

If file is not specified, input is from stdin. The input data must consist of two columns of numbers. The first column is a decimal year value, and the second column is the corresponding value. Columns are separated by white space.

 

OPTIONS

The following options are used for determining how the curve fits are made to the data.

-npoly num
Specify the number of polynomial terms to use. Default is 3. num must be in the range 0 to 10.

-nharm num
Specify the number of annual harmonic terms to use. Default is 4. num must be in the range 0 to 10.

-interv value
Specify the average sampling interval between data points. This is a floating point number, and units are in days. If not specified, ccgcrv will calculate it based on the spacing in the input data.

-short num
Specify the short term cutoff value for the low pass filter. The short term value is usually used for applying light smoothing to the data. Units for num are in days. The default value is 50.

-long num
Specify the long term cutoff value for the low pass filter. The long term value is usually used for removing any remaining annual cycles still present in the residuals after the function fit. Units for num are in days. The default value is 667.

-timez decdate
Specify the date at which the coefficients of the function fit will intersect the y axis, that is, when x = 0. This should be a decimal year value. The default value is January 1st for the year of the first data point.

The following options determine the date category of the output. There are three categories: sample dates, equally spaced dates, and user defined dates. Only one of equally spaced dates or user defined dates should be specified. If both are, then equally spaced dates are used. The output for sample date results can be saved to a file using the -s file option. The output for the equally spaced or user defined date results can be save to a file using the -f file option. At least one of the next three options must be specified. If not, then -sample is assumed.

-sample
Output data will be printed at the dates corresponding to the input sample data. The output options (see below) -orig, -res, -detrend, and -ressm are available only for this option.

-equal
Output data will be printed at equal time intervals. The interval is specified by -interv. The times for the output data will not necessarily correspond to the input data times when using this option. The starting date is the date of the first sample. This can be changed using the -date option (see below).

-user file
Output data will be printed based on dates contained in 'file'. The dates should be in decimal year format, and be the first column in the file.

The next options are used for redirecting output to a file instead of to stdout.

-s file
Write sample date defined output data to 'file' instead of stdout. This does not affect the -coef and -stats options. They continue to go to stdout only.

-f file
Write equally spaced or user defined output data to 'file' instead of stdout. This does not affect the -coef and -stats options. They continue to go to stdout only.

The following options determine the dates and date formats for the output results.

-cal
Dates and times for output data will be printed using calendar style representation. Default is for decimal year values. Output consists of three columns of numbers representing the year, month and day of the data point.

-date yy:mm:dd
Specify the starting date of output data. Normally ccgcrv will print out data for the same period as the input data. This option allows the user to explicitly set the starting date. When used in conjunction with -interv , equally spaced data at known times can be output.

Different parts of the result curves can be printed to standard output by specifying one or more of the following options. Output consists of columns of numbers separated by white space. The first column is the decimal date (or calendar date if -cal is specified) in .6f format. Any remaining columns correspond to any of the following options that are specified. Each column has an %8.3f format. The order of the columns from left to right, regardless of the order of the specfied options, is

-orig
-func
-poly
-smooth
-trend
-detrend
-smscycle
-harm
-res
-smres
-trres
-ressm
-gr

The options -all and -unique can be used to get multiple results.

-all
All curve results contained in the list above are printed. If -equal or -user file are specified, then -orig, -detrend, -res, and -ressm are not included.

-unique
The curve results that are unique to an output date category are printed. If -sample is specified, only the results corresponding to -orig, -detrend, -res, and -ressm are included. If -equal or -user file are specified, all other options except the four unique to -sample are printed.

-orig
Values of the original input data set will be printed. Only applies if -equal or -user are not specified.

-func
Print values of the function fit to the data.

-poly
Print values of the polynomial part of the function.

-smooth
Print values of the short term smoothed curve. This is the function plus the short term filter of the residuals.

-trend
Print values of the trend curve. This is the polynomial part of the function plus the long term filter of the residuals.

-detrend
Print values of the detrended data. This is the original data points minus the trend curve. Only applies if -equal and -user file are not specified.

-smcycle
Print values of the smoothed, detrended annual cycle. This is the smooth curve minus the trend.

-harm
Print values of the annual harmonic part of the function.

-res
Print values of the residuals from the function. Only applies if -equal or -user are not specified.

-smres
Print values of the short term smoothed residuals from the function.

-trres
Print values of the long term smoothed residuals from the function.

-ressm
Print values of the residuals from the smoothed curve. This is the original data points minus the smoothed curve. Only applies if -equal and -user file are not specified.

-gr
Print values of the growth rate. This is the first derivative of the trend curve.

Miscellaneous extra output options.

-coef num1, num2
Print values of the coefficients of the function. All other output options are ignored if -coef is specifed. num1 and num2 refer to the begining and ending indexes of the coefficients. The coefficients are numbered from 0 to n where n is -npoly + 2 * -nharm - 1. There are two coefficients for each harmonic term in the function.

-stats
Print summary statistics of curve fit. This includes such things as function coefficients and uncertainties, filter parameters, and residual information.

 

EXAMPLES

The most common case is to get all results written to two files, one with results based on sample dates, one with results based on equally spaced or user defined dates. The following example computes curves for the data in testfile and creates the two files file1 and file2. file1 contains results based on sample dates (4 columns of result data), and file2 contains results based on equally spaced dates (9 columns of result data).

ccgcrv -sample -equal -unique -s file1 -f file2 inputfile

Print the long term trend values from the data file testfile.

ccgcrv -npoly 3 -nharm 4 -trend testfile

Print the smoothed curve, at equally spaced intervals, 14 days apart.

ccgcrv -interv 14 -equal -smooth testfile

Print in calendar format the growth rate

ccgcrv -cal -gr testfile

 

WARNINGS

If no output options are specified, ccgcrv prints out nothing.

 

SEE ALSO

See the paper Curve Fitting Methods Applied to Time Series of Trace Gas Measurements in NOAA/CMDL by K.W. Thoning.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
WARNINGS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 23:33:09 GMT, March 08, 2002