Skip to main content

Image processing utilities for SpectroForged instruments, powered by PrISM

Project description

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/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prism_imageproc-0.0.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prism_imageproc-0.0.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file prism_imageproc-0.0.2.tar.gz.

File metadata

  • Download URL: prism_imageproc-0.0.2.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

Hashes for prism_imageproc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7751747e698a7627f238d94fef9ff8dbba7c2360b9b838a53ee90b023f080e24
MD5 75450765a3dd74051848c029bb8a84a6
BLAKE2b-256 3d2e08c825492c808db4a576474ca14f153485f9e470f66adcc422314a247054

See more details on using hashes here.

File details

Details for the file prism_imageproc-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for prism_imageproc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fff3c60a0e2a07bc1d185315795be0440db467e068fd6970e5adc2f9d7d1c01
MD5 982015b58a7875be749bc9e726ee230d
BLAKE2b-256 27803df43b8103fd1d188ca36bfd202a13c9364f2bb2e338cffb58ba56f256bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page