Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"description": "SpiPy is a Python implementation of SPIRES (SPectral Inversion of REflectance from Snow), a spectral unmixing algorithm for analyzing snow reflectance data from satellite imagery. It retrieves snow properties (grain size, dust concentration, fractional snow-covered area) using lookup tables generated from Mie-scattering theory. This implementation features a hybrid Python/C++ architecture achieving 3000x speedup over pure Python implementations.",
"creators": [
{
"name": "Bair, Ned",
"name": "Bair, Edward H.",
"affiliation": "University of California, Santa Barbara",
"orcid": "0000-0002-7654-3210"
"orcid": "https://orcid.org/0000-0002-6554-387X"
},
{
"name": "Griessbaum, Niklas",
"affiliation": "Leidos, Inc.",
"orcid": "0000-0000-0000-0000"
"orcid": "https://orcid.org/0000-0001-5037-6266"
}
],
"license": "MIT",
Expand All @@ -32,9 +32,5 @@
"scheme": "doi"
}
],
"grants": [
{
"id": "W913E523C0002"
}
]
"notes": "This work was supported by contract W913E523C0002."
}
17 changes: 9 additions & 8 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ message: "If you use this software, please cite both the software and the algori
title: "SpiPy: Python implementation of SPIRES snow property inversion"
authors:
- family-names: Bair
given-names: Ned
given-names: Edward H.
email: edwardbair@ucsb.edu
affiliation: "University of California, Santa Barbara"
orcid: "https://orcid.org/0000-0002-7654-3210" # Update with actual ORCID if available
orcid: "https://orcid.org/0000-0002-6554-387X"
- family-names: Griessbaum
given-names: Niklas
affiliation: "Leidos, Inc."
orcid: "https://orcid.org/0000-0000-0000-0000" # Update with actual ORCID if available
version: 0.2.0
date-released: 2024-11-06
repository-code: "https://github.com/edwardbair/SpiPy"
url: "https://github.com/edwardbair/SpiPy"
license: MIT # Update if different
orcid: "https://orcid.org/0000-0001-5037-6266"
version: 0.2.8
date-released: 2026-02-23
repository-code: "https://github.com/NiklasPhabian/SpiPy"
url: "https://spipy.readthedocs.io"
license: MIT
doi: 10.5281/zenodo.18747284
keywords:
- remote sensing
- snow properties
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# SpiPy

[![PyPI version](https://badge.fury.io/py/spires.svg)](https://pypi.org/project/spires/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18747284.svg)](https://doi.org/10.5281/zenodo.18747284)
[![Documentation Status](https://readthedocs.org/projects/spipy/badge/?version=latest)](https://spipy.readthedocs.io/en/latest/?badge=latest)
[![Build and Test](https://github.com/NiklasPhabian/SpiPy/workflows/Build%20and%20Test/badge.svg)](https://github.com/NiklasPhabian/SpiPy/actions)
[![Python 3.9-3.14](https://img.shields.io/badge/python-3.9--3.14-blue.svg)](https://github.com/NiklasPhabian/SpiPy)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**[📦 View Source on GitHub](https://github.com/NiklasPhabian/SpiPy)** | **[📖 Documentation](https://spipy.readthedocs.io)** | **[🐛 Report Issues](https://github.com/NiklasPhabian/SpiPy/issues)**

SpiPy is a Python implementation of [SPIRES](https://ieeexplore.ieee.org/document/9290428) (SPectral Inversion of REflectance from Snow), originally implemented in MATLAB ([SPIRES GitHub repository](https://github.com/edwardbair/SPIRES)).
SpiPy is a Python implementation of [SPIRES](https://ieeexplore.ieee.org/document/9290428) (Snow Property Inversion From Remote Sensing), originally implemented in MATLAB ([SPIRES GitHub repository](https://github.com/edwardbair/SPIRES)).

## Overview

Expand Down Expand Up @@ -239,12 +240,13 @@ If you use this software, please cite the algorithm paper, software implementati

**Software:**
```bibtex
@software{bair2024spipy,
@software{bair2026spipy,
title={SpiPy: Python implementation of SPIRES snow property inversion},
author={Bair, Ned and Griessbaum, Niklas},
year={2024},
url={https://github.com/edwardbair/SpiPy},
version={0.2.0},
author={Bair, Edward H. and Griessbaum, Niklas},
year={2026},
url={https://github.com/NiklasPhabian/SpiPy},
version={0.2.8},
doi={10.5281/zenodo.18747284},
note={See CITATION.cff for full metadata}
}
```
Expand Down
1 change: 1 addition & 0 deletions tests/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.mat filter=lfs diff=lfs merge=lfs -text
70 changes: 58 additions & 12 deletions tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@ This directory contains test data for the SpiPy package.

## Files in Repository (via Git LFS)

Small test data files suitable for CI/CD:
### Lookup Tables

- **lut_sentinel2b_b2to12_3um_dust.mat** (70 MB)
- Lookup table for Sentinel-2B bands 2-12 with dust parameters
- Essential for all Sentinel-2 tests
- Also available on Zenodo (see below)

- **lut_HLSS30_b1to13_3um_dust.mat** (101 MB)
- Lookup table for HLS (Harmonized Landsat Sentinel-2) bands 1-13 with dust parameters
- For HLS30 product testing

- **lut_modis_b1to7_3um_dust.mat** (537 MB)
- Lookup table for MODIS bands 1-7 with dust parameters
- For MODIS testing

- **lut_oli_b1to7_3um_dust.mat** (55 MB)
- Lookup table for Landsat OLI bands 1-7 with dust parameters
- For Landsat 8/9 testing

### Test Imagery Subsets

- **sentinel_r_subset.nc** (2.85 MB)
- Small spatial subset (50×50 pixels) of full reflectance data
- For quick integration tests
Expand All @@ -26,14 +40,24 @@ Full-resolution test data available on Zenodo:
### Lookup Tables
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18701286.svg)](https://doi.org/10.5281/zenodo.18701286)

- **LUT_MODIS.mat** (537 MB)
- MODIS lookup table generated from Mie-scattering theory
- Download: https://zenodo.org/records/18701286/files/LUT_MODIS.mat
**Note:** All lookup tables are included in the repository via Git LFS. Download from Zenodo if you have LFS quota issues or prefer direct downloads.

- **lut_sentinel2b_b2to12_3um_dust.mat** (70 MB)
- Sentinel-2B lookup table (also in repository via LFS)
- Download: https://zenodo.org/records/18701286/files/lut_sentinel2b_b2to12_3um_dust.mat

- **lut_HLSS30_b1to13_3um_dust.mat** (101 MB)
- HLS (Harmonized Landsat Sentinel-2) lookup table (also in repository via LFS)
- Download: https://zenodo.org/records/18701286/files/lut_HLSS30_b1to13_3um_dust.mat

- **lut_modis_b1to7_3um_dust.mat** (537 MB)
- MODIS lookup table (also in repository via LFS)
- Download: https://zenodo.org/records/18701286/files/lut_modis_b1to7_3um_dust.mat

- **lut_oli_b1to7_3um_dust.mat** (55 MB)
- Landsat OLI lookup table (also in repository via LFS)
- Download: https://zenodo.org/records/18701286/files/lut_oli_b1to7_3um_dust.mat

### Test Imagery
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18704072.svg)](https://doi.org/10.5281/zenodo.18704072)

Expand All @@ -50,26 +74,41 @@ Full-resolution test data available on Zenodo:

### For Development

The subset files are sufficient for most development and testing:
All lookup tables and test subsets are included in the repository via Git LFS:

```python
import xarray as xr
import spires

# Use subset files (in repository)
# Sentinel-2 example
r = xr.open_dataset('tests/data/sentinel_r_subset.nc')
r0 = xr.open_dataset('tests/data/sentinel_r0_subset.nc')
lut = spires.LutInterpolator('tests/data/lut_sentinel2b_b2to12_3um_dust.mat')
lut_s2 = spires.LutInterpolator('tests/data/lut_sentinel2b_b2to12_3um_dust.mat')

# MODIS example
lut_modis = spires.LutInterpolator('tests/data/lut_modis_b1to7_3um_dust.mat')

# Landsat OLI example
lut_oli = spires.LutInterpolator('tests/data/lut_oli_b1to7_3um_dust.mat')

# HLS example
lut_hls = spires.LutInterpolator('tests/data/lut_HLSS30_b1to13_3um_dust.mat')
```

### For Full Tests

To run tests with full-resolution data, download from Zenodo:
To run tests with full-resolution imagery or download LUTs without LFS, get from Zenodo:

```bash
cd tests/data

# Download lookup tables
# Download all LUTs from Zenodo (alternative to LFS)
curl -L -o lut_sentinel2b_b2to12_3um_dust.mat https://zenodo.org/records/18701286/files/lut_sentinel2b_b2to12_3um_dust.mat
curl -L -o lut_HLSS30_b1to13_3um_dust.mat https://zenodo.org/records/18701286/files/lut_HLSS30_b1to13_3um_dust.mat
curl -L -o lut_modis_b1to7_3um_dust.mat https://zenodo.org/records/18701286/files/lut_modis_b1to7_3um_dust.mat
curl -L -o lut_oli_b1to7_3um_dust.mat https://zenodo.org/records/18701286/files/lut_oli_b1to7_3um_dust.mat

# Download legacy MODIS LUT (if needed for compatibility tests)
curl -L -o LUT_MODIS.mat https://zenodo.org/records/18701286/files/LUT_MODIS.mat

# Download full test imagery (large!)
Expand All @@ -90,9 +129,16 @@ python scripts/download_test_data.py --imagery
## CI/CD Behavior

GitHub Actions:
- Uses subset files by default (fast, no quota issues)
- Skips tests requiring LUT_MODIS.mat (MODIS-specific tests)
- Can be configured to download full files from Zenodo if needed
- All lookup tables (Sentinel-2, MODIS, OLI, HLS) are available via Git LFS
- Uses subset imagery files by default (fast tests)
- Downloads `lut_sentinel2b_b2to12_3um_dust.mat` from Zenodo to avoid LFS quota
- Skips tests requiring legacy LUT_MODIS.mat format
- Full-resolution imagery can be downloaded from Zenodo if needed

GitLab CI:
- Configured with `GIT_LFS_SKIP_SMUDGE: "1"` to avoid LFS quota issues
- Downloads required LUTs from Zenodo on-demand
- Uses same test approach as GitHub Actions

## Citation

Expand Down
3 changes: 3 additions & 0 deletions tests/data/lut_HLSS30_b1to13_3um_dust.mat
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/data/lut_modis_b1to7_3um_dust.mat
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/data/lut_oli_b1to7_3um_dust.mat
Git LFS file not shown
Loading