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.55

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.55
File Size Uploaded
pandorafits-0.7.55.tar.gz 250.3 kB Details

Built distribution (wheel)

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

Total release size: 567.6 kB

Release files / pandorafits-0.7.55.tar.gz

Download URL pandorafits-0.7.55.tar.gz
Size 250.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a07535605f1cf7f9b3a57ebdb4cbe4decc61a0570ea10312693c6a2fd589899d
BLAKE2b-256 checksum
How to use checksums
9d33a39103e42fe4d9f475f9fd0d7f26adb284acafc455ac0b85e4181af837fc
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.55-py3-none-any.whl

Download URL pandorafits-0.7.55-py3-none-any.whl
Size 317.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
603a632474803e8542f700489ae188a0c679a45a42d0fa0ae1dab8308a474476
BLAKE2b-256 checksum
How to use checksums
79f85de9f59b9977a007874159afe29a213e8f7d54e06feb7e074de5e6c55fa4
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

This release

0.7.55 This release

2 release files

0.7.7

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