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.6.0.tar.gz (46.3 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.6.0-py3-none-any.whl (57.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fitsImageProcess-0.6.0.tar.gz
Algorithm Hash digest
SHA256 856844b8452560e266d30546f947926fe705007219532700b410bc74b9218b51
MD5 fc5860c7e93eadeaf23f2a6b5e605d57
BLAKE2b-256 63348c8181ab2b01eddd25c8c84550f414b21d29157615b61387457f2f646e5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fitsImageProcess-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b701c6c7c4da84aea9de2a85da20476783c803dc1013bc2bd2514722107e3ac9
MD5 d484b0da8ee26cc1bbac60472655fbbd
BLAKE2b-256 26a459d2168203ac377e57b5131a43f518c13434ff961e4ac9376d0ef9f96b9d

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