pycfitsio: Python ctypes wrapper for cfitsio
============================================
Features
========
* read binary tables using hdu and column names into simple dictionaries of arrays
* write FITS files incrementally 1 HDU at a time
Requirements
============
pycfitsio requires the dynamic library cfitsio, in linux it usually packaged as libcfitsio-dev
Install
=======
pip install pycfitsio #stable version
# for development version clone from github and run
python setup.py install
Examples
=======
Reading
_______
>>> f = pycfitsio.open("debug/data.fits")
>>> hdulist = f.HDUs
>>> print(hdulist)
OrderedDict([('DATA', HDU: DATA)])
>>> hdu = f['DATA']
>>> column_array = f['DATA'].read_column('signal')
>>> all_columns = f['DATA'].read_all()
>>> print(all_columns)
OrderedDict([('signal', array([ 0., 1. ....])), 'flag', array([1, 1, ....])])
Writing
_______
>>> from collections import OrderedDict
>>> f = pycfitsio.create('file.fits')
3 options to write HDUs:
#. list of (name, array) tuples
>>> f.write_HDU('HDUNAME',
[('firstcolname', np.arange(10)), ('seccolname', np.arange(10)**2)]
)
#. OrderedDict keys = name values = array
>>> data = OrderedDict()
>>> data['firstcolname'] = np.arange(10)
>>> data['seccolname'] = np.arange(10)**2
>>> f.write_HDU('HDUNAME', data)
#. Compound numpy array
>>> data = np.ones(10, dtype = [('firstcolname', np.long), ('seccolname', np.double)])
>>> f.write_HDU('HDUNAME', data)
>>> f.close()
Metadata
Release files for pycfitsio 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pycfitsio-0.3.0.tar.gz | 21.5 kB | Without provenance | Details |
Release files / pycfitsio-0.3.0.tar.gz
| Download URL | pycfitsio-0.3.0.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba888de8d42bdc88405f22e901447344e4aad573547f2a8746a143f53646295b
|
|
BLAKE2b-256 checksum How to use checksums |
8f221cc23e5a6991c9bf7f3cb20cc962695aeea04a5359f3d4fd5bc975c5d9e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pycfitsio 0.3.0
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.