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

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

Built distribution (wheel)

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

Total release size: 567.6 kB

Release files / pandorafits-0.7.6.tar.gz

Download URL pandorafits-0.7.6.tar.gz
Size 250.3 kB
Tags Source
SHA-256 checksum
How to use checksums
185f96fc13b9a4dee1f7a4cc444e4f13f02d31d72534133edeca9a54c4e229c5
BLAKE2b-256 checksum
How to use checksums
2e67a3ef992ee818d778a96eb8ab810049aa09e8926b95c429e583f334f223c4
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.6-py3-none-any.whl

Download URL pandorafits-0.7.6-py3-none-any.whl
Size 317.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
529547963275151723f76776614b9257fa03d159b5de6185fb28a6504c2d4a03
BLAKE2b-256 checksum
How to use checksums
dfb7fc2a09ac129166f4d6e1c93c4f56a903ad884663126990615ab407be0d27
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

0.7.7

2 release files

This release

0.7.6 This release

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