backend_for_path#

lsst.images.serialization.backend_for_path(path)#

Return the Backend for path based on its file extension.

Supported extensions: .fits (FITS), .h5 / .sdf (NDF), and .json (JSON), each optionally followed by a .gz or .zst compression suffix. The NDF and FITS backends are imported lazily so optional dependencies (e.g. h5py) are only required when actually used.

Parameters:

path (str | ParseResult | ResourcePath | Path) – Path whose file extension selects the backend.

Raises:

ValueError – If the extension is not recognized.

Return type:

Backend

This page was last modified on .