Skip to content

Feature/bl11012 fits adapter - #14

Open
taxe10 wants to merge 2 commits into
mainfrom
feature/bl11012-fits-adapter
Open

taxe10 wants to merge 2 commits into
mainfrom
feature/bl11012-fits-adapter

Conversation

@taxe10

@taxe10 taxe10 commented Oct 3, 2026

Copy link
Copy Markdown

Summary

Adds a Tiled adapter for the CCD FITS files written at ALS BL11.0.1.2 (RSoXS).

  • The primary HDU holds only metadata. Its cards, including HIERARCH keys like "EPU Polarization", become node metadata.
  • The frame is read from the Images extension. If that is missing, it falls back to the first 2-D extension, then to the primary HDU.
  • The image HDU header is nested under image_hdu so it does not overwrite the primary header.
  • Small tables such as Izeros are copied into extensions. Tables over 1024 rows are summarized instead.
  • Files are opened without memory-mapping because the frames use BZERO=32768. Arrays are converted to native byte order.

Changes

  • splash_tiled.bl11012.adapters.fits:FITSAdapter, with spec als-bl11012-fits.
  • A bl11012 extra (astropy) and a matching pixi feature.
  • .fits mapped to application/fits in tiled_config/config.yaml.
  • The Containerfile installs .[bl733,bl11012].
  • A strict mypy section for splash_tiled.bl11012.adapters.*.

Testing

pytest tests/bl11012 runs 13 tests on synthetic FITS files. They cover the adapter directly and a full round trip through register() and a Tiled server.

taxe10 and others added 2 commits October 2, 2026 17:32
Reads ALS CCD FITS frames where the primary HDU is metadata-only and the
image lives in an extension named 'Images'. Primary-header cards (including
HIERARCH keys) become node metadata, the image header is nested under
'image_hdu', and small tables such as 'Izeros' are copied into 'extensions'.

Adds a bl11012 extra (astropy), maps .fits to application/fits in the server
config, installs the extra in the container, and type-checks the adapter
strictly like bl733.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Synthetic FITS files mirror the beamline layout. Covers HDU selection and
fallbacks, byte order, JSON-safe metadata, table capture, and a round trip
through register() and a Tiled server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@taxe10
taxe10 requested a review from Wiebke October 3, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant