phenocam_snow.utils
- get_site_names()
Gets all available PhenoCam site names.
- Returns:
The list of PhenoCam site names, or None if an error occurred.
- Return type:
List[str]|None
- get_site_dates(site_name)
Gets the dates of the first and last images collected at a site.
- download(site_name, dates, save_to, n_photos)
Downloads photos taken in some time range at a given site.
- Parameters:
site_name (str) – The name of the site to download from.
dates (Tuple[str, str]) – A 2-tuple indicating the oldest and youngest allowable photos.
save_to (str) – The destination directory for downloaded images. If the directory already exists, it is NOT cleared. New photos are added to the directory, except for duplicates, which are skipped.
n_photos (int) – The number of photos to download.
- download_from_log(source_log, save_to)
Downloads images that are listed in a log file.
- label_images_via_subdir(site_name, categories, img_dir, save_to)
- Allows the user to label images by moving them into the appropriate
subdirectory.
- read_labels(labels_file)
Reads image-label pairs.
- Parameters:
labels_file (str) – The path to the labels file.
- Returns:
A pandas DataFrame where each row contains the timestamp of an image, the path to that image, its label as a string, and the integer encoding of that label.
- Return type:
pd.DataFrame