Transform the quarterly landsat data to an annual time series
Source:R/extract_time_series.R
extract_time_series.Rd
The Landsat kelp area data is a quarterly product per pixel, so this function serves to aggregate these pixels to a time series for each segment, either quarterly or annually, with a few different methods for the annualization.
Arguments
- segmented_landsat_data
A dataframe generated by
segment_landsat_data()
with rows for each pixel, and columns for each quarter and year of the landsat data, with the assigned segment from a given shapefile- ...
These dots are for future extensions and must be empty.
- frequency
The frequency of the time series to extract. Either "annual" (default) or "quarterly"
- annualization_method
The method used to convert the quarterly time series to an annual time series.
"sum_first": sums together all quarterly area values for each pixel within each segment, and then the maximum area per year for each segment is calculated
"max_first": for each pixel, the maximum quarterly area in a year is calculated first, and then all these maximum areas per year are summed together within each kelp segment.
"Q1": selects the first quarter of every year
"Q2": selects the second quarter of every year
"Q3": selects the third quarter of every year
"Q4": selects the fourth quarter of every year
- segment_id
A character vector containing the subset of
segment_id
's of interest, e.g.c("CA_71", "CA_78")
, orNULL
for all segment IDs (default).
Value
A dataframe with the following columns:
Segment_ID
: The ID of the kelp area segmentmax_occupiable
: The maximum occupiable kelp area for the given segment. This column repeats the same value for all rows in a single kelp area segmenthistorical_med
: The historical (1984-2013) median kelp area for the segment. The median is computed across the quarterly or annualized kelp area values, depending onfrequency
. This column repeats the same value for all rows in a single kelp area segmentquarter
*: Iffrequency == "quarterly"
, the quarter in the time series, otherwise not presentyear
: Year in the time seriesdate
: date representation of the year/quarter, for simpler plottingarea_abs
: Kelp area in absolute magnitude, in km^2area_hist
: Kelp area relative to the historical median, expressed as a percentagearea_pct
: Kelp area relative to the maximum occupiable kelp area, expressed as a percentage