A package to produce cutouts of (remote) FITS files.
Project description
cutout-fits
A utility to produce cutouts of FITS images using astropy
. Remotely-hosted
FITS images a 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
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 Distribution
Built Distribution
File details
Details for the file cutout_fits-0.0.5.tar.gz
.
File metadata
- Download URL: cutout_fits-0.0.5.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49247d8a6ad619042c5e8470ffc2d7825e97faf2944468470bdfb1a9495c4cdc |
|
MD5 | 77b6fe5a5ed5e6a3f1e1918b4f42f210 |
|
BLAKE2b-256 | 09fa8f3edc0d59930bf0597f572808ded7266e76e4ecc0e9639f17a97237f6ef |
File details
Details for the file cutout_fits-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: cutout_fits-0.0.5-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d9a88a61e95218ecdeda231d6351de6f417a34ef9f632a8d1e617ac08429703 |
|
MD5 | ad5e480dd69678d5efa059c03100b667 |
|
BLAKE2b-256 | 61cebeede101641fbeaa93c59f1cb7399c68131a4dac59ad40868b3f59426e0b |