act.utils.adjust_timestamp#

act.utils.adjust_timestamp(ds, time_bounds='time_bounds', align='left', offset=None)[source]#

Will adjust the timestamp based on the time_bounds or other information so that the timestamp aligns with user preference.

Will work to adjust the times based on the time_bounds variable but if it’s not available will rely on the user supplied input

Parameters:
  • ds (Xarray Dataset) – Dataset to adjust

  • time_bounds (str) – Name of the time_bounds variable

  • align (str) –

    Alignment of the time when using time_bounds.

    left: Sets timestamp to start of sample interval right: Sets timestamp to end of sample interval center: Sets timestamp to middle of sample interval

  • offset (int) – Time in seconds to offset the timestamp. This overrides the time_bounds variable and can be positive or negative. Required to be in seconds

Returns:

ds (Xarray DataSet) – Adjusted DataSet