ExoMol
ExoMol.jl
provides convenience wrappers for downloading ExoMol line lists and turning them into Julia-friendly structures. It handles fetching datasets as artifacts, parsing the associated definition files and reading the compressed state and transition catalogues.
Getting started
using ExoMol
# Retrieve the master catalogue that lists all available molecules
master = get_exomol_master()
# Load a dataset and inspect its contents
iso = load_isotopologue("CO", "12C-16O", "Li2015")
@info "Loaded $(length(iso.states)) states" first(iso.states)
@info "Loaded $(length(iso.transitions)) transitions"
The Isotopologue
struct bundles the dataset definition, states and transitions. See the API reference below for detailed descriptions of the helper functions involved in constructing it.
Reference
ExoMol.Isotopologue
ExoMol.Transition
ExoMol.get_exomol_dataset
ExoMol.get_exomol_master
ExoMol.get_exomol_master_file
ExoMol.load_isotopologue
ExoMol.load_isotopologue
ExoMol.parse_exomol_master
ExoMol.read_def_file
ExoMol.read_state_file
ExoMol.read_trans_file
ExoMol.Isotopologue
— TypeIsotopologue(definitions, states, transitions)
Composite type holding all data associated with an ExoMol isotopologue.
Fields
definitions::Dict
: Dataset definition metadata.states::Vector
: Parsed molecular states (typicallyNamedTuple
s).transitions::Vector{Transition}
: Transition catalogue.
ExoMol.Transition
— TypeTransition(upper_id, lower_id, A, wavenumber)
Container holding a single transition from an ExoMol .trans
file.
Fields
upper_id::Int
: Identifier of the upper energy level.lower_id::Int
: Identifier of the lower energy level.A::Float64
: Einstein A coefficient (s⁻¹).wavenumber::Float64
: Transition wavenumber (cm⁻¹).
ExoMol.get_exomol_dataset
— Methodget_exomol_dataset(molecule, isotopologue, dataset; force=false, verbose=false)
Download a specific ExoMol dataset and cache it as an artifact.
Arguments
molecule
: Molecular formula (e.g."H2O"
).isotopologue
: Isotopologue identifier as used by ExoMol (e.g."1H2-16O"
).dataset
: Dataset label (e.g."POKAZATEL"
).force::Bool=false
: Re-download the dataset even if it already exists in the artifact cache.verbose::Bool=false
: Forward verbose output toDownloads.download
.
Returns
String
: Path to the local artifact directory that contains the dataset definition and accompanying data files.
The returned directory contains at least the .def.json
, .states.bz2
and .trans.bz2
files required to load the dataset into Julia using load_isotopologue
.
ExoMol.get_exomol_master
— Methodget_exomol_master(; force=false)
Retrieve the ExoMol master catalogue as a parsed JSON object.
Arguments
force::Bool=false
: Re-download the catalogue even if it already exists in the artifact cache.
Returns
Dict{String,Any}
: Parsed contents of the ExoMol master catalogue.
ExoMol.get_exomol_master_file
— Methodget_exomol_master_file(; force=false)
Download the ExoMol master catalogue as an artifact and return its local path.
Arguments
force::Bool=false
: Re-download the catalogue even if it already exists in the artifact cache.
Returns
String
: Absolute path to the downloadedexomol.all.json
file.
This function is primarily intended to be used internally. For direct access to the parsed catalogue use get_exomol_master
.
ExoMol.load_isotopologue
— Methodload_isotopologue(molecule, isotopologue, dataset)
Convenience method that downloads an ExoMol dataset (if necessary) and loads it into an Isotopologue
struct.
Arguments
molecule
: Molecular formula (e.g."H2O"
).isotopologue
: ExoMol isotopologue identifier.dataset
: Dataset label.
Returns
Isotopologue
: Parsed isotopologue data ready for analysis.
ExoMol.load_isotopologue
— Methodload_isotopologue(folder)
Load an isotopologue from a directory containing ExoMol dataset files.
Arguments
folder::AbstractString
: Directory holding.def.json
,.states*
and.trans*
files belonging to an ExoMol dataset.
Returns
Isotopologue
: Parsed isotopologue data ready for analysis.
ExoMol.parse_exomol_master
— Methodparse_exomol_master(filepath::String)
Parse the ExoMol master file and return structured data.
Arguments
filepath::String
: Path to the master file (JSON format)
Returns
- Returns the parsed JSON structure
Examples
master_path = download_exomol_master()
data = parse_exomol_master(master_path)
ExoMol.read_def_file
— Methodread_def_file(filename)
Parse an ExoMol dataset definition (.def.json
) file.
Arguments
filename::AbstractString
: Path to the definition file. Compressed files are not supported and the filename must end in.json
.
Returns
Dict{String,Any}
: Parsed JSON data structure describing the dataset.
ExoMol.read_state_file
— Functionread_state_file(filename[, def])
Read an ExoMol .states
file and return the parsed state records.
Arguments
filename::AbstractString
: Path to a.states
or.states.bz2
file.def
: Optional dataset definition as returned byread_def_file
. When omitted the function looks for a sibling.def.json
file.
Returns
Vector{NamedTuple}
: State records with field names and types inferred from the dataset definition.
ExoMol.read_trans_file
— Methodread_trans_file(filename)
Read an ExoMol .trans
file and return the transitions contained in it.
Arguments
filename::AbstractString
: Path to a.trans
or.trans.bz2
file.
Returns
Vector{Transition}
: Parsed transition records.