Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTE spectra #3

Open
jonholdship opened this issue Feb 2, 2021 · 0 comments
Open

LTE spectra #3

jonholdship opened this issue Feb 2, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jonholdship
Copy link
Collaborator

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)
@jonholdship jonholdship added the enhancement New feature or request label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant