write#

lsst.images.fits.write(obj, path, compression_options=None, update_header=<function no_header_updates>, compression_seed=None, metadata=None, butler_info=None)#

Write an object with a serialize method to a FITS file.

Parameters:
  • obj (Any) – Object with a serialize method to write.

  • path (Path | str) – Name of the file to write to. Must not already exist.

  • compression_options (Mapping[str, FitsCompressionOptions | None] | None, default: None) – Options for how to compress the FITS file, keyed by the name of the attribute (with JSON pointer / separators for nested attributes).

  • update_header (Callable[[Header], None], default: <function no_header_updates at 0x7f27576196c0>) – A callback that will be given the primary HDU FITS header and an opportunity to modify it.

  • compression_seed (int | None, default: None) – A FITS tile compression seed to use whenever the configured compression seed is None or (for backwards compatibility) 0. This value is then incremented every time it is used.

  • metadata (dict[str, TypeAliasType] | None, default: None) – Additional metadata to save with the object. This will override any flexible metadata carried by the object itself with the same keys.

  • butler_info (ButlerInfo | None, default: None) – Butler information to store in the file.

Returns:

The serialized representation of the object.

Return type:

serialization.ArchiveTree

This page was last modified on .