Spyfit¶
spyfit is a Python package that provides a set of tools for easy handling of FTIR retrieval data and for flexible setup and execution of retrieval processing pipelines.
Our goal with spyfit is to provide deep integration with the libraries of the Python scientific stack and to promote the use of standard data models. Through the use of the xarray Python package, we adopt the Common Data Model for self-describing retrieval data (it can be viewed as an in-memory representation of a netCDF file).
NOTE: This package is currently under heavy development! API is not stable.
Documentation¶
Installation¶
Required dependencies¶
Instructions¶
There is currently no spyfit release available at PyPi or Anaconda.
Be sure you have the required dependencies (numpy, pandas and xarray) installed first. You might consider using conda to install them:
$ conda install xarray netcdf4 pip
Then you can clone the spyfit git repository and install it using pip:
$ git clone https://github.com/girpas-ulg/spyfit
$ cd spyfit
$ pip install .
For development purpose, use the following command:
$ pip install -e .
API reference¶
This page provides an auto-generated summary of spyfit’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.
Retrievals¶
load_dataset (filename_or_path[, fmt]) |
Load a retrieval dataset stored in a given format. |
SFIT4¶
Load SFIT4 dataset¶
io.sfit4.load_sfit4 (ctl_filename) |
Load data from a SFIT4 run. |
Read SFIT4 output files¶
io.sfit4.read_matrix (filename[, var_name, dims]) |
Read a single matrix (or a single vector) in SFIT4 output ascii files. |
io.sfit4.read_ak_matrix (filename[, ldim, kdim]) |
Read averaging kernel matrix. |
io.sfit4.read_seinv_vector (filename[, ddim]) |
Read seinv. |
io.sfit4.read_table (filename[, var_name, ...]) |
Read (labeled) tabular data in SFIT4 output ascii files. |
io.sfit4.read_profiles (filename[, ...]) |
Read a-priori or retrieved profiles in SFIT4 output ascii files. |
io.sfit4.read_aprfs (filename[, ldim]) |
Read a-priori profiles in SFIT4 output ascii files. |
io.sfit4.read_rprfs (filename[, ldim]) |
Read retrieved profiles in SFIT4 output ascii files. |
io.sfit4.read_state_vector (filename[, ldim, ...]) |
Read the state vector in SFIT4 output ascii files. |
io.sfit4.read_param_iterations (filename[, ...]) |
Read the state vector for each iteration in SFIT4 ascii output files. |
io.sfit4.read_spectra (filename[, spdim, ...]) |
Read observed and fitted spectra in SFIT4 ascii files. |
io.sfit4.read_single_spectrum (filename[, ...]) |
Read a single spectrum in a SFIT4 output ascii files. |
io.sfit4.read_single_spectra (filename[, ...]) |
Read single spectra in a SFIT4 output ascii files. |
io.sfit4.read_solar_spectrum (filename[, ...]) |
Read a calculated sol ar spectrum in SFIT4 output ascii files. |
io.sfit4.read_summary (filename[, spdim, ...]) |
Read retrieval summary in SFIT4 output ascii files. |
Read SFIT4 input files¶
io.sfit4.read_ctl (filename[, ldim]) |
Read control file. |
io.sfit4.read_layers (filename[, ldim]) |
Read profile layers. |
io.sfit4.read_ref_profiles (filename[, rdim]) |
Read coordinates, atmosphere and gas reference profiles. |
io.sfit4.read_spectrum (filename[, spdim, ...]) |
Read a spectrum (bands and scans data). |
Write SFIT4 input files¶
io.sfit4.write_reference (dataset, filename, ...) |
Export reference ZPT and gas profiles to SFIT4 ascii format. |
Contributing¶
Contributions are welcome, and they are greatly appreciated!
You can contribute either by reporting bugs or submitting feedback at https://github.com/girpas-ulg/spyfit/issues or by sending pull requests through the spyfit repository on GitHub.
Get Started!¶
Ready to contribute? Here’s how to set up spyfit for local development.
Fork the spyfit repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/spyfit.git
Install your local copy (you might consider creating first a new virtual environment using either conda or virtualenv):
$ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.