Skip to main content

JanusReader

Version DOI

JanusReader is the official Python library for reading data from the JANUS instrument on board ESA's JUICE mission. It loads image pixels and metadata from the accompanying PDS4 label.

DOI: 10.5281/zenodo.13364878

Installation

The current source version is 0.18.0 and requires Python >=3.14,<4.

Install the published package:

python3 -m pip install JanusReader

To install the version in this checkout:

python3 -m pip install -e .

The published package may differ from the source version. Check the installed version with:

python3 -m JanusReader --version

The CLI reads its version from installed package metadata. Reinstall the checkout after changing the version in pyproject.toml to refresh that metadata.

Input products

Keep the image file and its matching .lblx label in the same directory, with the same basename.

Input Behavior
.vic Reads raw pixels as a NumPy uint16 array, using the offset and dimensions in the label.
.dat Reads calibrated pixels as a NumPy float32 array. The file must contain exactly the image pixels; this read does not apply the label offset.
.lblx or .xml Resolves to .vic when the filename contains raw, or to .dat when it contains cal. It then loads the matching .lblx label, even when the supplied suffix is .xml.

Pixel interpretation follows the label's processing_level: raw uses the raw reader; other levels use the calibrated reader. Both readers use NumPy's native byte order.

For calibrated products, the filename must follow the JANUS naming convention: the fourth underscore-separated component from the end contains a leading character followed by the hexadecimal skipped-calibration bit mask (for example, a_b_c_c03_d_e_tail.dat). Arbitrary calibrated filenames are not supported.

Python usage

from JanusReader import JanusReader

product = JanusReader("datafile.vic")
image = product.image  # NumPy array with shape (Lines, Samples)

print(product.target, product.level)
print(product.startDT, product.endDT)
product.Show()          # General product information
product.Show(all=True)  # Includes processing and instrument metadata

# Each distance is None when its XML field is unavailable.
spacecraft_solar_distance = product.spacecraftSolarDistance
target_solar_distance = product.targetSolarDistance

The constructor accepts a string or pathlib.Path, an optional Rich console, and the boolean options debug and vicar (both default to False). Set vicar=True to parse the embedded raw VICAR header into product.vicar; calibrated .dat products ignore this option with a warning.

Common attributes

Attribute names are case-sensitive.

Attribute Contents
image, Lines, Samples Image array and dimensions.
fileName, labelFile Resolved image and label paths.
title, prodVersion, level, dataDesc Product identification, last modification version, processing level, and optional observation comment.
startDT, endDT, creationDate Python datetime values without timezone information.
startSC, endSC Spacecraft clock counts from the label.
target, phaseName, phaseID, startOrbit Target and mission context.
Exposure, Filter, subFrame, instrumentState Exposure, filter, subframe, and instrument temperature metadata.
onBoardProcessing, onGroundProcessing, proceesingContext Processing metadata; proceesingContext retains its existing API spelling.
spacecraftSolarDistance, targetSolarDistance Heliocentric distance values as stored in the label, without unit conversion.
skippedCalibrationSteps Calibrated-product object with a .steps list; None for raw products.

Since 0.18.0, psa:stop_orbit_number is no longer read, endOrbit is no longer created, and the information display omits End Orbit. Use startOrbit for the available orbit metadata.

Missing scalar label values generally produce a warning and return None; missing required XML structures can raise IndexError. Missing files raise FileNotFoundError, and malformed XML raises a parser error. With vicar=True, an invalid raw VICAR header raises JanusReader.exceptions.NOT_VALID_VICAR_FILE.

Command line

janusReader datafile.vic
janusReader --all datafile.vic
janusReader --debug datafile.vic
janusReader --show-skipped-process a_b_c_c03_d_e_tail.dat
janusReader --version
janusReader --help

The default output shows general product information. --all (-a) adds instrument and processing tables; --show-skipped-process (-s) displays skipped calibration steps instead. --debug (-d) prints input-type diagnostics, and --help (-h) lists the options.

The same CLI is available through the active Python interpreter:

python3 -m JanusReader --help

Development

Install the checkout and test tools in a virtual environment:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e . pytest pytest-cov ruff
python -m pytest

The repository's pytest configuration writes coverage reports under coverage/. Tests use synthetic products to check image loading, label compatibility, metadata helpers, and VICAR header parsing.

See CHNGELOG.md for version history.

Metadata

Release files for JanusReader 0.18.1

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

Source distribution (sdist)

Source distribution for JanusReader 0.18.1
File Size Uploaded
janusreader-0.18.1.tar.gz 12.4 kB Details

Built distribution (wheel)

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

Total release size: 24.2 kB

Release files / janusreader-0.18.1.tar.gz

Download URL janusreader-0.18.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6e87fc7560e8d665e2357a466177c8884016811d8c35179c36b65a34469de1a8
BLAKE2b-256 checksum
How to use checksums
a068dd0bf669da7777d36dc5e168d570b8a0eae53158ee05b63767b9b04481bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.13.7 Darwin/27.0.0

Release files / janusreader-0.18.1-py3-none-any.whl

Download URL janusreader-0.18.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
738a82c6275e4ea42b1cc7157e49a307559f75dbe182d59773a641ffc4857763
BLAKE2b-256 checksum
How to use checksums
71c9faed3d89888dd55cc873384fd1a6c98e1bb54525eaa1222905a39f6ebcb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.13.7 Darwin/27.0.0

Release history Release notifications | RSS feed

0.18.3

2 release files

0.18.2

2 release files

This release

0.18.1 This release

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

1 release file

0.11.1

1 release file

0.11.0

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

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