Database Downloading¶
PyExoCross provides a built-in Python API for downloading molecular and atomic data from external databases, including ExoMol, ExoAtom, ExoMolHR, and HITRAN.
Python API Usage¶
All database downloads are handled through the main function pyexocross.download().
import pyexocross as px
px.download(database, file_path=None, **kwargs)
Common Parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
Yes |
Database name: |
|
|
Yes |
Folder where the downloaded files will be saved, can also use |
|
|
Yes |
Molecule/isotopologue or atom configuration dict |
|
|
yes |
If |
|
|
Optional |
Filter transitions by wavenumber range (cm⁻¹). |
|
|
Optional |
Temperature in Kelvin. |
|
|
Optional |
Minimum line intensity threshold in cm/molecule. |
|
|
Optional |
The dataset to use. Can be either |
Species Configuration Details (species_info)¶
The dictionary structure for species_info allows you to customize the files to be downloaded. You can specify parameters such as:
wn_range(list of two floats:[wn_min, wn_max]): Filter transition files by wavenumber range (in cm⁻¹).ExoMol: Used to download only the segmented transition files (
.trans.bz2) that fall completely within the requested range.HITRAN / ExoMolHR: Used to query and download the line transitions matching this specific range.
Tortemperature(int): Temperature (in Kelvin) for fetching temperature-dependent high-resolution datasets.ExoMolHR: Required for online query-based CSV download.
thresholdorSmin(float): The minimum line intensity threshold (in cm/molecule).ExoMolHR: Required for online query-based CSV download to filter weak lines.
dataset(str): The dataset to use. Required for ExoAtom downloads.ExoAtom: Can be either
'NIST'(critically evaluated and recommended for accuracy) or'Kurucz'(recommended for completeness).
Database |
Required Parameters |
Optional Parameters |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
1. ExoMol Database (database='ExoMol')¶
Downloads line lists, states, transition files, and partition functions from the ExoMol database.
Example¶
px.download(
database='ExoMol',
file_path='/path/to/ExoMol/',
species_info={
'MgH': {
'24Mg-1H': {'wn_range': None},
'25Mg-1H': {'wn_range': None},
},
'H2O': {
'1H2-16O': {'wn_range': [41000, 41200]},
},
},
download=True,
)
2. ExoMolHR Database (database='ExoMolHR')¶
Downloads high-resolution line lists and partition functions. It queries the server for a dynamically calculated CSV file based on your specified temperature (T), wavenumber range (wn_range), and intensity threshold (threshold).
Example¶
px.download(
database='ExoMolHR',
file_path='/path/to/ExoMolHR/',
species_info={
'MgH': {
'24Mg-1H': {'T': 1000, 'wn_range': [0, 500], 'threshold': 1e-30},
'25Mg-1H': None,
},
'AlH': {
'27Al-1H': {'T': 500, 'wn_range': [0, 500], 'threshold': 1e-30}
},
},
download=True,
)
3. ExoAtom Database (database='ExoAtom')¶
Downloads atomic transitions and energy levels from the NIST or Kurucz databases using the ExoAtom configuration.
Example¶
px.download(
database='ExoAtom',
file_path='/path/to/ExoAtom/',
species_info={
'He': {'dataset': 'NIST'},
'He_p': {'3He_p': {'dataset': 'NIST'}},
'Ar_p': {'dataset': 'Kurucz'},
},
download=True,
)
4. HITRAN Database (database='HITRAN')¶
Downloads line-by-line spectroscopic data and partition functions directly from the HITRAN database via the HITRANonline API.
Example¶
px.download(
database='HITRAN',
file_path='/path/to/HITRAN/',
species_info={
'NO': {
'14N-16O': {'wn_range': [0, 100]},
'15N-16O': {'wn_range': [100, 150]},
},
'H2O': {
'1H2-16O': {'wn_range': [100, 110]},
},
},
download=True,
)
Generating URLs Only¶
If you only want to generate the list of URLs to be downloaded later, set download=False:
px.download(
database='ExoMol',
file_path='/path/to/ExoMol/',
species_info={'MgH': {'24Mg-1H': None}},
download=False,
)
This will save the URLs to /path/to/ExoMol/url/exomol__urls.txt and print them to the console.