Be the first to rate this file! 88 downloads (last 30 days) File Size: 2.47 KB File ID: #24392

Aggregate timeseries data to solstices and equinoxes.

by Jeff Burkey

 

09 Jun 2009

Code covered by BSD License  

Aggregates serial datetime data to summer/winter solstices, and spring/fall equinoxes.

Download Now | Watch this File

File Information
Description

accumSeasonTS- aggregate timeseries to solstices and equinoxes

Using G. Cardillo function to compute solstices and equinoxes, this function will aggregate time series data (e.g. Precipitation) to seasonally summarized results. To accomplish this three core functions are used: eqnsol, unique, and accumarray. The rest of the function is manipulating data to pass around in between the functions.

This function will output cumulative seasonal totals of data. It's
application is limited default parameterization of ACCUMARRAY matlab function (i.e. sum totals). It's certainly possible to modify this function to allow the user to apply different statistics in the
ACCUMARRAY function, but not done here.

Additionally, this function uses another function (EQNSOL) to calculate the summer/winter solstices and spring/fall equinoxes per year, then sum up the data within each season.

Function does not discriminate on partial seasons. Partial seasons that are either because of beginning or ending dates, or because of missing data are not censored. Partial seasons will be output along with all complete seasons. It's up to the user to either pre-process the data or post process the results.

Expected inputs is a timeseries of data in two columns: a decimal date, and the values to be accumulated.

datain = n x 2
  datain(:,1) = decimal date/time
  datain(:,2) = values to sum by season
fn = supplied string specifying a valid summary statistic function.
Example: @sum, @max, @min, etc.

dataout = n x 2
  dataout(:,1) = decimal date/time of the start of the season
  dataout(:,2) = values summed for the season

Acknowledgements:

Cardillo G. (2007) Equinoxes and Solstices: compute the date and time of equinoxes and solstices.
http://www.mathworks.com/matlabcentral/fileexchange/17977
  
Written by:
  Jeff Burkey
  King County- DNRP
  email: jeff.burkey@kingcounty.gov
  May 30, 2009

Syntax:
  [dataout] = accumSeasonTS(datain,fn)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Equinoxes and Solstices

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files accumSeasonTS.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Jeff Burkey 10 Jun 2009 09:28:55
seasonal Jeff Burkey 10 Jun 2009 09:28:55
aggregation Jeff Burkey 10 Jun 2009 09:28:55
aggregation function Jeff Burkey 10 Jun 2009 09:28:55
solstices Jeff Burkey 10 Jun 2009 09:28:55
solstice Jeff Burkey 10 Jun 2009 09:28:55
equinoxes Jeff Burkey 10 Jun 2009 09:28:55
equinox Jeff Burkey 10 Jun 2009 09:28:55
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com