Skip to main content

Command-line tool for downloading PhenoCam data

Project description

PhenoFetch

CI phenofetch

Logo

A command-line tool for downloading and analyzing PhenoCam data from NEON (National Ecological Observatory Network) sites. PhenoFetch is a Python-based tool designed to facilitate the retrieval and analysis of PhenoCam data from the National Ecological Observatory Network (NEON). PhenoCam data consists of time-lapse images used to monitor vegetation phenology (seasonal changes) at various ecological sites across the United States. This tool simplifies the process of downloading images and metadata from the PhenoCam web service, providing both batch download capabilities and summary statistics for data availability.

This tool is not officially affiliated with the National Ecological Observatory Network (NEON) or the PhenoCam Network.

Table of Contents

Features

  • Site Discovery: List all available NEON PhenoCam sites with their details
  • Data Download: Efficiently download PhenoCam images and metadata for specified sites and date ranges
  • Site Statistics: View comprehensive statistics about data availability for each site
  • Size Estimation: Estimate the total download size before starting a large download
  • Asynchronous Processing: Fast, concurrent downloading using asynchronous I/O
  • Smart Concurrency: Automatically adjusts download parallelism based on system resources
  • Progress Tracking: Clear progress bars and status updates during operations

Installation

Requirements

  • Python 3.7+
  • Required Python packages (see requirements.txt)

Setup

  1. Clone this repository:

    git clone https://github.com/your-username/phenofetch.git
    cd phenofetch
    
  2. Install dependencies:

    pip install -r requirements.txt
    

Usage

PhenoFetch provides four main commands:

  • sites: List all available PhenoCam sites
  • stats: Display statistics for a site
  • estimate: Estimate download size for a date range
  • download: Download data for a specific site and date range

List Available Sites

To see all available NEON PhenoCam sites:

python phenofetch.py sites

View Site Statistics

To view statistics for a specific site:

python phenofetch.py stats --site SITE_CODE --product PRODUCT_ID

Estimate Download Size

To estimate the download size for a specific site and date range:

python phenofetch.py estimate --site SITE_CODE --product PRODUCT_ID --start-date YYYY-MM-DD --end-date YYYY-MM-DD

Optional arguments:

  • --batch-size: Number of files to process in each batch (default: 50)
  • --concurrency: Maximum number of concurrent connections (default: auto-determined)
  • --timeout: Connection timeout in seconds (default: 30)

Download Data

To download data for a specific site and date range:

python phenofetch.py download --site SITE_CODE --product PRODUCT_ID --start-date YYYY-MM-DD --end-date YYYY-MM-DD [--download] [--output-dir DIR]

Required arguments:

  • --site: NEON site code (e.g., ABBY, BART)
  • --product: NEON product ID (e.g., DP1.00033)
  • --start-date: Start date in YYYY-MM-DD format
  • --end-date: End date in YYYY-MM-DD format

Optional arguments:

  • --download: Flag to actually download files (if omitted, just shows a summary)
  • --output-dir: Directory to save downloaded files (default: ./phenocam_data)
  • --batch-size: Number of files to download in each batch (default: 50)
  • --concurrency: Maximum number of concurrent downloads (default: auto-determined)
  • --timeout: Connection timeout in seconds (default: 30)

Examples

List All Sites

python phenofetch.py sites

This will display a table of all available NEON PhenoCam sites, including their site codes, descriptions, domains, states, and types.

View Site Statistics Example

python phenofetch.py stats --site HARV --product DP1.00033

This will display:

  1. A summary table showing data availability by year and month for the Harvard Forest site
  2. Total image counts
  3. Year-by-year statistics
  4. Average images per month

Estimate Download Size Example

python phenofetch.py estimate --site ABBY --product DP1.00033 --start-date 2022-01-01 --end-date 2022-01-31

This will:

  1. Fetch all available PhenoCam data links from the ABBY site for January 2022
  2. Check the size of each file without downloading it
  3. Display a summary of the estimated total download size, broken down by file type
  4. Help you make an informed decision before starting a large download

Download Images for a Specific Date Range

python phenofetch.py download --site ABBY --product DP1.00033 --start-date 2022-01-01 --end-date 2022-01-31 --download --output-dir ./my_phenocam_data

This will:

  1. Fetch all available PhenoCam data from the ABBY site for January 2022
  2. Download all images, thumbnails, and metadata files to the specified directory
  3. Show progress as the downloads proceed

License

Apache License 2.0

Contact

For questions or feedback, please contact:

  • Samapriya Roy

PhenoFetch Changelog

Version 0.0.2

  • Added: New estimate command to check download size before committing to large downloads
  • Added: Size estimation for full-resolution images and thumbnails
  • Added: Detailed breakdown of file sizes by type (full-res, thumbnail, metadata)
  • Added: Better error handling and reporting in size estimation
  • Updated: Documentation to include size estimation workflow
  • Fixed: Progress bar display for better visibility during batch operations
  • Improved: Terminal output formatting with Rich library

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phenofetch-0.1.1.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phenofetch-0.1.1-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file phenofetch-0.1.1.tar.gz.

File metadata

  • Download URL: phenofetch-0.1.1.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for phenofetch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 795b703f1ce3760953a2901bb342124e69ec54747e40db10cc6bcd47803aa530
MD5 f7deafd117f174aba92197b0e8742f40
BLAKE2b-256 81e96bc5d1cdcf8c75e19f5fff5234f59f9487650ead16a35ef82181b1af5414

See more details on using hashes here.

File details

Details for the file phenofetch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: phenofetch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for phenofetch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72f6a876c1994f7c6818944bdb537b83fc75718e4e9f84f1295c6c0ff4286adb
MD5 6a9cae06f2d3a3a2c600f55ee4feab41
BLAKE2b-256 9d76731ceeea78aadc632fc32ad0e2b43f90126501f1a2adf129b9e87f606429

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page