Simple spectrum image processing toolbox which include functions such as uncurving, and more to come.
Project description
spectrumuncuver
The spectrumuncurver
python package is aimed at a specific problem which is often found
in spectrometers which is the curvature of the spectrum data caused by the lenses shape. Some spectrometers have 2D CCD
which allows the sum of the vertical pixels to achieve greater SNR. However, summing while the spectrum is curved
leads to a decrease of the spectral resolution. Thus, to achieve maximum resolution, one would want to uncuve the spectral data.
In addition to this main function, this package provides other function for graphing spectrum for articles. You will find an extensive description of these function below, or more in details in the readthedocs.
Anyone who is willing to contribute is welcome to do so.
email: marc-andre.vigneault.02@hotmail.com
installing the package
you can simply use pip install spectrumuncurver
or for those without a pip
link to PATH
, python -m pip install specturmuncurver
.
using the package
To use the package, you have to follow 3 or 4 steps depending on your goal.
- Create a
su = SpectrumUncurver()
object. - Load an image into the object.
su.load_image(imagePath: str)
- Uncurve the image and choose the algorithm.
su.uncurve_spectrum_image(xlim:List, ylim:List, method='gaussian', fitted=False)
. You can choose from the following algorithms:maximum
,gaussian
,quadratic
. Thefitted
parameter will polyfit the found peaks to ensure smooth uncurving, though not perfectly implemented. - Choose which function interests you from the following functions:
The package has (or will have soon) the following function:
to save/show an image
save_uncurve_image()
save_curved_image()
save_curved_image_with_fit()
save_curving_comparison_image()
show_uncurve_image()
show_curved_image()
show_curved_image_with_fit()
show_curving_comparison_image()
to save/show a plot
save_uncurved_spectrum_plot()
save_curved_spectrum_plot()
save_superposed_spectrum_plot()
save_curve_plot()
show_uncurved_spectrum_plot()
show_curved_spectrum_plot()
show_superposed_spectrum_plot()
show_curve_plot()
Here is some results achieved with this package:
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
Built Distribution
Hashes for spectrumuncurver-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f9de04f910e6e5a4866f3a8c044db5bd7a7ef8d03ce6203358f6d688f6e3e6 |
|
MD5 | c6202b05ecd996c7c915062bf7233745 |
|
BLAKE2b-256 | 5777e41bd980817185f3020520d30a7fe1ea657978b8ff6eed5acf66b51eced5 |