Originally, I had an LTE model but it worked because I was only modelling C2H. That meant I could create a dataframe containing the lines and their properties from splatalogue and use it to supply all the necessary information to calculate tau.
It would be nice to create something similar that works for all molecules. It could be as simple as setting a format for line_df that is easy to generate from some online database of lines.
Old code attached.
lte_constants=(light_speed*light_speed*light_speed)/(8.515736*np.pi)
def get_lte_taus(N,T,delta_v,line_df):
tau_df=DataFrame(line_df["Frequency"])
line_df["tau"]=0.0
line_df["T_ex"]=T
line_df["tau"]=line_df["Frequency"].values*1.0e9
line_df["tau"]=line_df["tau"].pow(3)
#then divide column density in m-2 by partition function
N_Q=(1e4*(N))/part_func(T)
line_df["tau"]=line_df["Aij"]*line_df["gu"]/(line_df["tau"]*delta_v*1.0e3)
line_df["boltz"]=np.exp(-line_df["E_L"].values/T)
line_df["boltz"]=line_df["boltz"]-np.exp(-line_df["E_U"].values/T)
line_df["tau"]=lte_constants*line_df["tau"]*N_Q*line_df["boltz"]
return line_df[["Frequency","tau","T_ex"]].rename({"Frequency":"freq"},axis=1)
Originally, I had an LTE model but it worked because I was only modelling C2H. That meant I could create a dataframe containing the lines and their properties from splatalogue and use it to supply all the necessary information to calculate tau.
It would be nice to create something similar that works for all molecules. It could be as simple as setting a format for line_df that is easy to generate from some online database of lines.
Old code attached.