read#

lsst.images.ndf.read(cls: type[T], path: str | ParseResult | ResourcePath | Path, **kwargs: Any) ReadResult#

Read an object from an NDF (HDS-on-HDF5) file.

If the file has a /MORE/LSST/JSON tree it is used as the source of truth and cls.deserialize is invoked with the parsed model. Otherwise the reader falls back to auto-detection of a minimal recognised-component set (DATA_ARRAY, VARIANCE, QUALITY, MORE.FITS); WCS is logged-and-dropped in v1.

Parameters#

cls

Expected return type. Image and MaskedImage are the only types the auto-detect path can produce. The symmetric path accepts whatever the file’s discriminator says.

path

File path or lsst.resources.ResourcePathExpression.

**kwargs

Forwarded to cls.deserialize on the symmetric read path.

Returns#

ReadResult [T]

Named tuple of (deserialized object, metadata, butler_info).