makeObservationInfo#

astro_metadata_translator.makeObservationInfo(*, extensions=None, translator_class=None, **kwargs)#

Construct an ObservationInfo from the supplied parameters.

Parameters:
  • extensions (dict [str: PropertyDefinition], optional) – Optional extension definitions, indexed by extension name (without the ext_ prefix, which will be added by ObservationInfo).

  • translator_class (MetadataTranslator-class, optional) – Optional translator class defining the extension properties. If provided, this can be used instead of extensions and will be stored in the instance for JSON round-tripping.

  • **kwargs (Any) – Name-value pairs for any properties to be set. In the case of extension properties, the names should include the ext_ prefix.

Return type:

ObservationInfo

Notes

The supplied parameters should use names matching the property. The type of the supplied value will be checked against the property. Any properties not supplied will be assigned a value of None.

Raises:
  • KeyError – Raised if a supplied parameter key is not a known property.

  • TypeError – Raised if a supplied value does not match the expected type of the property.