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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandorafits-0.5.5.tar.gz (255.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandorafits-0.5.5-py3-none-any.whl (322.0 kB view details)

Uploaded Python 3

File details

Details for the file pandorafits-0.5.5.tar.gz.

File metadata

  • Download URL: pandorafits-0.5.5.tar.gz
  • Upload date:
  • Size: 255.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.13 Darwin/25.5.0

File hashes

Hashes for pandorafits-0.5.5.tar.gz
Algorithm Hash digest
SHA256 ecb64fedb3bc94fa221f739fd5b5370c364d288d84224d4ff8e2c579e6572959
MD5 21ce5d91fab81d9afca5ed8007b4bb7e
BLAKE2b-256 2b73059de1e547267ba41de2ed0980b58de26094c991b21610b56662b5d6788f

See more details on using hashes here.

File details

Details for the file pandorafits-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: pandorafits-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 322.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.13 Darwin/25.5.0

File hashes

Hashes for pandorafits-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 edeb4e0f4ed7d0c2142864858dfc28eab77f90a233e4094a3077edad0a6baf46
MD5 8b314b04de03c017bb4b3574fb2d6602
BLAKE2b-256 f5513770862e12fb8cc22a7535a95cec8de285e7f330cf0ce0cb4bab7a5358d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page