A package to extract stars from an astronomical image
Project description
Welcome to the STAREXTRACTOR package
This package is an archive of scientific routines for data processing related to the source extraction from an astronomical image. Currently, operations on source extraction include:
- Read an astronomical image in
.fits
format or in generic image format, such as.bmp
; - Extract the centroid coordinates of the star spots and do photometry using
photutils
; - Show raw image with star spots marked;
How to Install
On Linux, macOS and Windows architectures, the binary wheels can be installed using pip
by executing one of the following commands:
pip install starextractor
pip install starextractor --upgrade # to upgrade a pre-existing installation
How to use
Read an astronomical image
Images can be in .fits
format or in generic image format, such as .bmp
.
>>> from starextractor import AstroImage
>>> imagefile = 'obs/fits/img_00000.fits'
>>> #imagefile = 'obs/bmp/img_00000.bmp'
>>> #imagefile = 'obs/npy/img_00000.npy'
>>> image = AstroImage.read_image(imagefile)
>>> image = AstroImage.read_image(image_array)
Print the raw grayscale image with the origin at the center of the bottom(the first row of array) left pixel.
>>> print(image.image_raw,image.res) # original grayscale image and its resolution
Show the raw image
>>> image.show()
>>> #image.show('figs/raw_image.png') # save image to a file
Extract the centroid coordinates of the star spots and do photometry
Estimate the centroids coordinates, brightness(sum of gray value within an aperture), and SNR of star spots.
>>> sources = image.find_source(fwhm=12,mask=True)
>>> print(sources.xy,sources.brightness,sources.snr,sources.offset)
Calculate the triangle invariants and construct a 2D Tree; and record the asterism indices for each triangle.
>>> sources.invariantfeatures()
>>> print(sources.invariants,sources.asterisms,sources.kdtree)
Show the extracted sources in image
>>> sources.show()
>>> #sources.show('figs/sources.png') # save image to a file
Change log
-
0.1.6 — Jun 29, 2023
- Added support for image file formats
.npy
andnumpy array
in function AstroImage.read_image()
- Added support for image file formats
-
0.1.5 — May 14, 2023
- The class
Centriod
is deprecated, and the classSource
is used instead - Add method
.invariantfeatures()
to classSource
, which calculates the triangle invariants and constructs a 2D Tree; and records the asterism indices for each triangle.
- The class
-
0.1.0 — Apr 5, 2023
- The starextractor package was released.
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for starextractor-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0e7dfde3fe097153ff4eb05821912ab9bf07b49fed1cbf39878cba5ff99004e |
|
MD5 | e54e61cfea8978da5bba4a6d2e928666 |
|
BLAKE2b-256 | 52745c274d16cbc28095951df529789756a4b426712196439e1bc289059b9c19 |