semantique.processor.arrays.Array.write_tz

Contents

semantique.processor.arrays.Array.write_tz#

Array.write_tz(tz, inplace=False)[source]#

Store the timezone of the array as non-dimension coordinate.

The timezone of the temporal coordinates is stored as attribute of a specific non-dimension coordinate named “temporal_ref”. Storing this inside a non-dimension coordinate rather than as direct attribute of the array guarantees that this information is preserved during any kind of operation. The coordinate itself serves merely as a placeholder.

Parameters:
  • tz – The timezone to store. Can be given as str referring to the name of a timezone in the tz database, or as instance of any class inheriting from datetime.tzinfo.

  • inplace (bool) – Should the array be modified inplace?

Returns:

xarray.DataArray – The input array with the timezone stored in a non-dimension coordinate.