pyunitwizard.storage.asdf.to_tree#

pyunitwizard.storage.asdf.to_tree(record)[source]#

Create a detached ASDF tree containing a native quantity and sealed header.

Parameters:

record (QuantityRecord) – Homogeneous scalar or array in a multiplicative physical unit.

Returns:

quantity is an Astropy Quantity; pyunitwizard binds its unit spelling to the original qrec metadata. Both are detached from input.

Return type:

dict

Raises:
  • RecordError – For unsupported layout, offset or native/provider definition drift.

  • ModuleNotFoundError – If ASDF or asdf-astropy is absent.

Examples

>>> tree = to_tree(record)