Coder Social home page Coder Social logo

r-daytonoxland / oh-temperature-convertor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 137 KB

This repo contains code which translates temperatures originally calculated from OH*(6-2) transiton spectra using a certain set of Einstein coefficients to a new set of Einstein coefficients with no need of the original data.

License: GNU General Public License v3.0

Jupyter Notebook 77.23% Python 22.77%

oh-temperature-convertor's Introduction

oh_einstein_temp_convert

oh_einstein_temp_convert is a Python package which translates temperatures originally calculated from OH*(6-2) transiton spectra using a certain set of Einstein coefficients to a new set of Einstein coefficients with no need of the original data.

It is published on Pypi and kept here, this repo also includes a Jupyter notebook with the same code in a more prose-style with plots to explain the steps.

Pypi package

Author

Rowan Dayton-Oxland University of Southampton Github

Installation

Use the package manager pip to install oh_einstein_temp_convert.

pip install oh_einstein_temp_convert

Requirements

  • Python >= 3.10
  • numpy, pandas
  • OS independent

Einstein A coefficient sources

Ain (int) - Original Einstein coefficient source index (see table)
Aout (int) - Desired output Einstein coefficient source index (see table)

Einstein A Source Index
Mies et al., 1974 0
Loo and Groenenboom, 2008 1
Langhoff et al., 1986 2
Goldman et al., 1998 3
Turnbull and Lowe, 1989 4

Usage

import oh_einstein_temp_convert as oh

Temperatures = []  # List of temperatures

# Temperatures originally calculated from e.g. Mies et al., 1974 coefficients
Ain_index = 0  # Choose index of input temperatures
# Output temperatures calculated from e.g. Loo and Groenenboom, 2008 coefficients. 
Aout_index = 1  # Choose index of output temperatures

# returns list of converted temperatures
Result = oh.convert_temperatures(Temperatures, Ain_index, Aout_index)

Algorithm

  • Get the original temperature and original Einstein coefficient set
  • Calculate $ln(\frac{I}{Ain \cdot 2(2J' + 1)})$ and add a correction term for the new Einstein coefficient set $ln(\frac{Ain}{Aout})$ for each $F(J')$ value in the OH*(6-2) P-branch.
  • Plot the corrected $ln(\frac{I}{Aout \cdot 2(2J' + 1)})$ term against $F(J')$
  • Extract the output temperature from the gradient of the line by linear fit

This comes from the following equation; $$ ln(\frac{I}{A \cdot 2(2J' + 1)}) = \frac{-(h c)}{(k T)} * F(J') + ln(\frac{N}{QR}) $$

$I$ The spectral line intensity $A$ The Einstein A coefficient $J'$ The rotational quantum state $h$ The Planck constant $c$ The speed of light in the vacuum $k$ The Boltzmann constant $T$ The rotational temperature $F(J')$ The rotational energy term $ln(\frac{N}{QR})$ The partition function (constant for any single branch in the spectrum)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

References

Einstein and other quantum coefficients, and general inspiration from the Synthetic Hydroxyl Spectrum Generator Sigernes, F., Shumilov, N., Deehr, C.S., Nielsen, K.P., Svenøe, T., and Havnes, O., The Hydroxyl rotational temperature record from the Auroral Station in Adventdalen, Svalbard (78°N, 15°E) , Journal of Geophysical Research, Vol 108 (A9), 1342, doi 1029/2001JA009023, 2003.

Holmen, S., Trends and variability of polar mesopause region temperatures attributed to atmospheric dynamics and solar activity, PhD Thesis, UiT The Arctic University of Norway, 2016.

Mies, F. H. (1974). Calculated vibrational transition probabilities of OH($X^2\Pi$). Journal of Molecular Spectroscopy,53(2), 150–188.

Mark P. J. van der Loo, Gerrit C. Groenenboom (2008) Theoretical transition probabilities for the OH Meinel system. J. Chem. Phys. 21 March 2007; 126 (11): 114314.

Langhoff, S. R., Werner, H. J., & Rosmus, P. (1986). Theoretical transition probabilities for the OH Meinel system. Journal of Molecular Spectroscopy, 118(2), 507-529

Goldman, A., Schoenfeld, W. G., Goorvitch, D., Chackerian, J., C., Dothe, H., Mélen, F., … Selby, J. E. A. (1998). Updated line parameters for $OH X^2II-X^2II$ ($\upsilon″\upsilon’$) transitions. Journal of Quantitative Spectroscopy and Radiative Transfer, 59(3–5), 453–469.

D.N. Turnbull, R.P. Lowe, New hydroxyl transition probabilities and their importance in airglow studies, Planetary and Space Science, 37(6), 1989, 723-738, 0032-0633

License

GNU GPLv3.0

oh-temperature-convertor's People

Contributors

r-daytonoxland avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.