Skip to main content

A package to produce cutouts of (remote) FITS files.

Project description

cutout-fits

Actions Status Codecov Status Documentation Status

PyPI version

PyPI platforms

A utility to produce cutouts of FITS images using astropy. Remotely-hosted FITS images are fully supported using ffspec and s3fs.

Installation

From PyPI (stable):

pip install cutout-fits

From git (latest):

pip install git+https://github.com/AlecThomson/cutout-fits.git

Usage

The command-line tool can be invoked using cutout-fits entry point. Currently, spatial cutouts are specified using a centre right ascension and declination along with a cutout radius. Spectral cutouts are specified with a start and end frequency range.

Any additional cube dimensions, such as time or Stokes, will simply be included in the cutout. Further, any non-image HDUs present in the FITS file will also be simply included in the output file.

$ cutout-fits -h
usage: cutout-fits [-h] [--freq-start FREQ_START] [--freq-end FREQ_END] [-o] [-v] infile outfile ra_deg dec_deg radius_arcmin

Make a cutout of a FITS file

positional arguments:
  infile                Path to input FITS file - can be a remote URL
  outfile               Path to output FITS file
  ra_deg                Centre RA in degrees
  dec_deg               Centre Dec in degrees
  radius_arcmin         Cutout radius in arcminutes

options:
  -h, --help            show this help message and exit
  --freq-start FREQ_START
                        Start frequency in Hz
  --freq-end FREQ_END   End frequency in Hz
  -o, --overwrite       Overwrite output file if it exists
  -v, --verbosity       Increase output verbosity

Further API documentation is provided on read the docs.

Remote files

If accessing a remote file on S3, you'll need to set your access keys. To do this, fsspec looks for the following environment variables:

FSSPEC_S3_ENDPOINT_URL='https://...'
FSSPEC_S3_KEY='...'
FSSPEC_S3_SECRET='...'

This project support using a .env file to store these variables, if needed. Simply set these variables in a .env files in your current working directory or set them in your environment if you wish. Be careful not to commit them to VCS.

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

cutout_fits-0.0.6.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

cutout_fits-0.0.6-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file cutout_fits-0.0.6.tar.gz.

File metadata

  • Download URL: cutout_fits-0.0.6.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cutout_fits-0.0.6.tar.gz
Algorithm Hash digest
SHA256 78c2ed97e91ce6e8d98793491c4a792c49d74ea5cd54262b6f8c5fb572d64071
MD5 a46a4a25e49d835f4da6cb113ec634e2
BLAKE2b-256 282eea8ec453053290c8f85bf7d21d9cfec6ff9c9020f85c01d313068ae568e8

See more details on using hashes here.

File details

Details for the file cutout_fits-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cutout_fits-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cutout_fits-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9e3803bfdd7e9abd87a8dc62dbdff6fe2a4fd0af90f796fc209448701294fb80
MD5 b3fb3ecc8112d93f820911b812c2fa63
BLAKE2b-256 778a88e825263ee8076bde443685ee761158918fb3a9252ef8a20efb4f873acc

See more details on using hashes here.

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