Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ output

# cache
*__pycache__*

# release/debug
*.release
*.debug
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ written on `(del_temperature, pressure, wavenumber)`, include a
`pressure` coordinate in Pa, and still retain
degenerate `del_temperature` and `pressure` dimensions when only one state is
requested.
Across `pyharp.spectra`, wavenumber ranges are interpreted as
lower-inclusive and upper-exclusive: `--wn-range=20,22` with `1 cm^-1`
resolution samples `20` and `21`, not `22`.
Across `pyharp.spectra`, wavenumber ranges are interpreted as inclusive at
both ends: `--wn-range=20,22` with `1 cm^-1` resolution samples `20`, `21`,
and `22`.
See the [pyharp-dump CLI documentation](https://pyharp.readthedocs.io/en/latest/dump_cli.html)
for the full command reference, output naming conventions, and NetCDF schema.

Expand All @@ -133,10 +133,11 @@ pyharp-plot overview --species H2O CO2 --temperature-k 300 --pressure-bar 1 --wn
Use `--pair` for CIA pairs, `--species` for molecules, and `--composition`
for gas mixtures such as `H2O:0.1,H2:0.9`. All plot commands accept
`--wn-range=min,max`; `overview` accepts multiple `--wn-range` values for
multi-page PDFs. These ranges are lower-inclusive and upper-exclusive. Use
`--output` to choose the output path. Without `--output`, plots are written
under `--output-dir` (default `output/`) with names derived from the target,
plot type, temperature, pressure, and wavenumber range.
multi-page PDFs. These ranges include both endpoints, so adjacent repeated
ranges such as `20,2500` and `2500,10000` both include `2500`. Use `--output`
to choose the output path. Without `--output`, plots are written under
`--output-dir` (default `output/`) with names derived from the target, plot
type, temperature, pressure, and wavenumber range.
For plot commands that use pressure, `--temperature-k` and `--pressure-bar`
also accept matched comma-separated vectors such as
`--temperature-k 300,400 --pressure-bar 1,10`. `pyharp-plot` then runs one
Expand Down
10 changes: 10 additions & 0 deletions docs/source/builtin_opacities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ The following functions have been used to process the legacy CIA data files:
:undoc-members:
:imported-members:

NetCDF dump-backed molecular opacities
--------------------------------------

Pyharp also supports NetCDF dump-backed molecular absorption through the
``molecule-line`` and ``cia`` opacity types. These readers consume
cross-section fields on ``(del_temperature, pressure, wavenumber)`` or any
equivalent variable-dimension ordering, convert them into the runtime units
used by the C++ radiative-transfer core, and interpolate on the requested
band grid.

References
----------
.. [1] Lupu, R., et al. "Correlated k coefficients for H2-He atmospheres; 196 spectral windows and 1460 pressure-temperature points." Zenodo, doi 0.5281/zenodo.5590988 (2021).
Expand Down
8 changes: 4 additions & 4 deletions docs/source/dump_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ Shared Options
Wavenumber bounds in ``cm^-1``. Repeat this option to write one NetCDF
file per band. When ``--output`` is provided with multiple ranges,
pyharp appends ``_<wnmin>_<wnmax>`` to the requested stem. Ranges are
lower-inclusive and upper-exclusive, so ``--wn-range=20,22`` with
``--resolution 1`` samples ``20`` and ``21``.
inclusive at both ends, so ``--wn-range=20,22`` with ``--resolution 1``
samples ``20``, ``21``, and ``22``.

``--resolution value``
Wavenumber spacing in ``cm^-1``. The default is ``1``.
Expand Down Expand Up @@ -177,8 +177,8 @@ Repeat ``--wn-range`` to compute multiple bands in one run:
pyharp-dump xsection --species H2O --temperature-k 300 --pressure-bar 1 \
--wn-range=20,2500 --wn-range=2500,10000

This writes one file for ``[20, 2500)`` and one file for ``[2500, 10000)``.
Adjacent repeated ranges do not duplicate the boundary sample. If
This writes one file for ``[20, 2500]`` and one file for ``[2500, 10000]``.
Adjacent repeated ranges duplicate the shared boundary sample. If
``--output output/h2o.nc`` is provided, the generated files are
``output/h2o_20_2500.nc`` and ``output/h2o_2500_10000.nc``.

Expand Down
15 changes: 11 additions & 4 deletions docs/source/opacity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ A complete list of built-in opacity types is given in the table below.
* - 'jit'
- '.pt' (saved by :func:`torch.jit.save` or :func:`pyharp.compile`)
- Just-In-Time scripted opacity model
* - 'rfm-lbl'
* - 'molecule-line'
- NetCDF
- Line-by-line absorption data computed by RFM
* - 'rfm-ck'
- Molecular line cross sections on ``(wavenumber, pressure, del_temperature)`` with optional same-species continuum fields
* - 'molecule-cia'
- NetCDF
- Correlated-k absorption computed from line-by-line data
- Collision-induced absorption binary coefficients on ``(wavenumber, pressure, del_temperature)``
* - 'multiband-ck'
- '.pt' (saved by :func:`torch.jit.save`)
- Three-dimensional correlated-k opacity lookup table. The axis are
Expand All @@ -52,6 +52,13 @@ A complete list of built-in opacity types is given in the table below.

We give a few examples showing how to use these opacity class to load and compute optical properties.

The NetCDF dump-backed molecular opacities expect the coordinate variables
``wavenumber``, ``pressure``, ``del_temperature``, and ``temperature``.
Line opacity variables follow the naming convention ``sigma_line_<species>``.
Optional same-species continuum terms use ``sigma_continuum_<species>_*`` and
are summed into the line attenuation automatically. CIA variables use
``binary_absorption_coefficient_<species_a>_<species_b>``.

.. _example_sonora:

Example 1. Compute Sonora2020 molecular opacities
Expand Down
5 changes: 4 additions & 1 deletion docs/source/opacity_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Opacity Classes
.. autoclass:: pyharp.opacity.WaveTemp
:members: __init__, forward

.. autoclass:: pyharp.opacity.RFM
.. autoclass:: pyharp.opacity.MoleculeLine
:members: __init__, forward

.. autoclass:: pyharp.opacity.MoleculeCIA
:members: __init__, forward

.. autoclass:: pyharp.opacity.JITOpacity
Expand Down
4 changes: 2 additions & 2 deletions docs/source/plot_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Shared Options
Wavenumber bounds in ``cm^-1``. CIA plots default to ``20,10000`` when it
is omitted. Molecular and mixture plots default to ``20,2500``. The
``overview`` subcommand accepts this option more than once. Ranges are
lower-inclusive and upper-exclusive, so ``--wn-range=20,22`` with
``--resolution 1`` samples ``20`` and ``21``.
inclusive at both ends, so ``--wn-range=20,22`` with ``--resolution 1``
samples ``20``, ``21``, and ``22``.

``--resolution value``
Wavenumber grid spacing in ``cm^-1``. The default is ``1``.
Expand Down
12 changes: 0 additions & 12 deletions examples/2025-amars/CMakeLists.txt

This file was deleted.

40 changes: 0 additions & 40 deletions examples/2025-amars/TVals.txt

This file was deleted.

Loading
Loading