Usage Guide for analyze_transects.py¶
This script analyzes each transect in a csv file of SDS data and computes a number of statistics for each transect. These statistics summarize a variety of quantities that are outlined below.
Each variable in the output CSV file, and their meaning:
stationarity
: 1=statistically significant stationarity (i.e., a lack of trend. Otherwise, 0). This uses the Augmented Dickey-Fuller test docs hereautocorr_min
: minimum autocorrelationlag_min
: lag associated with minimum autocorrelationentropy
: If this value is high, then the timeseries is probably unpredictable. details herelinear_trend_slopes
: slope of linear fitlinear_trend_intercepts
: intercept of linear fitlinear_trend_rvalues
: correlation of linear fit with underlying datalinear_trend_pvalues
: significance of linear fit (probability of no trend)linear_trend_stderr
: standard error in estimate of linear trend slopelinear_trend_intercept_stderr
: standard error of linear trend intercept
Each variable in the output NPZ file, and their meaning:
trend2d
: 2d matrix of shoreline trend (decomposed using the STL technique)season2d
: 2d matrix of shoreline seasonality (decomposed using the STL technique)auto2d
: 2d matrix of autocorrelationweights2d
: 2d matrix of autocorrelation (decomposed using the STL technique)cs_transects_vector
: vector of transect namescs_dates_vector
: vector of shoreline datescs_data_matrix_demeaned
: the demeaned version of the data used to compute statisticsdf_resampled
: the regular-in-time (resampled) version of the data used to compute statistics
Need Help¶
To view the help documentation for the script, use the following command:
1 |
|
Command line arguments¶
-f
: Sets the file (csv) to be analyzed
More details
The csv format file shoule contain shoreline positions in each cell, with rows as time and columns as transects-p
: If 1, make a plot
More details
A flag to make (or suppress) a plotExamples¶
Example #1: Basic Usage¶
This example analyzes the transect_time_series_coastsat_nooutliers_inpainted.csv
file using the default parameters:
1 |
|
Here's an example screenshot
The (optional) plot is created. This shows the data as a 2d matrix of a) trend in shoreline position, b) seasonal shoreline excursion, and c) autocorrelation as a function of time and transect. This plot is purely for QA/QC purposes and is not intended to be a publication ready figure. This merely shows the data, as a convenience:
This shows the contents of the compressed numpy archive (.npz) file.
Future work¶
- add https://www.statsmodels.org/dev/generated/statsmodels.tsa.stattools.kpss.html option
- add https://www.statsmodels.org/dev/generated/statsmodels.tsa.stattools.levinson_durbin.html for autoregressive test