Examples

This page contains complete, ready-to-run examples for every supported database and function. Replace the paths with your own data locations.

CPU / GPU kwargs you can reuse

# CPU (default)
COMPUTE_CPU = dict(
    ncputrans=4,
    ncpufiles=1,
    chunk_size=100000,
    run_mode='CPU',
)

# GPU (AUTO backend, recommended)
COMPUTE_GPU_AUTO = dict(
    ncputrans=4,
    ncpufiles=1,
    chunk_size=100000,
    run_mode='GPU',
    gpu_backend='AUTO',      # PyTorch-CUDA -> CuPy-CUDA -> MPS -> CPU fallback
    gpu_batch_lines=8192,    # memory-control knob
    gpu_batch_grid=256,      # memory-control knob
)

# GPU (CUDA policy: PyTorch-CUDA -> CuPy-CUDA -> MPS -> CPU fallback)
COMPUTE_GPU_CUDA = dict(
    run_mode='GPU',
    gpu_backend='CUDA',
    gpu_batch_lines=8192,
    gpu_batch_grid=256,
)

# GPU (force PyTorch CUDA only)
COMPUTE_GPU_TORCH = dict(
    run_mode='GPU',
    gpu_backend='PyTorch-CUDA',
    gpu_batch_lines=8192,
    gpu_batch_grid=256,
)

# GPU (force CuPy CUDA only)
COMPUTE_GPU_CUPY = dict(
    run_mode='GPU',
    gpu_backend='CuPy-CUDA',
    gpu_batch_lines=8192,
    gpu_batch_grid=256,
)

# GPU (force PyTorch MPS)
COMPUTE_GPU_MPS = dict(
    run_mode='GPU',
    gpu_backend='MPS',
    gpu_batch_lines=8192,
    gpu_batch_grid=256,
)

Use COMPUTE_GPU_AUTO with GPU-enabled functions:

px.cooling_functions(..., **COMPUTE_GPU_AUTO)
px.stick_spectra(..., **COMPUTE_GPU_AUTO)
px.cross_sections(..., **COMPUTE_GPU_AUTO)
px.stick_spectra_cross_section(..., **COMPUTE_GPU_AUTO)

ExoMol Examples

Conversion (ExoMol -> HITRAN)

import pyexocross as px

px.conversion(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    species_id=501,
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/', 
    logs_path='/path/to/output/log/exomol_conversion.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['+/-', 'e/f', 'ElecState', 'v', 'Lambda', 'Sigma', 'Omega'],
    qnsformat_list=['%1s', '%1s', '%12s', '%3d', '%3d', '%5.1f', '%5.1f'],
    conversion_format='HITRAN',
    conversion_min_freq=0,
    conversion_max_freq=30000,
    conversion_unc=0.01, 
    conversion_threshold=1e-30,
    global_qn_label_list=['ElecState', 'v', 'Omega'],
    global_qn_format_list=['%9s', '%2d', '%4s'],
    local_qn_label_list=['J', 'e/f'],
    local_qn_format_list=['%5.1f', '%2s']
)

Partition Functions

import pyexocross as px

px.partition_functions(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_pf.log',
    ntemp=1,
    tmax=5000
)

Specific Heats

import pyexocross as px

px.specific_heats(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_cp.log',
    ntemp=1,
    tmax=5000
)

Cooling Functions

import pyexocross as px

px.cooling_functions(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_cf.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    ntemp=1,
    tmax=5000
)

Lifetimes

import pyexocross as px

px.lifetimes(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_lifetime.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    compress=False
)

Oscillator Strengths

import pyexocross as px

px.oscillator_strengths(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_os.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    gf_or_f='f',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (LTE)

import pyexocross as px

px.stick_spectra(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_stick.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    temperatures=[1000, 2000],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (Non-LTE, Treanor Method)

import pyexocross as px

px.stick_spectra(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_stick_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['+/-', 'e/f', 'ElecState', 'v', 'Lambda', 'Sigma', 'Omega'],
    qnsformat_list=['%1s', '%1s', '%12s', '%3d', '%3d', '%5.1f', '%5.1f'],
    nlte_method='T',
    tvib_list=[1000, 2000, 3000],
    trot_list=[100, 200],
    vib_label=['v', 'ElecState'],
    rot_label=['J', 'e/f'],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    abs_emi='Ab',
    unc_filter=0.01,
    threshold=1e-30,
    qns_filter={
        '+/-': [],
        'e/f': [],
        'ElecState': [],
        'v': ['0,', '1,', '2,', '3,', '4,', ',0', ',1', ',2', ',3', ',4'],
    }
)

Cross Sections (LTE)

import pyexocross as px

px.cross_sections(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_xsec.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    temperatures=[1000, 2000, 3000],
    pressures=[1.0, 5.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    bin_size=0.1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    cutoff=25.0,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (Non-LTE, Treanor Method)

import pyexocross as px

px.cross_sections(
    database='ExoMol',
    molecule='MgH',
    isotopologue='24Mg-1H',
    dataset='XAB',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_xsec_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['+/-', 'e/f', 'ElecState', 'v', 'Lambda', 'Sigma', 'Omega'],
    qnsformat_list=['%1s', '%1s', '%12s', '%3d', '%3d', '%5.1f', '%5.1f'],
    nlte_method='T',
    tvib_list=[1000, 2000, 3000],
    trot_list=[100, 200],
    vib_label=['v', 'ElecState'],
    rot_label=['J', 'e/f'],
    pressures=[1.0, 5.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    bin_size=0.1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    cutoff=25.0,
    abs_emi='Em',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

ExoMolHR Examples

Conversion (ExoMolHR -> HITRAN)

import pyexocross as px

px.conversion(
    database='ExoMolHR',
    molecule='NO',
    isotopologue='14N-16O',
    species_id=81,
    read_path='/path/to/Databases/ExoMolHR/',
    save_path='/path/to/output/', 
    logs_path='/path/to/output/log/exomolhr_conversion.log',
    ncputrans=1,    
    ncpufiles=1,
    chunk_size=100000,
    conversion_format='HITRAN',
    conversion_min_freq=24,
    conversion_max_freq=53452,
    conversion_unc=0.01, 
    conversion_threshold=1e-30,
    global_qn_label_list=['ElecState', 'v', 'Omega'],
    global_qn_format_list=['%9s', '%2d', '%4s'],
    local_qn_label_list=['J', 'e/f'],
    local_qn_format_list=['%7.1f', '%1s']
)

Stick Spectra (LTE)

import pyexocross as px

px.stick_spectra(
    database='ExoMolHR',
    molecule='NO',
    isotopologue='14N-16O',
    read_path='/path/to/Databases/ExoMolHR/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomolhr_stick.log',
    ncputrans=1,    
    ncpufiles=1,
    chunk_size=100000,
    temperatures=[1000, 2000],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=24,
    max_range=53452,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (Non-LTE, Treanor Method)

import pyexocross as px

px.stick_spectra(
    database='ExoMolHR',
    molecule='NO',
    isotopologue='14N-16O',
    read_path='/path/to/Databases/ExoMolHR/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomolhr_stick_nlte.log',
    ncputrans=1,    
    ncpufiles=1,
    chunk_size=100000,
    nlte_method='T',
    tvib_list=[1000, 2000],
    trot_list=[296],
    vib_label=['v', 'ElecState'],
    rot_label=['J', 'e/f'],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=24,
    max_range=53452,
    abs_emi='Ab',
    unc_filter=0.01,
    threshold=1e-30,
    qns_filter={
        'e/f': [],
        'ElecState': [],
        'v': [],
    }
)

Cross Sections (LTE)

import pyexocross as px

px.cross_sections(
    database='ExoMolHR',
    molecule='NO',
    isotopologue='14N-16O',
    read_path='/path/to/Databases/ExoMolHR/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomolhr_xsec.log',
    ncputrans=1,    
    ncpufiles=1,
    chunk_size=100000,
    temperatures=[296, 3000],
    pressures=[1.0, 5.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=24,
    max_range=53452,
    bin_size=0.1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    alpha_hwhm=3.0,
    gamma_hwhm=None,
    cutoff=25.0,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (Non-LTE, Treanor Method)

import pyexocross as px

px.cross_sections(
    database='ExoMolHR',
    molecule='NO',
    isotopologue='14N-16O',
    read_path='/path/to/Databases/ExoMolHR/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomolhr_xsec_nlte.log',
    ncputrans=1,    
    ncpufiles=1,
    chunk_size=100000,
    nlte_method='T',
    tvib_list=[1000, 2000, 3000],
    trot_list=[100, 200],
    vib_label=['v', 'ElecState'],
    rot_label=['J', 'e/f'],
    pressures=[1.0, 5.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=24,
    max_range=53452,
    bin_size=0.1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    alpha_hwhm=3.0,
    gamma_hwhm=None,
    cutoff=25.0,
    abs_emi='Em',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

ExoAtom Examples

Conversion (ExoAtom -> HITRAN)

import pyexocross as px

px.conversion(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    species_id=601,
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['configuration', 'Multiple', 'parity'],
    qnsformat_list=['%20s', '%10s', '%2s'],
    conversion_format='HITRAN',
    conversion_min_freq=0,
    conversion_max_freq=115400,
    conversion_unc=None, 
    conversion_threshold=None,
    global_qn_label_list=['configuration'],
    global_qn_format_list=['%20s'],
    local_qn_label_list=['J', 'Multiple', 'parity'],
    local_qn_format_list=['%5.1f', '%10s', '%1s']
)

Partition Functions

import pyexocross as px

px.partition_functions(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_pf.log',
    ntemp=1,
    tmax=6000
)

Specific Heats

import pyexocross as px

px.specific_heats(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_cp.log',
    ntemp=1,
    tmax=6000
)

Cooling Functions

import pyexocross as px

px.cooling_functions(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_cf.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    ntemp=1,
    tmax=6000
)

Lifetimes

import pyexocross as px

px.lifetimes(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_lifetime.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    compress=False
)

Oscillator Strengths

import pyexocross as px

px.oscillator_strengths(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_os.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    gf_or_f='f',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',   
    plot_unit='cm-1',     
    limit_yaxis=1e-30
)

Stick Spectra (LTE)

import pyexocross as px

px.stick_spectra(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_stick_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['configuration', 'Multiple', 'parity'],
    qnsformat_list=['%20s', '%10s', '%2s'],
    temperatures=[300, 3000],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=115400,
    abs_emi='Ab',
    qns_filter={
        'configuration': [],
        'Multiple': [],
        'parity': [],
    },
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (Non-LTE, Population Method)

import pyexocross as px

px.stick_spectra(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_stick_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['configuration', 'Multiple', 'parity'],
    qnsformat_list=['%20s', '%10s', '%2s'],
    nlte_method='P',
    nlte_path='/path/to/Databases/ExoAtom/Ar/NIST/Ar_Ids.csv',
    temperatures=[300, 3000],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=115400,
    abs_emi='Ab',
    qns_filter={
        'configuration': [],
        'Multiple': [],
        'parity': [],
    },
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (LTE)

import pyexocross as px

px.cross_sections(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_stick_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    temperatures=[1000, 2000, 3000],
    pressures=[1.0, 10.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=115400,
    bin_size=1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    cutoff=25.0,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (Non-LTE, Treanor Method)

import pyexocross as px

px.cross_sections(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_xsec_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['configuration', 'Multiple', 'parity'],
    qnsformat_list=['%20s', '%10s', '%1s'],
    nlte_method='T',
    tvib_list=[1000],
    trot_list=[100, 200],
    vib_label=['parity'],
    rot_label=['J'],
    pressures=[1.0, 5.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    bin_size=1,
    profile='SciPyVoigt',
    predissociation=False,
    broadeners=['Default'],
    ratios=[1.0],
    cutoff=25.0,
    abs_emi='Em',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (Non-LTE, Population Method)

import pyexocross as px

px.cross_sections(
    database='ExoAtom',
    atom='Ar',
    dataset='NIST',
    read_path='/path/to/Databases/ExoAtom/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exoatom_xsec_nlte.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['configuration', 'Multiple', 'parity'],
    qnsformat_list=['%20s', '%10s', '%2s'],
    nlte_method='P',
    nlte_path='/path/to/Databases/ExoAtom/Ar/NIST/Ar_Ids.csv',
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=115400,
    bin_size=0.1,
    profile='Gaussian',
    broadeners=['Default'],
    ratios=[1.0],
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

HITRAN Examples

Conversion (HITRAN -> ExoMol)

import pyexocross as px

px.conversion(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran.log',
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    conversion_format='ExoMol',
    conversion_min_freq=0,
    conversion_max_freq=63000,
    conversion_unc=None,           
    conversion_threshold=None,     
    global_qn_label_list=['X', 'Omega', 'v1'],
    global_qn_format_list=['%2s', '%3s', '%2d'],
    local_qn_label_list=['Br', 'Sym', 'F'],
    local_qn_format_list=['%2s', '%1s', '%5s']
)

Partition Functions

import pyexocross as px

px.partition_functions(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_pf.log',   
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    ntemp=1,
    tmax=5000
)

Specific Heats

import pyexocross as px

px.specific_heats(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_cp.log',
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    ntemp=1,
    tmax=5000
)

Cooling Functions

import pyexocross as px

px.cooling_functions(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_cf.log',
    chunk_size=100000,
    ntemp=1,
    tmax=5000,
    read_path='/Users/beryl/Academic/UCL/PhD/Data/database/HITRAN/', 
    save_path='/Users/beryl/Academic/UCL/PhD/Data/pyexocross/', 
    logs_path='/Users/beryl/Academic/UCL/PhD/Data/pyexocross/log/test_api_hitran.log'
)

Lifetimes

import pyexocross as px

px.lifetimes(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_lifetime.log',
    ncputrans=4,    
    ncpufiles=1,
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    compress=False
)

Oscillator Strengths

import pyexocross as px

px.oscillator_strengths(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_os.log',
    chunk_size=100000,
    gf_or_f='f',
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (LTE)

import pyexocross as px

px.stick_spectra(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_stick_nlte.log',
    chunk_size=100000,
    temperatures=[296, 1000],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    abs_emi='Ab',
    unc_filter=0.01,
    threshold=1e-30,
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Stick Spectra (Non-LTE, Treanor Method)

import pyexocross as px

px.stick_spectra(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_stick_nlte.log',
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    nlte_method='T',
    tvib_list=[1000, 2000],
    trot_list=[300, 400],
    vib_label=['v1', 'X'],
    rot_label=['J'],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    abs_emi='Ab',
    unc_filter=0.01,
    threshold=1e-35,
    plot=True,
    plot_method='log',
    plot_wn_wl='WN', 
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Cross Sections (with Air + Self Broadening)

import pyexocross as px

px.cross_sections(
    database='HITRAN',
    molecule='NO',
    isotopologue='14N-16O',
    dataset='NO-HITRAN',
    species_id=81,
    read_path='/path/to/Databases/HITRAN/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/hitran_xsec.log',
    chunk_size=100000,
    qnslabel_list=['J', 'X', 'Omega', 'v1', 'Sym', 'F'],
    qnsformat_list=['%5.1f', '%2s', '%3s', '%2d', '%1s', '%5s'],
    temperatures=[1000, 2000],
    pressures=[0.5, 1.0],
    wn_wl='WN',
    wn_wl_unit='cm-1',
    min_range=0,
    max_range=30000,
    bin_size=0.1,
    profile='SciPyVoigt',
    broadeners=['Air', 'Self'],
    ratios=[0.7, 0.3],
    cutoff=25.0,
    abs_emi='Ab',
    plot=True,
    plot_method='log',
    plot_unit='cm-1',
    limit_yaxis=1e-30
)

Batch Processing Example

Run multiple species or temperatures in a loop:

import pyexocross as px

species_list = [
    {'molecule': 'NO', 'isotopologue': '14N-16O', 'dataset': 'XABC'},
    {'molecule': 'NO', 'isotopologue': '15N-16O', 'dataset': 'XABC'},
    {'molecule': 'MgH', 'isotopologue': '24Mg-1H', 'dataset': 'XAB'},
]

COMMON = dict(
    database='ExoMol',
    read_path='/path/to/Databases/ExoMol/',
    save_path='/path/to/output/',
    logs_path='/path/to/output/log/exomol_multiple_species.log'
)

COMPUTE_PARAMS = dict(
    ncputrans=4,                
    ncpufiles=1,               
    chunk_size=100000,         
)

QN_PARAMS = dict(
    qnslabel_list=['+/-', 'e/f', 'ElecState', 'v', 'Lambda', 'Sigma', 'Omega'],
    qnsformat_list=['%1s', '%1s', '%12s', '%3d', '%3d', '%5.1f', '%5.1f'],
)

RANGE_PARAMS = dict( 
    wn_wl='WN',                 
    wn_wl_unit='cm-1',          
    min_range=0,               
    max_range=30000,            
    abs_emi='Ab',              
    unc_filter=0.01,          
    threshold=1e-30,           
)

LINE_PROFILE = dict(
    profile='Gaussian',
    broadeners=['Default'], 
    ratios=[1.0],           
    alpha_hwhm=None,         
    gamma_hwhm=None,   
)

PLOT = dict(
    plot=True,             
    plot_method='log',     
    plot_wn_wl='WN',       
    plot_unit='cm-1',       
    limit_yaxis=1e-30,      
)

for species in species_list:
    px.cross_sections(
        **COMMON,
        **COMPUTE_PARAMS,
        **QN_PARAMS,
        **RANGE_PARAMS,
        **LINE_PROFILE,
        **PLOT,
        molecule=species['molecule'],
        isotopologue=species['isotopologue'],
        dataset=species['dataset'],
        temperatures=[1000, 3000],
        bin_size=1,           
        predissociation=False,  
        cutoff=25.0,            
    )