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.IsotopologueExoMol.TransitionExoMol.get_exomol_datasetExoMol.get_exomol_masterExoMol.get_exomol_master_fileExoMol.load_isotopologueExoMol.load_isotopologueExoMol.parse_exomol_masterExoMol.read_def_fileExoMol.read_state_fileExoMol.read_trans_file
ExoMol.Isotopologue — Type
Isotopologue(definitions, states, transitions)Composite type holding all data associated with an ExoMol isotopologue.
Fields
definitions::Dict: Dataset definition metadata.states::Vector: Parsed molecular states (typicallyNamedTuples).transitions::Vector{Transition}: Transition catalogue.
ExoMol.Transition — Type
Transition(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 — Method
get_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 — Method
get_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 — Method
get_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.jsonfile.
This function is primarily intended to be used internally. For direct access to the parsed catalogue use get_exomol_master.
ExoMol.load_isotopologue — Method
load_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 — Method
load_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 — Method
parse_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 — Method
read_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 — Function
read_state_file(filename[, def])Read an ExoMol .states file and return the parsed state records.
Arguments
filename::AbstractString: Path to a.statesor.states.bz2file.def: Optional dataset definition as returned byread_def_file. When omitted the function looks for a sibling.def.jsonfile.
Returns
Vector{NamedTuple}: State records with field names and types inferred from the dataset definition.
ExoMol.read_trans_file — Method
read_trans_file(filename)Read an ExoMol .trans file and return the transitions contained in it.
Arguments
filename::AbstractString: Path to a.transor.trans.bz2file.
Returns
Vector{Transition}: Parsed transition records.