Low-level parse API

These functions are the building blocks that load_isotopologue calls internally. They are exported for users who need fine-grained control — for example, reading a single states file without loading transitions, or building a custom loading pipeline.

Definition file

ExoMol.read_def_file — Function
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.
source

States file

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 .states or .states.bz2 file.
  • def: Optional dataset definition as returned by read_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.
source

Transitions file

ExoMol.read_trans_file — Function
read_trans_file(filename)

Read an ExoMol .trans or .trans.bz2 file and return its transition records.

Each line holds whitespace-separated columns upper_id lower_id A [wavenumber]. Column widths differ between datasets, so fields are located by whitespace rather than fixed byte positions. The wavenumber column is optional in the ExoMol format; when it is absent the wavenumber is stored as 0.0 (and load_isotopologue recovers it from the states). The file is read line by line, so memory use does not grow with the file size beyond the returned vector.

Arguments

  • filename::AbstractString: Path to a .trans or .trans.bz2 file.

Returns

  • Vector{Transition}: Parsed transition records.
source

Broadening file

ExoMol.read_broad_file — Function
read_broad_file(filename)

Read an ExoMol .broad file and return its records.

Each line has the fixed columns code gamma_L n_air followed by zero, one, or two optional quantum-number columns. Missing quantum numbers are stored as NaN.

Arguments

  • filename::AbstractString: Path to the .broad file.

Returns

  • Vector{BroadeningLine}: Parsed broadening records.
source