backend_for_path#

lsst.images.serialization.backend_for_path(path: str | ParseResult | ResourcePath | Path) Backend#

Return the Backend for path based on its file extension.

Supported extensions: .fits / .fits.gz (FITS), .sdf / .ndf (NDF), and .json (JSON). The NDF and FITS backends are imported lazily so optional dependencies (e.g. h5py) are only required when actually used.

Raises#

ValueError

If the extension is not recognised.