Skip to main content

prism-imageproc

DOI

This repository contains the Python library prism-imageproc, which provides tools for processing images from instruments modeled using SpectroForge (https://github.com/prism-spectra/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')
# Get version of the library that produced this
lib_version = straightener.lib_version
# Get hash of the instrument model that produced this
instr_version = straightener.instr_version
# 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

Metadata

Release files for prism-imageproc 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prism-imageproc 0.0.4
File Size Uploaded
prism_imageproc-0.0.4.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prism-imageproc 0.0.4
File Interpreter ABI Platform
prism_imageproc-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / prism_imageproc-0.0.4.tar.gz

Download URL prism_imageproc-0.0.4.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d8c49e3d0a7fb2efc8ca9d5500e737e59b5386591ed3eb43659195f8b3501ce7
BLAKE2b-256 checksum
How to use checksums
9793dc6aceaf1899b73c49ecb4a066ed50ffdbbf89a99ffd76ad99b655499260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / prism_imageproc-0.0.4-py3-none-any.whl

Download URL prism_imageproc-0.0.4-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eaf2e79defd62d3ff649cba4e3629ba7b0940ff52e1ceed8c80fb5de0449c155
BLAKE2b-256 checksum
How to use checksums
2ed64707d99fc01e5232554b3cfa0653a13864ba19bc278e5c87772dadfd753e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page