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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fitsImageProcess-0.1.0.tar.gz.
File metadata
- Download URL: fitsImageProcess-0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6fa92893010bdffd8d71e8f286ab3539681d1bca781957c0984dc27d108031e
|
|
| MD5 |
b1fe3093318fe196f6248999de41a1bc
|
|
| BLAKE2b-256 |
28e1e32ed1897b61df60df24f47453fa60cffa5de81a6b2d8ffddc982f50a916
|
File details
Details for the file fitsImageProcess-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fitsImageProcess-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5643c475ace6ed0e85efb6a5dfadc71febab4f3d8e07ec662346e8454133131a
|
|
| MD5 |
c7970e6442081d0ad8a9ec39250f4ef8
|
|
| BLAKE2b-256 |
fae3ac66a2b9658fdfabb653ab2a0154857eebbba99253184e00b308fa35ed46
|