Metadata-Version: 2.3
Name: sparta-solar
Version: 0.2.0
Summary: Solar PArameterization for the Radiative Transfer of the Atmosphere
Keywords: solar radiation,clear-sky,radiative transfer,MERRA-2,CAMS Radiation Service,atmospheric modeling,solar energy
Author: Jose A Ruiz-Arias
Author-email: Jose A Ruiz-Arias <jararias@uma.es>
License: CC BY-NC-SA 4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Dist: dask[complete]>=2026.3.0
Requires-Dist: earthengine-api>=1.7.26
Requires-Dist: huggingface-hub>=1.15.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: netcdf4>=1.7.4
Requires-Dist: numpy>=2.4.4
Requires-Dist: pandas>=3.0.2
Requires-Dist: platformdirs>=4.9.6
Requires-Dist: pyarrow>=24.0.0
Requires-Dist: scipy>=1.17.1
Requires-Dist: sunwhere>=1.4.1
Requires-Dist: tomlkit>=0.15.0
Requires-Dist: xarray>=2026.4.0
Requires-Dist: zarr>=3.2.1
Requires-Dist: mkdocstrings[python]>=1.0.4 ; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.21.3 ; extra == 'docs'
Requires-Dist: zensical>=0.0.42 ; extra == 'docs'
Requires-Python: >=3.12
Project-URL: Homepage, https://jararias.github.io/sparta-solar
Project-URL: Documentation, https://jararias.github.io/sparta-solar
Project-URL: Repository, https://github.com/jararias/sparta-solar
Project-URL: Bug Tracker, https://github.com/jararias/sparta-solar/issues
Project-URL: Changelog, https://github.com/jararias/sparta-solar/blob/main/CHANGELOG.md
Provides-Extra: docs
Description-Content-Type: text/markdown


<p align="center">
<img src="https://raw.githubusercontent.com/jararias/sparta-solar/main/docs/images/sunny-helmet-black-transparent-recortada.png" alt="logo" width="50%">
</p>

# sparta-solar: Clear-sky Solar Irradiance with the SPARTA Radiative Transfer Model

![Python Version](https://img.shields.io/badge/python-3.12%2B-blue)
![Tests](https://raw.githubusercontent.com/jararias/sparta-solar/main/docs/images/tests-badge.svg)
![Coverage](https://raw.githubusercontent.com/jararias/sparta-solar/main/docs/images/coverage-badge.svg)
[![License](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)

A Python library to compute clear-sky solar irradiance at the ground surface using the _Solar PArameterization of the Radiative Transfer of the Atmosphere_ ([SPARTA](http://hdl.handle.net/10630/28011)) radiative transfer model, with built-in access to multiple atmospheric databases (Copernicus [CAMS Radiative Service](https://confluence.ecmwf.int/display/CKB/CAMS+solar+radiation+time-series%3A+data+documentation) via [SODA](https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info), hourly NASA [MERRA-2](https://gmao.gsfc.nasa.gov/gmao-products/merra-2/) data via [Google Earth Engine](https://developers.google.com/earth-engine/datasets/catalog/NASA_GSFC_MERRA_aer_2?hl=es-419), and a daily dataset curated and maintained as part of the sparta-solar library on a dedicated Hugging Face [dataset](https://huggingface.co/datasets/josearuizarias/merra2-daily-clearsky)).

---

## Quick install

```bash
pip install sparta-solar
```

or with [uv](https://docs.astral.sh/uv/):

```bash
uv add sparta-solar
```

## Quick examples

At individual sites:

```python
import pandas as pd
from spartasolar.atmosphere import merra2_daily

times  = pd.date_range("2020-06-15", periods=24, freq="h")
atmos  = merra2_daily.at_sites(
    times=times,
    latitude=36.72,  # or a sequence of latitudes...
    longitude=-4.42)  # ... and longitudes
result = atmos.compute()
print(result)
```

On a regular spatial grid:

```python
lats = np.arange(-60, 60.1, 1)
lons = np.arange(-90, 90.1, 1)
atmos  = merra2_daily.on_regular_grid(
    times=times,
    latitude=lats,
    longitude=lons)
result = atmos.compute()
print(result)
```


## Documentation

Full documentation — installation guide, user guide, quick reference, and API reference — is available at **<https://jararias.github.io/sparta-solar>**

## Citation

```bibtex
@article{ruizarias2023sparta,
  author  = {Ruiz-Arias, Jose A.},
  title   = {{SPARTA}: Solar parameterization for the radiative transfer of the cloudless atmosphere},
  journal = {Renewable and Sustainable Energy Reviews},
  volume  = {188},
  pages   = {113833},
  year    = {2023},
  doi     = {10.1016/j.rser.2023.113833}
}
```

## License

[CC BY-NC-SA 4.0](LICENSE) — free for non-commercial use with attribution.
