Skip to content

Package for fitting spectral data to known line parameters. Currently compatible with the HITRAN line database. Given a data set containing experimentally determined absorption coefficients, the program attempts to fit the data to the HITRAN database by finding the concentrations of user inputted molecules and isotopologues. Uses the Nelder-Mead…

jaymz07/spectral-line-fit

Repository files navigation

General package for fitting experimentally determined absorption coefficents to HITRAN line parameters.
This is accomplished by repeatedly generating hitran curves using initial guess parameters.
The Nelder-Mead method is used to efficiently find the minimum error between the data and the calculated HITRAN curves.


Directories contained here:
----------------------------------
code/			The the actual code of the program.
deprecated/		Old python scripts that are no longer incorporated into the main program.
par/			HITRAN 2012 line-files.
tempFiles/		A location for temporary files generated by the extract.py script. These files can be deleted.

Description of operation:
--------------------------------------
Takes input from a tab seperated list of wavelengths and absorption coefficients (and optionally an error collumn) and finds concentration values by fitting a computed hitran spectrum to the data.
Uses third-party library for computing lineshapes from the Hitran database.
This library can be found here:
  http://www.libradtran.org/doku.php?id=lbl2od
This package also includes a zipped version of this library. The documentation is contained in the archive.
There is no need to install this package, as the library is contained in many of the python files inside of the "code" folder.


Requirements:
------------------------------------------------
This program requires python and a bunch of standard libraries. They can all be downloaded in one package (the Anaconda package) from:
http://continuum.io/downloads
      If installing anaconda, make sure that it is registered as system python version and in system PATH variable (make sure check boxes are enabled at end of installation).

Note:This code is compatable with python 2.*, not 3.*!!!
      Make sure you have the right version!!!
      It can be easily converted to 3.* however

How to run:
--------------------------------------------------
For those on Windows systems, there are three scripts that show the execution of the program
  run.bat			-- Find concentrations using user supplied temperature and pressure values
  run_findPressure.bat		-- Find concentrations and pressure
  run_findTemperature.bat	-- Find concentrations and temperature
  
And for those on Mac/Unix systems, there are also three shell scripts:
  run.sh			-- Find concentrations using user supplied temperature and pressure values
  run_findPressure.sh		-- Find concentrations and pressure
  run_findTemperature.sh	-- Find concentrations and temperature
  
Note: Temperature fitting has not been well tested and is extremely sensitive to errors in the wavelength measurement.
      I have not shown this to be accurate with my datasets yet...
      
The program will prompt for an input file, the species of gas to fit, and some guess parameters.
  
Input data file:
--------------------------------------------------------
The input data file should be in the format of a tab-seperated, two collumn text file.
The first collumn should be the wavelength in nanometers and the second collumn should be the corresponding absorption coefficients.
	
Example data:
----------------------------------------------------------
I have provided an example input file in the "exampleData" folder.
  
direct questions to: jamesbounds@tamu.edu

About

Package for fitting spectral data to known line parameters. Currently compatible with the HITRAN line database. Given a data set containing experimentally determined absorption coefficients, the program attempts to fit the data to the HITRAN database by finding the concentrations of user inputted molecules and isotopologues. Uses the Nelder-Mead…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages