pyharp-dump CLI
pyharp-dump writes spectroscopy products as NetCDF files. It supports
single-species molecular products, CIA pair products, and gas-mixture
products built from HITRAN line data plus CIA data from either HITRAN or the
legacy Orton/Xiz H2 tables.
Basic Usage
Choose one subcommand, then choose the target with --species, --pair,
or --composition where supported.
pyharp-dump xsection --species H2O --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
pyharp-dump xsection --pair H2-He --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
pyharp-dump xsection --pair H2-H2 --cia-model xiz --h2-state eq --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
pyharp-dump transmission --composition H2:0.9,He:0.1,H2O:0.002 --path-length-km 1 --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
Without --output, files are written under --output-dir using names
derived from the target, product type, pressure, temperature, and wavenumber
range. Generated names end with cm1 to indicate wavenumber bounds in
cm^-1. For state-grid dumps, the state portion of the filename is
<min_temp>_<max_temp>K_<min_pres>_<max_pres>bar.
Subcommands
xsection
Write absorption cross-section products.
Supported selectors:
--speciesfor a molecular absorber--pairfor a CIA pair--compositionfor a gas mixture
Examples:
pyharp-dump xsection --species CO2 --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
pyharp-dump xsection --pair H2-He --temperature-k 300 --pressure-bar 1 --wn-range=20,10000
pyharp-dump xsection --pair H2-H2 --cia-model 2018 --h2-state nm --temperature-k 300 --pressure-bar 1 --wn-range=20,10000
pyharp-dump xsection --composition H2:0.9,He:0.1,CH4:0.004,H2O:0.002 --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
transmission
Write transmission products over a fixed path length.
Supported selectors:
--speciesfor a molecular absorber--pairfor a CIA pair--compositionfor a gas mixture
Examples:
pyharp-dump transmission --species H2O --path-length-km 1 --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
pyharp-dump transmission --pair H2-He --path-length-km 1 --temperature-k 300 --pressure-bar 1 --wn-range=20,10000
pyharp-dump transmission --pair H2-H2 --cia-model orton --h2-state eq --path-length-km 1 --temperature-k 300 --pressure-bar 1 --wn-range=20,10000
pyharp-dump transmission --composition H2:0.9,He:0.1,H2O:0.002 --path-length-km 1 --temperature-k 300 --pressure-bar 1 --wn-range=20,2500
Target Selection
Use --species for HITRAN line species such as CH4, CO2, H2,
H2O, H2S, N2, and NH3.
Use --pair for CIA pairs such as H2-H2 and H2-He.
For pair workflows, --cia-model determines both the backend and the file
family:
--cia-model autouses the built-in HITRAN default filename mapping--cia-model 2011resolvesH2-H2_2011.ciaorH2-He_2011.cia--cia-model 2018 --h2-state eq|nmresolvesH2-H2_eq_2018.ciaorH2-H2_nm_2018.cia--cia-model xiz|orton --h2-state eq|nmresolves one of the downloaded legacy H2 tables
If a requested HITRAN pair/model/state combination has no configured file, pyharp raises an error instead of silently falling back to another CIA file.
Use --composition for gas mixtures:
--composition H2:0.9,He:0.1,CH4:0.004,H2O:0.002,NH3:0.0003
Broadening Behavior
If --broadening-composition is omitted for single-species molecular
products, pyharp defaults to self broadening. For mixture workflows,
pyharp defaults to the mixture composition itself as the requested line
broadening composition.
If a requested foreign broadener is not available in the HITRAN table for the
active absorber, pyharp falls back to air for that fraction and prints the
effective broadening summary.
H2O MT_CKD continuum components
For H2O xsection products, pyharp-dump stores the MT_CKD self and
foreign continua as two separate fields:
sigma_continuum_h2o_self_mt_ckdsigma_continuum_h2o_foreign_mt_ckd
Both fields have units of cm^2 molecule^-1 and contain the corresponding
unit-VMR MT_CKD component. They are not multiplied by the H2O mole fraction in
the NetCDF file. No additional CLI option is required: the split fields are
written automatically for both --species H2O and any --composition
that contains H2O.
Keeping the two fields separate allows one opacity table to be reused for
different atmospheric compositions. At run time, MoleculeLine calculates
the local H2O volume mixing ratio from the concentration tensor and forms
The continuum attenuation is then the composition-weighted continuum cross
section multiplied by the H2O number density. In other words, self and
foreign describe the collision partner of an absorbing H2O molecule; they
are not two additional atmospheric species.
The --broadening-composition option controls HITRAN line broadening only.
It does not pre-weight these continuum fields. For a single-species
--species H2O calculation, the diagnostic sigma_total corresponds to
pure H2O. For --composition, sigma_total is evaluated using the
requested mixture, while the two component fields remain unweighted so they
can be used later with a different composition.
New MoleculeLine readers require both split fields when either one is
present. They also remain compatible with an older table containing only
sigma_continuum_h2o_mt_ckd; that legacy combined field is used directly
and cannot be reweighted for a different H2O abundance. Conversely, an older
reader that only recognizes the combined field cannot use a newly generated
split-continuum table.
Multi-band Output
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 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.
Auto-generated filenames follow the pattern
<target>_<product>_<min_temp>_<max_temp>K_<min_pres>_<max_pres>bar_<wnmin>_<wnmax>cm1.
State Grid Output
Dump products are always written on the dimensions
(del_temperature, pressure, wavenumber). The pressure coordinate
stores the paired --pressure-bar values converted to Pa,
del_temperature stores the requested anomalies, and the temperature
data variable has dimensions (pressure,) with the base temperatures from
--temperature-k.
Even a single (temperature, pressure) pair is written with degenerate
del_temperature and pressure dimensions of length one.
Parallel execution is flattened across all requested
wn_range × pressure × del_temperature jobs.
NetCDF Naming Conventions
The dump CLI uses semantic field names and stores physical units in variable attributes rather than in variable names.
Xsection outputs
Single-species xsection dumps use names such as:
sigma_line_h2osigma_continuum_h2o_self_mt_ckdsigma_continuum_h2o_foreign_mt_ckdsigma_cia_h2o_h2obinary_absorption_coefficient_h2o_h2osigma_total
The two split MT_CKD fields contain unit-VMR self and foreign components.
MoleculeLine weights them at runtime by xH2O and 1 - xH2O as
described in H2O MT_CKD continuum components.
Pair xsection dumps use:
binary_absorption_coefficient
Composition xsection dumps contain one file with multiple component fields:
sigma_line_<species>for unweighted line cross sectionssigma_continuum_h2o_self_mt_ckdandsigma_continuum_h2o_foreign_mt_ckdfor unit-VMR H2O continuum components, weighted byMoleculeLineat runtimebinary_absorption_coefficient_<pair>for unweighted CIA binary coefficientssigma_totalfor the composition-weighted total cross section
For composition xsection dumps, component fields are not weighted by mole
fraction. Only sigma_total represents the weighted mixture result.
Transmission outputs
Transmission dumps follow the same component naming pattern and add weighted
attenuation coefficients in m^-1.
Examples:
transmittance_line_h2oattenuation_line_h2otransmittance_continuum_h2o_mt_ckdattenuation_continuum_h2o_mt_ckdtransmittance_cia_h2_heattenuation_cia_h2_hetransmittance_totalattenuation_total
Unlike xsection output, a transmission product has already been
evaluated for the selected species or composition and path length. Its H2O
continuum variables therefore contain the combined, composition-weighted
self-plus-foreign continuum and retain the unsplit
*_continuum_h2o_mt_ckd names. They are diagnostic transmission products,
not reusable MoleculeLine opacity-table inputs.
Global Attributes
Species and pair dumps include species_name plus the thermodynamic state.
Composition dumps include both:
composition_inputwith the original input stringspecies_nameas a plain comma-separated species list such asH2,He,CH4,H2O,NH3
Examples
Single-species xsection with custom broadening:
pyharp-dump xsection \
--species H2O \
--temperature-k 300 \
--pressure-bar 1 \
--broadening-composition H2:0.9,He:0.1 \
--wn-range=20,2500
Multi-band xsection in one run:
pyharp-dump xsection \
--species H2O \
--temperature-k 300 \
--pressure-bar 1 \
--wn-range=20,2500 \
--wn-range=2500,10000
Paired state grid with temperature anomalies:
pyharp-dump xsection \
--species H2O \
--temperature-k 300,400 \
--pressure-bar 1,10 \
--del-temperature-k -10,-5,0,5,10 \
--wn-range=20,2500
Composition transmission dump:
pyharp-dump transmission \
--composition H2:0.9,He:0.1,CH4:0.004,H2O:0.002 \
--path-length-km 1 \
--temperature-k 300 \
--pressure-bar 1 \
--wn-range=20,2500