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.2.0.tar.gz (14.6 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.2.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fitsImageProcess-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c662218e29adf6b047a415be9276d93cd77c1bbf6a24441535fb8985328fd8c0
MD5 18df6db165d42aacafc486a8ee8e17e7
BLAKE2b-256 d9704e581954cfa9c88ca19aaca67c8139b802cd6c4e9e510f50d4cf6dc6d4e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fitsImageProcess-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc9b2cf3bbbe4a1d1b20117521e72a26f20770d098d16cd6d125c0e6c6fc6d6
MD5 903c6daf46f387ba56280fab2c16029c
BLAKE2b-256 a64ae85a043b002764be5cb502d3f320adecc208e15a2238beb9c26a5db37b81

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