Metadata-Version: 2.4
Name: ullrs-secret
Version: 1.0.0
Summary: Ullr's Secret — backcountry ski snow conditions forecaster
Home-page: https://github.com/jangsutsr888/ullrs-secret
License: AGPL-3.0-or-later
Project-URL: Documentation, https://ullrs-secret.readthedocs.io/
Project-URL: Issues, https://github.com/jangsutsr888/ullrs-secret/issues
Project-URL: Source, https://github.com/jangsutsr888/ullrs-secret
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: matplotlib>=3.8
Requires-Dist: pandas>=2.2
Requires-Dist: scipy==1.13.1
Requires-Dist: pytz>=2024.1
Requires-Dist: cdsapi
Requires-Dist: xarray
Requires-Dist: netCDF4
Requires-Dist: numpy
Requires-Dist: requests
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx<9,>=8; extra == "docs"
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Ullr's Secret

Ullr's Secret is a Python command-line tool for estimating backcountry snow
surface conditions from hourly weather data. It adjusts weather for elevation,
slope, aspect, humidity, and radiation, then produces charts for powder
preservation, corn timing, and melt-freeze consolidation.

> **Safety:** This is a snow-quality decision aid, not an avalanche forecast.
> It does not model buried weak layers, wind slabs, terrain traps, or local
> avalanche hazard.

The model derivation is available as
[English](https://github.com/jangsutsr888/ullrs-secret/blob/main/core_calc_en.pdf)
and
[Chinese](https://github.com/jangsutsr888/ullrs-secret/blob/main/core_calc_cn.pdf)
PDFs. Detailed usage and model documentation live on
[Read the Docs](https://ullrs-secret.readthedocs.io/).

## Commands

| Command | Purpose |
| --- | --- |
| `import openmeteo` | Import a current multi-model forecast without credentials |
| `import nws` | Import a US National Weather Service forecast |
| `import era5` | Import historical ERA5 reanalysis data using CDS credentials |
| `pow-plot` | Estimate when fresh powder degrades |
| `corn-plot` | Estimate the spring corn window |
| `consolidation-plot` | Model dry snow, slush, and crust through melt-freeze cycles |
| `terrain` | Query elevation, slope, and aspect for a coordinate |
| `snotel-list`, `snotel` | Find and inspect nearby SNOTEL stations |

Each importer writes the same standard weather JSON format, which any chart
command can consume.

## Install

Python 3.10 or newer is required.

```console
git clone https://github.com/jangsutsr888/ullrs-secret.git
cd ullrs-secret
python3 -m venv .venv
source .venv/bin/activate
python -m pip install .
ullrs-secret --help
```

See the
[installation runbook](https://ullrs-secret.readthedocs.io/en/latest/installation.html)
for verification, updates, Windows activation, and contributor setup.

## Quick start

Import a forecast and generate a corn chart for a southeast-facing slope:

```console
ullrs-secret import openmeteo \
    --lat 46.8523 --lon -121.7603 \
    --model best_match \
    --output weather_data.json

ullrs-secret corn-plot weather_data.json \
    --slope 35 --aspect 135 --elevation 9000 \
    --no-show --output corn_forecast_chart.png
```

Use `ullrs-secret COMMAND --help` for the current CLI options. The dedicated
documentation pages explain the algorithms and include output from the
integration tests:

- [Chart commands](https://ullrs-secret.readthedocs.io/en/latest/charts/index.html)
- [Weather importers](https://ullrs-secret.readthedocs.io/en/latest/importers/index.html)
- [Effective-temperature model](https://ullrs-secret.readthedocs.io/en/latest/model.html)
- [Limitations and field use](https://ullrs-secret.readthedocs.io/en/latest/limitations.html)

## Documentation

Build and validate the classic Sphinx site:

```console
make docs-check
```

Serve it at <http://127.0.0.1:8000/>:

```console
make docs-serve
```

## Tests

```console
make test
```

The integration tests query live terrain data and regenerate the three example
images. Run them without opening Matplotlib windows with:

```console
ULLRS_SECRET_NO_SHOW=1 make integration_test
```

## License

GNU Affero General Public License v3.0 or later. See
[LICENSE](https://github.com/jangsutsr888/ullrs-secret/blob/main/LICENSE).
