Skip to main content

pypi-badge Test status

pandora-fits

Tools to work with fits files from Pandora.

pandora-fits wraps astropy.io.fits.HDUList classes to ensure that files conform to Pandora FITS standards.

The standards are defined using excel files in the src/pandorasat/formats/ folder. Changing these files will change the standards that this tool checks against.

Pandora Detectors

Pandora has two detectors, VISDA and NIRDA. You can read more about each of these in pandora-sat.

Pandora File Levels

Pandora will have the following levels of files for each detector

Level Description
0 Raw data from spacecraft
1 Reorganized raw data, with potential for additional keywords
2 Calibrated image data products
3 Spectral time-series data, ready for science.

Exceptions

pandora-fits will throw exceptions if files are not in the correct format. This includes

  • Files do not have the right number of extensions
  • Extensions are not the correct type
  • Header keywords have the wrong values when compared with the template

Warnings

pandora-fits will log warnings if files are missing keyword headers, but those headers aren't valued in the excel spreadsheet.

Usage

You should treat the pandora-fits objects as though they were astropy.io.fits.HDUList objects. There is one per detector, per file level.

First you can import the correct HDUList object. Note that I am using the logger and setting the logger to the level "ERROR".

from pandorafits.nirda import NIRDALevel0HDUList
from pandorafits import logger
logger.setLevel("ERROR")

We can create a dummy file by passing nothing to the object

hdulist = NIRDALevel0HDUList()
hdulist.info()
Filename: (No file associated with this HDUList)
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU      35   ()      
  1  SCIENCE       1 ImageHDU        12   (80, 400, 10)   int16   

This initializes an "empty" file that is compliant with the Pandora scheme. There are several logger "warning" messages that will state that many of the header keywords are not set.

We can write to a file

hdulist.writeto("test.fits", overwrite=True)

We can also read in a file

hdulist = NIRDALevel0HDUList("test.fits")

Finally we can read in an existing HDUList, e.g.

hdulist = fits.HDUList("test.fits")
NIRDALevel0HDUList(hdulist)

Installation

You can install with a git clone, or via PyPI using the command below. Make sure to update to the most recent version.

pip install pandorafits --upgrade

If you need to run the pipeline and use the databasing features you will need to add the optional extras.

pip install "pandorafits[database]" --upgrade

Note if you're working on a windows machine this install might be harder and you should open an issue if you encounter any problems.

Release files for pandorafits 0.7.7

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

Source distribution (sdist)

Source distribution for pandorafits 0.7.7
File Size Uploaded
pandorafits-0.7.7.tar.gz 254.0 kB Details

Built distribution (wheel)

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

Total release size: 576.2 kB

Release files / pandorafits-0.7.7.tar.gz

Download URL pandorafits-0.7.7.tar.gz
Size 254.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2360a5719b9dfb509c20359fdde5361931285afde6f3bfddce10d168caecad52
BLAKE2b-256 checksum
How to use checksums
a77e3685225995050c02740251bffb6e709ead251d9a4df8f9f21c248873861d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.9.13 Darwin/25.6.0

Release files / pandorafits-0.7.7-py3-none-any.whl

Download URL pandorafits-0.7.7-py3-none-any.whl
Size 322.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb57e0130495ea3cbbc954baec2be58ec3b6f92bf005c0b80274ef9137044cf4
BLAKE2b-256 checksum
How to use checksums
61842ee28eb9e4ba97974f74c993074b274d0f60ff3e3364985c26fae606f963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.9.13 Darwin/25.6.0

Release history Release notifications | RSS feed

0.7.55

2 release files

This release

0.7.7 This release

2 release files

0.7.6

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.5.7

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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