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 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
Universal cutouts
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] [-o] [-v] [--freq-start FREQ_START] [--freq-end FREQ_END] infile outfile ra_deg dec_deg radius_arcmin
Make a cutout of a FITS file
options:
-h, --help show this help message and exit
File options:
infile Path to input FITS file - can be a remote URL
outfile Path to output FITS file
-o, --overwrite Overwrite output file if it exists
-v, --verbosity Increase output verbosity
Cutout options:
ra_deg Centre RA in degrees
dec_deg Centre Dec in degrees
radius_arcmin Cutout radius in arcminutes
--freq-start FREQ_START
Start frequency in Hz
--freq-end FREQ_END End frequency in Hz
CASDA Access
Cutouts from the CSIRO ASKAP Science Data Archive
(CASDA) can be made by invoking the
cutout-casda entry point. The same set of cutout arguments as cutout-fits
are supported
$ cutout-casda -h
usage: cutout-casda [-h] [--freq-start FREQ_START] [--freq-end FREQ_END] [--username USERNAME] [--store-password] [--reenter-password] [-v]
ra_deg dec_deg radius_arcmin filename [filename ...]
Make a cutout of a FITS file on CASDA
options:
-h, --help show this help message and exit
Cutout options:
ra_deg Centre RA in degrees
dec_deg Centre Dec in degrees
radius_arcmin Cutout radius in arcminutes
--freq-start FREQ_START
Start frequency in Hz
--freq-end FREQ_END End frequency in Hz
CASDA options:
filename FITS file name(s)
--username USERNAME CASDA username
--store-password Store password in keyring
--reenter-password Re-enter password
-v, --verbosity Increase output verbosity
The
CASDA Astroquery API
requires an OPAL username and password to login.
You can supply your username via the CLI or as the CASDA_USERNAME environment
variable. Astroquery supports caching your password, which you will need if
running non-interactively. To cache your password you can interactively run the
helper script casda-login:
$ casda-login -h
usage: casda-login [-h] username
Login to CASDA and save credentials
positional arguments:
username Username for CASDA
options:
-h, --help show this help message and exit
Python API
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
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 cutout_fits-0.1.1.tar.gz.
File metadata
- Download URL: cutout_fits-0.1.1.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb200c8852d8774d9fe2187e8b03be2bfc25fee4265ed518e48e16e3ae6e4b4
|
|
| MD5 |
5bf12bdaac85e25b7391097e55ee2cea
|
|
| BLAKE2b-256 |
c0b67b508b967ee0d194b400ccee79e1761ea7920eb6fffb905dc74e60a0eb03
|
Provenance
The following attestation bundles were made for cutout_fits-0.1.1.tar.gz:
Publisher:
cd.yml on AlecThomson/cutout-fits
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cutout_fits-0.1.1.tar.gz -
Subject digest:
eeb200c8852d8774d9fe2187e8b03be2bfc25fee4265ed518e48e16e3ae6e4b4 - Sigstore transparency entry: 154367684
- Sigstore integration time:
-
Permalink:
AlecThomson/cutout-fits@d38aa1ffa00bd0bb555ce3999ecaed6b0f93dbc2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@d38aa1ffa00bd0bb555ce3999ecaed6b0f93dbc2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cutout_fits-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cutout_fits-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d890aebafee1ca088a2524509fa1a13aa78aba2391154dc959e1aa6a84302fe
|
|
| MD5 |
e0528aeb94fe05f126ad70b0d678ec2d
|
|
| BLAKE2b-256 |
970914687fd5a40943e1f8bc89de4e1831fdfa64b56847b8c6f87a4115420fcb
|
Provenance
The following attestation bundles were made for cutout_fits-0.1.1-py3-none-any.whl:
Publisher:
cd.yml on AlecThomson/cutout-fits
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cutout_fits-0.1.1-py3-none-any.whl -
Subject digest:
9d890aebafee1ca088a2524509fa1a13aa78aba2391154dc959e1aa6a84302fe - Sigstore transparency entry: 154367685
- Sigstore integration time:
-
Permalink:
AlecThomson/cutout-fits@d38aa1ffa00bd0bb555ce3999ecaed6b0f93dbc2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@d38aa1ffa00bd0bb555ce3999ecaed6b0f93dbc2 -
Trigger Event:
release
-
Statement type: