das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

trim operator requires data be monotonic in time, consider support for unsorted timetags #100

Closed jbfaden closed 3 months ago

jbfaden commented 3 months ago

The trim operation requires that data be monotonic in time, because findex is used to locate the indices for the range. This can be done is O(log(N)) time, where N is the size of the dataset. We should support data with unsorted timetags as well. (Often a single timetag is out of order, breaking an Autoplot script which would otherwise work.) For the case where the times are not monotonic, an O(N) subset operation will still work fine.

jbfaden commented 3 months ago

I've updated Ops.trim to support this.