Image processing utilities for SpectroForged instruments, powered by PrISM
Project description
prism-imageproc
This repository contains the Python library prism-imageproc, which provides tools for processing images
from instruments modeled using SpectroForge (https://github.com/sunipkm/SpectroForge). The library includes functions
applying image transformations to map detector images onto the focal plane of the instrument, as well as
remove diffraction slit curvature from the images. This library is designed to be used stand-alone, using
the instrument configuration files generated by SpectroForge. This library is also used internally by
SpectroForge.
Installation
You can install the library using pip:
pip install prism-imageproc
Usage
The library is used in the following way:
# Import the library
from prism_imageproc import ImageStraightener
import matplotlib.pyplot as plt # For plotting the straightened images
# Create a straightener object using the instrument configuration file
straightener = ImageStraightener.from_instrument_config('path/to/instrument_curve_maps.bin')
# Load an image and map it onto the mosaic grid
image_array = ... # Load your image as a 2D NumPy array
mapped_image = straightener.load_image(image_array)
# Straighten the image by removing slit curvature
straightened_images = mapped_image.straighten_image()
# The result is a dictionary of straightened images, one for each window. You can access them like this:
for window_name, straightened_image in straightened_images.items():
print(f"Straightened image for window {window_name}:")
straightened_image.plot() # Render the straightened image
plt.show() # Display the plot
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prism_imageproc-0.0.3.tar.gz.
File metadata
- Download URL: prism_imageproc-0.0.3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2ef3c0d04591a975288c090acd19d0a3806812af7e9a7403ee0897fb7eed4b9
|
|
| MD5 |
4703a26d01f8f6930fe3490e24d07d8c
|
|
| BLAKE2b-256 |
2edad6f9a04e885158dece746c769299ca9384ec5943406effe4c6d1383f27cb
|
File details
Details for the file prism_imageproc-0.0.3-py3-none-any.whl.
File metadata
- Download URL: prism_imageproc-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
363e19cdea6c8584341f3ea47b15e91dbf6c8fb07b8f746d5c5ace7ab2be9d44
|
|
| MD5 |
540ec34be4c61a75985b63196073589f
|
|
| BLAKE2b-256 |
2f3654d354ca197ad86b831f979c6331a82a70629146c1bfc160cccf5805a994
|