Skip to main content

A package for processing FITS images

Project description

FITS Image Toolkit (fits_image)

fits_image is a Python package designed for handling, processing, and analyzing FITS (Flexible Image Transport System) astronomical images. It provides various classes and functions for reading, writing, preprocessing, plotting, and analyzing FITS images.

Deployment

To deploy this project run

  pip install fitsImageProcess

Structure

Directory Structure

│
├── __init__.py               # Makes the directory a package
├── fitsImageProcess.py       # Contains the FITSImage class
├── fits_image_reader.py      # Contains the FITSImageReader class
├── fits_image_writer.py      # Contains the FITSImageWriter class
├── fits_image_processor.py   # Contains the FITSImageProcessor class
├── fits_image_plotter.py     # Contains the FITSImagePlotter class
├── fits_image_stats.py       # Contains the FITSImageStats class
├── fits_object_detector.py   # Contains the FITSObjectDetector class
└── fits_downloader.py        # Contains the FITSDownloader class

Classes and Functions

FITSImage

Description: Represents a FITS image.

Attributes:

  • path: Path to the FITS image file.
  • imgsub: Subtracted image data (if available).
  • s: Standard deviation of pixel values.
  • data: Raw image data.
  • data_relatif: Relative image data.
  • aligned_image: Aligned image data (if available).
  • header: Header information of the FITS image.
  • m: Mean pixel value.

FITSImageReader

Description: Reads FITS images.

FITSImageWriter

Description: Writes FITS images to files.

FITSImageProcessor

Description: Preprocesses FITS images and finds differences between images.

FITSImagePlotter

Description: Plots FITS images, differences, statistics, detected objects, and histograms.

FITSImageStats

Description: Calculates statistics of FITS images.

FITSObjectDetector

Description: Detects objects in FITS images.

FITSDownloader

Description: Downloads FITS images from URLs.

Usage

Here's how you can use fits_image in your Python scripts:

1. Importing

To import all the Functions:

from fits_image import (
    FITSImage,
    FITSImageReader,
    FITSImageWriter,
    FITSImageProcessor,
    FITSImagePlotter,
    FITSImageStats,
    FITSObjectDetector,
    FITSDownloader
)

2. Loading and Plotting Images

To load a FITS image and plot it:

from fits_image import FITSImage, FITSImagePlotter

# Load a FITS image
image = FITSImage('path/to/image.fits')

# Plot the image
plotter = FITSImagePlotter()
plotter.plot_self(image)

3. Image Subtraction and Object Detection

You can perform image subtraction between two FITS images and detect objects in the resulting image:

# Load two FITS images for subtraction
other_image = FITSImage('path/to/other_image.fits')

# Subtract images (Needed before plotting)
image_diff = FITSImageProcessor.Subtract(image, other_image)

# Plot the difference and detected objects
plotter.plot_diff(image, other_image)
plotter.plot_objects(image)

4. Statistics Analysis and Histogram Plotting

Analyze the statistics of a FITS image and plot its histogram:

# Plot statistics and histogram
plotter.plot_stats(image)
plotter.plot_histogram(image)

5. Preprocessing Images

Preprocess FITS images by applying background subtraction and digital image processing techniques:

from fits_image import FITSImageProcessor

# Preprocess the image
processor = FITSImageProcessor()
processor.preprocess(image)

6. Writing Images to Files

Save a FITS image to a file:

from fits_image import FITSImageWriter

# Write the image to a file
writer = FITSImageWriter()
writer.write(image, 'output.fits')

7. Downloading Images

Download FITS images from URLs:

from fits_image import FITSDownloader

# Download the image
downloader = FITSDownloader()
downloader.download('http://example.com/image.fits', 'downloaded_images/')

License

This project is licensed under the GNU License, see GPLv3.

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

fitsImageProcess-0.3.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

fitsImageProcess-0.3.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file fitsImageProcess-0.3.0.tar.gz.

File metadata

  • Download URL: fitsImageProcess-0.3.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.6

File hashes

Hashes for fitsImageProcess-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d86ba197d7f2db91966fbd6ea62e75d1a0addc76f9f803610c313f09a091f0ba
MD5 4fac3d63466ea197557de680acaffd9c
BLAKE2b-256 c6a7a98440ac3a6f9bf94e0e4b80c1e4d57a2377663d286e479b1dcba6414ca4

See more details on using hashes here.

File details

Details for the file fitsImageProcess-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fitsImageProcess-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc09e4c145ea905dabccc7d9e830e912605a92296253e7a3bb711908bd1c15d0
MD5 1be14ee95f9959cb5b70053f1e23443e
BLAKE2b-256 54298b2135f432f54adc5e18cae1b5443a2252f4a334511b69485bb26faf75a1

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