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.5.0.tar.gz (45.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.5.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fitsImageProcess-0.5.0.tar.gz
  • Upload date:
  • Size: 45.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.5.0.tar.gz
Algorithm Hash digest
SHA256 88b2eebed743fd778c51d0a93afbc9bb15348d51f4f00a662f9742a9b61d3f1e
MD5 46eab58675c98e9c835c86777d6092fc
BLAKE2b-256 850a016cfc9ebd3e4d02c51d599502ec73393faebe2280f4be08fc9d139081db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fitsImageProcess-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cddbc33944c74b18016784d8fe83be845c1ce56f42f0662277925867b3d51283
MD5 0c703605d2a4b04ea4b964909f1f0051
BLAKE2b-256 8e77fc90751dcaadedea1c3cfe551bf3fda54a03249714e38c4ad5b7e8dcd4ff

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