Skip to content

Commit

Permalink
Add download_hitemp files
Browse files Browse the repository at this point in the history
Fixes #625
  • Loading branch information
erwanp authored Aug 12, 2022
1 parent f52e33d commit dc6a04f
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/download_hitemp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
"""
Download HITEMP database, parse & cache them, to make sure the example notebooks run fast
"""

from radis.test.utils import setup_test_line_databases
from radis.io.hitemp import fetch_hitemp

setup_test_line_databases() # init radis.json etc if needed

# Download other species
for molecule in ["OH", "CO", "NO", "NO2"]:
print("Downloading and caching ", molecule)
fetch_hitemp(molecule, isotope='1', # only 1 HITEMP file so all isotopes are downloaded anyway
load_wavenum_min=2000, # keep memory usage low. only 1 HITEMP file so everything is downloaded anyway
load_wavenum_max=5000,
verbose=3)

# Not downloaded because to big for Binder / GESIS : CH4, N2O (we could actually try N2O)

# Downloaded and computed separately: CO2, H2O
15 changes: 15 additions & 0 deletions server/download_hitemp_CO2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
"""
Download HITEMP CO2 database, parse & cache them, to make sure the example notebooks run fast
"""

from radis.test.utils import setup_test_line_databases
from radis.io.hitemp import fetch_hitemp

setup_test_line_databases() # init radis.json etc if needed

for (wmin, wmax) in [(k+50, k+1050) for k in range(0, 10000, 1000)]:
fetch_hitemp("CO2", isotope='1', # only 1 HITEMP file so all isotopes are downloaded anyway
load_wavenum_min=wmin,
load_wavenum_max=wmax,
verbose=3)
48 changes: 48 additions & 0 deletions server/download_hitemp_H2O.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
"""
Download HITEMP H2O database, parse & cache them, to make sure the example notebooks run fast
"""

from radis.test.utils import setup_test_line_databases
from radis.io.hitemp import fetch_hitemp

setup_test_line_databases() # init radis.json etc if needed

for (wmin, wmax) in [(0, 50),
(50, 150),
(150, 250),
(250, 350),
(350, 500),
(500, 600),
(600, 700),
(700, 800),
(800, 900),
(900, 1000),
(1000, 1150),
(1150, 1300),
(1300, 1500),
(1500, 1750),
(1750, 2000),
(2000, 2250),
(2250, 2500),
(2500, 2750),
(2750, 3000),
(3000, 3250),
(3250, 3500),
(3500, 4150),
(4150, 4500),
(4500, 5000),
(5000, 5500),
(5500, 6000),
(6000, 6500),
(6500, 7000),
(7000, 7500),
(7500, 8000),
(8000, 8500),
(8500, 9000),
(9000, 11000),
(11000, 30000)]:
fetch_hitemp("H2O", isotope='1', # only 1 HITEMP file so all isotopes are downloaded anyway
load_wavenum_min=wmin,
load_wavenum_max=wmax,
verbose=3)

0 comments on commit dc6a04f

Please sign in to comment.