Skip to content

DatumRange should have subtract Datum method to implement shift #195

Open

Description

@jbfaden

Datum has an add method so that you can say datum('2026-10-23T01:00') + datum('5hr') and get datum('2026-10-23T06:00'). There are no add or subtract methods on DatumRange though, and it would be nice if you could say datumRange('2026-10-23') + datum('5hr') to get a 24-hour window starting at 2026-10-23T05:00. I would use this immediately with a TRACERS digitizer, where I need to shift a time range selected on TS1 to get a corresponding time range on TS2 15 seconds earlier.

For now I introduced a method subtract:

def drSubtract(tr,t):
    return datumRange([tr.min()-t,tr.max()-t])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions