Skip to content

Repository files navigation

Salt Lake Valley py

Tests Documentation Code Quality codecov PyPI version Python Version License: MIT DOI Ruff Pyright

Salt Lake Valley python modules

Installation

Standard (uv or pip)

git clone https://github.com/jmineau/slv.git
cd slv
uv sync  # or: pip install -e .

To include the inversion module:

uv sync --extra inversion  # or: pip install -e ".[inversion]"

uv sync also installs the dev group (tests, linting, docs), which includes the inversion extra.

With xesmf (EPA / EDGAR priors)

The EPA and EDGAR priors are regridded with xesmf, which needs a compiled ESMF library from conda-forge, so install into the conda environment instead:

git clone https://github.com/jmineau/slv.git
cd slv
conda env create -f ci/environment.yml
conda activate slv
pip install --no-deps -e .

Usage

A map of the valley:

from slv.basemap import SaltLake

m = (SaltLake(tiles="terrain")          # Stadia stamen_terrain; needs $STADIA_API_KEY
     .add_population()
     .add_trax(lines="RG")
     .add_sites(["wbb", "ldf", "hdp"], labels={"wbb": "UOU"})
     .add_mesowest()
     .add_legend().add_inset().add_north_arrow())
m.fig.savefig("slv.png", dpi=300)

A methane inversion (builds the Jacobian from the PYSTILT footprints; run it through SLURM):

from slv.inversion import InversionConfig, SLVMethaneInversion

config = InversionConfig(tstart="2016-01-01", tend="2024-01-01", flux_freq="MS",
                         sites=["wbb"], footprint="0.01", cache="./cache")
problem = SLVMethaneInversion(config).run()

The usage guide also covers loading measurements, hyperparameter sweeps and building TRAX receptors.

Documentation

Full documentation is available at https://jmineau.github.io/slv/

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

James Mineau - jmineau

About

Salt Lake Valley python package

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages