write#
- lsst.images.ndf.write(obj, filename=None, *, metadata=None, butler_info=None, compression_options=None)#
Write a serializable object to an NDF (HDS-on-HDF5) file.
- Parameters:
obj (
Any) – Object with aserializemethod. May carry an_opaque_metadataattribute (aFitsOpaqueMetadata) whose primary-HDU header gets written to/MORE/FITS. This preserves FITS cards on objects that originated from a FITS read; butler provenance is conveyed throughbutler_infoinstead.filename (
str|Path|None, default:None) – Path to write to. Must not already exist. IfNone, an in-memory HDF5 file is used and the on-disk artefact is discarded; the returned tree still reflects all the writes the archive made (useful for tests).metadata (
dict[str,TypeAliasType] |None, default:None) – Optional caller-supplied entries that are written into the returnedArchiveTree.butler_info (
ButlerInfo|None, default:None) – Optional caller-supplied entries that are written into the returnedArchiveTree.compression_options (
Mapping[str,Any] |None, default:None) – Optional dict forwarded to the archive constructor for h5py dataset compression.
- Returns:
The Pydantic tree the object’s
serializeproduced (withmetadata/butler_infoapplied).- Return type: