Skip to main content

A package to extract stars from an astronomical image

Project description

Welcome to the STAREXTRACTOR package

PyPI version shields.io PyPI pyversions PyPI status GitHub contributors Maintenance GitHub license Documentation Status Build Status

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:

  1. Read an astronomical image captured by cameras in fits format or in generic image format;
  2. Search for stars, extract their centroids and do photometry using photutils;
  3. Show raw image with star 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'
>>> image = AstroImage.read_image(imagefile)

Output the raw grayscale image with origin at bottom(the first row) left corner point.

>>> rawimage = image.rawimage
>>> print(image.raw_image,image.res) # image resolution

Show raw image

>>> image.show_image()
>>> #image.show_image('figs/raw_image.png') # save image to a file

Search for stars, extract their centroids and do photometry

Estimate the centroids coordinates, brightness(sum of grayvalue within an aperture), and SNR of star spots.

>>> centroids = image.find_centroid(fwhm=12,max_control_points=50,mask=True)
>>> print(centroids.xy,centroids.brightness,centroids.snr)

Show raw image

>>> centroids.show_image()
>>> #centroids.show_image('figs/centroids.png') # save image to a file

Change log

  • 0.1.0 — Apr 5, 2023

    • The starextractor package was released.

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

starextractor-0.1.1-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page