Skip to main content

A package to fit the telluric absorption in astronomical spectra.

Project description

This code will fit the telluric absorption spectrum in data, using LBLRTM. More details can be found in the documentation and examples, but the installation and run procedure are outlined below. If you use this code, please cite my paper.

Installation

This code requires the following packages:

  • matplotlib

  • numpy v1.6 or greater

  • scipy v0.13 or greater

  • astropy v0.2 or greater

  • lockfile

  • pysynphot v0.7 or greater

  • fortranformat

  • cython

  • requests

The bolded entries are required before installation, so make sure you get them from pip, apt-get/yum, or conda (depending on your OS and linux distribution). The setup script will attempt to install the rest if you don’t have them, but I suggest doing it yourself just to make sure nothing goes wrong. Once you have the dependencies, simply type

pip install TelFit

to install TelFit. It may take a while, as it needs to build the LBLRTM code and some of its standard input files.

Running TelFit

To run TelFit, you should create a script like in the examples. The key parts of the script are the inputs to the TelluricFitter class. You should:

  • Initialize fitter: fitter = TelluricFitter()

  • Define variables to fit: must provide a dictionary where the key is the name of the variable, and the value is the initial guess value for that variable. Example: fitter.FitVariable({“ch4”: 1.6, “h2o”: 45.0})

  • Edit values of constant parameters: similar to FitVariable, but the variables given here will not be fit. Useful for settings things like the telescope pointing angle, temperature, and pressure, which will be very well-known. Example: fitter.AdjustValue({“angle”: 50.6})

  • Set bounds on fitted variables (fitter.SetBounds): Give a dictionary where the key is the name of the variable, and the value is a list of size 2 of the form [lower_bound, upper_bound]

  • Import data (fitter.ImportData): Copy data as a class variable. Must be given as a DataStructures.xypoint instance

  • Perform the fit: (fitter.Fit): Returns a DataStructures.xypoint instance of the model. The x-values in the returned array are the same as the data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TelFit-1.3.1.tar.gz (4.0 MB view details)

Uploaded Source

File details

Details for the file TelFit-1.3.1.tar.gz.

File metadata

  • Download URL: TelFit-1.3.1.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for TelFit-1.3.1.tar.gz
Algorithm Hash digest
SHA256 85e05a04fd98a1034c362df16f9ae8ba75625acf5942a3ed86fb83d4a0468028
MD5 37c46f440b0e262da283117a6211717c
BLAKE2b-256 d97a906b8cf243bda3b4848e0b6965bb4819b95dd611c41e10811235f9dfa898

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page