Skip to content
jmineauPublic

About

Salt Lake Valley python package

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Salt Lake Valley py

Tests Documentation Code Quality codecov License: MIT DOI Ruff

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. pixi installs it beside everything else, from pixi.lock:

git clone https://github.com/jmineau/slv.git
cd slv
pixi install     # builds .pixi/envs/default
pixi run python  # or: pixi shell

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_locator_map().add_north_arrow())
m.fig.savefig("slv.png", dpi=300)

A methane inversion (builds the Jacobian from the PYSTILT footprints; run it through SLURM, in the pixi environment: the default prior needs xesmf, and on Python 3.14 a script needs an if __name__ == "__main__": guard, see the usage guide):

from slv.inversion import InversionConfig, run

config = InversionConfig(tstart="2016-01-01", tend="2024-01-01", flux_freq="MS",
                         sites=["wbb"], variant="hrrr", cache="./cache")
post = run(config)  # a fips Posterior: post.estimate, post.variances, post.cov(W)

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.

Use of AI coding agents

This project is developed with the help of AI coding agents, directed and reviewed by the maintainer, who owns the design and the science.

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