Skip to content

Recipes

Akio Taniguchi edited this page May 16, 2019 · 5 revisions

TL;DR

import ndradex
import numpy as np
import matplotlib.pyplot as plt

Excitation temperature

Calculation

QN_ul = [f'{Ju}-{Ju-1}' for Ju in range(1, 21)]
n_H2 = [1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10]

ds = ndradex.run('cs@lique', QN_ul, n_H2=n_H2, 
                 T_kin=50, N_mol=1e15, T_bg=10)

Plotting

fig, ax = plt.subplots(figsize=(12, 4))

for n in ds.n_H2:
    freq = ds['freq'].sel(n_H2=n)
    T_ex = ds['T_ex'].sel(n_H2=n)
    label = f'{n.values:.0e} cm^-3'
    ax.plot(freq, T_ex, '.-', label=label)

ax.set_title('Excitation temperature of CS')
ax.set_xlabel('Transition')
ax.set_ylabel('T_ex (K)')
ax.set_xticks(freq[::3])
ax.set_xticklabels(QN_ul[::3])
ax.legend(ncol=4)
ax.grid()
Clone this wiki locally