Fabry-Perot Imaging in Python¶
Tools for reading and manipulating raw data from a Fabry-Perot interferometer based hyperspectral imager.
Free software: MIT license
Documentation: https://fpipy.readthedocs.io.
Installation¶
Using PIP¶
For normal use, it is enough to install fpipy using pip from git:
pip install git+https://github.com/silmae/fpipy.git
Optionally, you may also specify dask as an extra dependency if you wish to enable parallel computation. Currently this is just for convenience (you will get the same result if you install dask separately):
pip install git+https://github.com/silmae/fpipy.git[dask]
If you need to access ENVI files (such as the included example hyperspectral datasets) you will need to install rasterio. Specifying ENVI as an extra dependency will install it if you have the required system libraries for GDAL:
pip install git+https://github.com/silmae/fpipy.git[ENVI]
However, due to the difficulty of installing the necessary libraries (especially on Windows) it is recommended you use Conda if you wish to access ENVI files.
Using Conda¶
Using conda, you can create an environment with rasterio and xarray, then install fpipy using pip:
conda create -n <env_name> rasterio xarray
pip install git+https://github.com/silmae/fpipy.git
There are also multiple ready-made environments under the fpipy/envs directory which may be used to create suitable conda environments using:
conda env create -n <env_name> --file fpipy/envs/<env_name>.yml
See Contributing for more info on using development environments.
API reference¶
Submodules¶
Functions for reading data from various formats. |
|
Functions for manipulating raw CFA data. |
|
Metadata parsing. |
|
Test images. |
|
Conventions for data, coordinate and attribute names. |
|
Tools for simulating CFA data from radiance cubes. |
|
Test data generators for debugging and benchmarking. |
Command line scripts¶
This is a list of command line utilities that are installed with fpipy.
raw2rad¶
Convert raw CFA data to radiances.
usage: raw2rad [-h] [-f output_format] [-o output_dir] [-p output_prefix]
input file [input file ...]
-
input
file
¶ List of files to process to radiance.
-
-h
,
--help
¶
show this help message and exit
-
-f
{netCDF}
,
--format
{netCDF}
¶ Output file format for the processed radiances, default “netCDF”
-
-o
<output_dir>
,
--odir
<output_dir>
¶ Directory to write output files to, default “.”
Glossary¶
- CFA
Short for Colour Filter Array.
- Colour Filter Array
Array of various colour filter used to enable measurement of colour images using a monochromatic sensor by sampling different colours from neighbouring points. Usual arrangements red, green and blue pixels are referred to as Bayer filters.
- DN
Short for Digital Number.
- Digital Number
Values received from the sensor (after analog-to-digital conversion and possible sensor firmware modification).
- Fabry-Perot interferometer
Optical component composed of two parallel mirrors with a set air gap between them. Used as a tunable bandpass filter in hyperspectral imagers. See Wikipedia for more.
Contributing¶
Contributions are welcome.
Report bugs or give feedback at https://github.com/silmae/fpipy/issues.
Get Started!¶
Ready to contribute? Here’s how to set up fpipy for local development.
Fork the fpipy repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/fpipy.git
Install the dependencies using the provided conda environment file and then the package itself using pip:
$ cd fpipy/ $ conda env create -f envs/development.yml $ conda activate fpipy-dev $ pip install -e .
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass tests:
$ flake8 fpipy tests $ make test
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.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
The pull request should include tests.
Put any new functionality into a function with a docstring.
The pull request should work for all configurations. Check https://travis-ci.org/silmae/fpipy/pull_requests and make sure that the tests pass for all supported Python versions.
Authors¶
Development lead¶
Developed at the Spectral Imaging Laboratory of the Faculty of Information Technology in the University of Jyväskylä by
Matti A. Eskelinen <matti.a.eskelinen@student.jyu.fi>
Jyri Hämäläinen <jyri.p.hamalainen@gmail.com>
Contributors¶
Severi Jääskeläinen <severi.a.jaaskelainen@student.jyu.fi>
Samuli Rahkonen <samuli.rahkonen@jyu.fi>
Leevi Annala <leevi.a.annala@jyu.fi>