backend_for_path#
- lsst.images.serialization.backend_for_path(path)#
Return the
Backendforpathbased on its file extension.Supported extensions:
.fits(FITS),.h5/.sdf(NDF), and.json(JSON), each optionally followed by a.gzor.zstcompression 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: