Skip to main content

Cornish is a Python interface over the Starlink AST astronomical software library, part of the Starlink Software Collection. Cornish is designed and written by Demitri Muna.

The Starlink AST library is a collection of tools for working with world coordinate systems and excels at coordinate system transformations, representing and working with regions on the celestial sphere (e.g. polygons, circles, boxes, etc.), plotting, and more.

A Python interface called starlink-ast written by the library’s authors, David Berry and Tim Jenness, is available, however it thinly exposes the C interface. A working knowledge of the C API is realistically a prerequisite to using starlink-ast. Similarly, the primary documentation for the library is the that of the C version which does not refer to the Python interface.

The aim of Cornish is to be a fully Pythonic interface to the library. It doesn’t replace the existing starlink-ast Python interface; rather, it is a wrapper around that. The current development focus is defining and working with regions on the sky. It accepts and returns Astropy objects where possible.

Cornish is currently under active development and all APIs are subject to change. It is not recommended to be used in a pipeline yet, but it is becoming increasingly mature and particularly useful for interactive use. The project is being released in this state as it is a dependency of the Trillian and SciDD projects.

Many thanks to David Berry for the generous and extremely responsive help and advice in the development of the library.

Examples

The main documentation (in progress) will be the primary reference for this library. A few examples demonstrate its capabilities.

from cornish import ASTRegion
from astropy.io import fits

# read FITS HDU (assuming a 2D image with a WCS)
hdu1 = fits.open("my_file.fits")[0]

# define a polygon around the border the image
polygon = ASTRegion.fromFITSHeader(hdu1.header)

# get a circle that bounds that polygon
circle = polygon.boundingCircle()

# create a polygon from a circle region
polygon2 = circle.toPolygon(npoints=20)

# check if polygons overlap
polygon.overlaps(polygon3)

(If it seems too simple… that’s kind of the point.)

Metadata

Release files for cornish 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cornish 1.1
File Size Uploaded Provenance
cornish-1.1.tar.gz 5.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cornish 1.1
File Interpreter ABI Platform
cornish-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / cornish-1.1.tar.gz

Download URL cornish-1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4125edb3f0bf59021334d4dfb98c87aa047dadd400d6344f66e7836638ca9edf
BLAKE2b-256 checksum
How to use checksums
8ed26f6144f3676a3cab404b3da2aea6fbe7b8f25b0ce8afa05edb882a3787c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.8

Release files / cornish-1.1-py3-none-any.whl

Download URL cornish-1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adfdf4fae587ca66496e56203811f809aeefd2a4b7ab11ad70091e5665c84f5a
BLAKE2b-256 checksum
How to use checksums
fdddec234abf405060eaa4fd2a000ca1c206883900a5327135553c2755486f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.8

Security for cornish 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page