Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DKIST Data Validator

codecov

An interface containing a validator and a spec translator for DKIST FITS specs SPEC122 and SPEC214:

  • SPEC-0122: Data received from the summit

  • SPEC-0214 l0: Data ingested and parsed by the Data Center

  • SPEC-0214: Data published by the Data Center (incomplete)

The validator references a machine readable version of the DKIST Header Specifications which are defined here in the dkist-fits-specifications package. Unless otherwise specified, the latest version of dkist-fits-specifications package is installed along with the validator. Data can be validated against past revisions of the DKIST Header Specifications if a previous version of the dkist-fits-specifications package is installed. If you are receiving validation errors, please reference the version of the DKIST Header Specifications identified in the dkist-fits-specifications package to make sure that your headers are expected to be compliant with that version.

Features

  • Uses voluptuous schemas to validate a given input header against dkist specifications

  • 3 keyword validations: type validation, required-ness validation, and value validation

  • Failure exceptions include a dictionary of validation failure causes

  • SPEC-0122 to SPEC-0214 l0 translation

Installation

pip install dkist-header-validator

Usage

Currently, this package can be used to validate SPEC122 data or SPEC214 data. Please import the corresponding methods (spec122_validator and Spec122ValidationException, or spec214_validator and Spec214ValidationException, or spec214_l0_validator and Spec214ValidationException).

Input data can be one of:

  • fits.Header object

  • fits.PrimaryHDU or fits.ImageHDU or fits.CompImageHDU object

  • HDUList object

  • File path to an HDUList object

To validate an object in memory:

>>> from dkist_header_validator import spec122_validator, Spec122ValidationException
>>> from astropy.io import fits
>>> hdul = fits.open('dkist_rosa0181200000_observation.fits')
>>> validated_hdul = spec122_validator.validate(hdul)
>>> # or
>>> validated_hdu = spec122_validator.validate(hdul[1])
>>> # or
>>> validated_header = spec122_validator.validate(hdul[1].header)

Or, validate an object on disk directly:

>>> from dkist_header_validator import spec122_validator, Spec122ValidationException
>>> filepath = spec122_validator.validate('dkist_rosa0181200000_observation.fits')

Note that the return is just the input. If no errors or exceptions are raised, the header is valid. The validate method also accepts the boolean flag extra, which determines if extra keywords are allowed in the validation schema. Default value is extra=True.

The CLI can also be used to validate files:

$ dkist-header-validator validate122 "path/to/file.fits"
$ dkist-header-validator validate214 "path/to/file.fits"

In addition, this package can be used to translate headers from SPEC122 to SPEC214 l0:

>>> from dkist_header_validator import translate_spec122_to_spec214_l0
>>> translated_hdul = translate_spec122_to_spec214_l0('dkist_rosa0181200000_observation.fits')

The return in this case is the an HDUList with a translated header and the original data.

This project is Copyright (c) AURA/NSO.

Metadata

Release files for dkist-header-validator 6.0.1rc1

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

Source distribution (sdist)

Source distribution for dkist-header-validator 6.0.1rc1
File Size Uploaded Provenance Actions
dkist_header_validator-6.0.1rc1.tar.gz 29.1 kB Without provenance Details for dkist_header_validator-6.0.1rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dkist-header-validator 6.0.1rc1
File Interpreter ABI Platform Actions
dkist_header_validator-6.0.1rc1-py3-none-any.whl Python 3 none any Details for dkist_header_validator-6.0.1rc1-py3-none-any.whl

Total release size: 60.0 kB

Release files / dkist_header_validator-6.0.1rc1.tar.gz

Download URL dkist_header_validator-6.0.1rc1.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
789168da2f3727031bfc439505a5b825755d668ee55c74cc5a34371403407e83
BLAKE2b-256 checksum
How to use checksums
3b657f680668602723beab4158743cd6da6bb20ea776fbd26d6236521c03a5e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Release files / dkist_header_validator-6.0.1rc1-py3-none-any.whl

Download URL dkist_header_validator-6.0.1rc1-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c278ce8b224cb31a0d17d851c32b754a56e67597428b169e3c1af94dfe7ff186
BLAKE2b-256 checksum
How to use checksums
69acbe336a77058bd872b6009843f38076b61e5affe92904354d063875b4aa2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Security for dkist-header-validator 6.0.1rc1

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.

Release history Release notifications | RSS feed

This release
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