Thank you for considering contributing to the Remote Sensing Analysis project! This document provides guidelines and information for contributors.
The project follows a modular structure to separate concerns and enable reusability:
remote-sensing-analysis/
├── config/ # Configuration files
│ ├── areas.py # Geographic area definitions
│ ├── pipeline.yaml # Pipeline configuration
│ └── settings.py # General settings
├── data/ # Data storage
│ ├── output/ # Generated output files
│ │ └── statistics/ # Statistical analysis results
│ ├── processed/ # Intermediate processed data
│ └── raw/ # Raw input data
├── docs/ # Documentation
│ └── research.md # Research notes and methodology
├── notebooks/ # Jupyter notebooks for analysis
│ └── lai_finland.ipynb # Finland LAI/MSI analysis example
├── scripts/ # Executable scripts
│ └── run_pipeline.py # Modular CLI pipeline runner
└── src/ # Source code
├── extractors/ # Data extraction modules
│ └── sentinel.py # Sentinel imagery extraction
├── metrics/ # Index calculation modules
│ ├── moisture.py # Moisture metrics (MSI)
│ └── vegetation.py # Vegetation metrics (EVI, LAI)
├── pipeline/ # Pipeline components
│ └── runner.py # Pipeline orchestration
├── processors/ # Data processing modules
│ └── preprocessing.py # Common preprocessing functions
├── statistics/ # Statistical analysis
│ └── distribution.py # Index distribution analysis
└── visualization/ # Visualization utilities
└── maps.py # Map generation helpers
- Python 3.12+
- UV package manager
# Clone the repository
git clone https://github.com/yourusername/remote-sensing-analysis.git
cd remote-sensing-analysis
# Set up environment
uv create
uv install
# Install development dependencies
uv install --group=dev
# Install the package in development mode
uv pip install -e .
# Set up Earth Engine authentication (if not previously done)
earthengine authenticate
We use Python 3.9+ type annotations throughout the codebase. All functions must have type annotations.
Examples of proper type annotations:
# Basic types
x: int = 1
x: float = 1.0
x: bool = True
x: str = "test"
x: None = None
# Collections
x: list[int] = [1, 2, 3]
x: dict[str, float] = {"field": 2.0}
x: set[str] = {"yes", "no"}
x: tuple[int, str, float] = (3, "yes", 7.5) # Fixed size tuple
x: tuple[int, ...] = (1, 2, 3) # Variable size tuple
We use mypy
for static type checking. Run mypy before submitting any PR:
uv run mypy .
To check a specific file:
uv run mypy src/pipeline/runner.py
We use uv
for package management. To add new dependencies:
# Add regular dependencies
uv add <package-name>
# Add development dependencies
uv add --group=dev <package-name>
To add new geographic areas for analysis, edit config/areas.py
:
AREAS: dict[str, ee.Geometry] = {
"finland": ee.FeatureCollection("FAO/GAUL/2015/level0")
.filter(ee.Filter.eq("ADM0_NAME", "Finland"))
.geometry(),
"your_new_area": ee.Geometry.Rectangle([lon1, lat1, lon2, lat2])
}
To add a new vegetation or moisture index:
- Add the calculation function to the appropriate module in
src/metrics/
- Update the pipeline to include the new metric in
src/pipeline/runner.py
- Add the metric name to your
config/pipeline.yaml
To extend the CLI with a new command:
- Edit
scripts/run_pipeline.py
- Add a new function with the
@app.command()
decorator - Implement the command logic
- Update documentation
When adding new features, make sure to add appropriate tests to validate functionality:
# Run tests
uv run pytest
- Fork the repository
- Create a feature branch
- Make your changes
- Run type checking:
uv run mypy .
- Run tests:
uv run pytest
- Submit a pull request
The pipeline generates several types of output files:
-
GeoTIFF Files: Raster files for each calculated index
- Location:
data/output/rs_metrics_{area}_{date}_{metric}.tif
- Location:
-
Metadata: JSON file with processing details
- Location:
data/output/rs_metrics_{area}_{date}_metadata.json
- Location:
-
Statistics Files: CSV files with statistical analysis
- Location:
data/output/statistics/rs_metrics_{area}_{date}_{metric}_statistics.csv
- Location:
-
Visualization Files: PNG files with distribution plots
- Location:
data/output/statistics/rs_metrics_{area}_{date}_{metric}_distribution_analysis.png
- Location:
data/output/statistics/index_comparison.png
- Location: