Skip to content

Commit

Permalink
Fix for HITRAN IO (#853)
Browse files Browse the repository at this point in the history
This fixes some parts of how Hitran was read in ARTS 3. We cannot rely
on all coefficients coming from the same source, so must derive the
necessary ones instead from the same source.

Also changes AbsorptionBands to be a map to make some data manipulation
a lot easier to deal with.
  • Loading branch information
riclarsson authored Oct 28, 2024
2 parents e364436 + cf5a325 commit f5fd6ed
Show file tree
Hide file tree
Showing 69 changed files with 6,886 additions and 7,067 deletions.
2 changes: 1 addition & 1 deletion examples/arts-catalogue-data/cia/cia.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
set so that our automatic agenda routine can do its work
"""
ws.absorption_bands = []
ws.absorption_bands = {}

"""
Expand Down
25 changes: 20 additions & 5 deletions examples/arts-catalogue-data/lines/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,16 @@
"""

ws.jacobian_targets = pyarts.arts.JacobianTargets()
ws.frequency_grid = np.linspace(40e9, 120e9, 1001) # Frequencies between 40 and 120 GHz
ws.frequency_grid = np.linspace(
40e9, 120e9, 11
) # Frequencies between 40 and 120 GHz
ws.ray_path_point # No particular POSLOS
ws.atmospheric_pointInit()
ws.atmospheric_point.temperature = 295 # At room temperature
ws.atmospheric_point.pressure = 1e5 # At 1 bar
ws.atmospheric_point[ws.absorption_species[0]] = 0.21 # At 21% atmospheric Oxygen
ws.atmospheric_point[ws.absorption_species[0]] = (
0.21 # At 21% atmospheric Oxygen
)

# Call the agenda with inputs above
ws.propagation_matrix_agendaExecute()
Expand All @@ -163,8 +167,19 @@
# ws.propagation_matrix.savexml("lines_test_result.xml", type="ascii")

# test that we are still OK
propagation_matrix_agenda = \
pyarts.arts.PropmatVector.fromxml("lines_test_result.xml")
assert np.allclose(
propagation_matrix_agenda, ws.propagation_matrix
[
8.92664373e-06,
2.88107577e-05,
1.55470464e-03,
1.55360514e-03,
5.57640699e-05,
2.51926728e-05,
1.72272988e-05,
1.43453057e-05,
1.46251762e-05,
2.71389841e-05,
1.97382384e-04,
],
ws.propagation_matrix[:, 0],
), "O2 Absorption has changed"
Loading

0 comments on commit f5fd6ed

Please sign in to comment.