Skip to content

phenocam

This module contains functionality to download and load data from phenocam observations (https://phenocam.nau.edu/webcam/) using phenocamr as client.

Requires phenocamr R package. Install with

install.packages("phenocamr")

Example:

```python
from springtime.datasets import Phenocam

dataset = Phenocamr(
    site="harvard$",
    years=(2019, 2020),
)
dataset.download()
df = dataset.load()
```

Example:

```python
from springtime.datasets import Phenocam

dataset = Phenocamr(
    area={
        "name": "harvard",
        "bbox": [-73, 42, -72, 43],
    },
    years=(2019, 2020),
)
dataset.download()
df = dataset.load()
```

PhenocamVariables = Literal['midday_r', 'midday_g', 'midday_b', 'midday_gcc', 'midday_rcc', 'r_mean', 'r_std', 'g_mean', 'g_std', 'b_mean', 'b_std', 'gcc_mean', 'gcc_std', 'gcc_50', 'gcc_75', 'gcc_90', 'rcc_mean', 'rcc_std', 'rcc_50', 'rcc_75', 'rcc_90', 'max_solar_elev', 'smooth_gcc_mean', 'smooth_gcc_50', 'smooth_gcc_75', 'smooth_gcc_90', 'smooth_rcc_mean', 'smooth_rcc_50', 'smooth_rcc_75', 'smooth_rcc_90', 'smooth_ci_gcc_mean', 'smooth_ci_gcc_50', 'smooth_ci_gcc_75', 'smooth_ci_gcc_90', 'smooth_ci_rcc_mean', 'smooth_ci_rcc_50', 'smooth_ci_rcc_75', 'smooth_ci_rcc_90'] module-attribute

Variables available in phenocamr.

Phenocam

Bases: Dataset

Download and load data from phenocam

Attributes:

Name Type Description
years

timerange. For example years=[2000, 2002] downloads data for three years.

veg_type Optional[str]

Vegetation type (DB, EN). Default is "all".

frequency Literal['1', '3', 'roistats']

Frequency of the time series product.

variables Sequence[PhenocamVariables]

Variables you want to download. When empty will download all the variables.

site Optional[str]

Download a single site, specified by the name of site. Append $ to get exact match.

rois Optional[str]

The id of the ROI to download. Default is all ROIs at site.

area Optional[NamedArea]

Download all sites in an area. A dictionary of the form {"name": "yourname", "bbox": [xmin, ymin, xmax, ymax]}.

to_recipe()

Print out a recipe to reproduce this dataset.

download()

Download the data.

Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.

raw_load()

Load the dataset from disk into memory.

This may include pre-processing operations as specified by the context, e.g. filter certain variables, remove data points with too many NaNs, reshape data.

list_sites()

List of phenocam sites.

Returns:

Type Description
GeoDataFrame

Data frame containing phenocam sites

list_rois()

List of phenocam regions of interest (ROI).

Returns:

Type Description
GeoDataFrame

Data frame containing phenocam Regions of Interest.