Closed mbauman closed 9 years ago
Some initial trial stuff committed in 3210e1d3451a3f3f795c2eed58d218ef19557035.
I think I like the idea of using SIUnits for seconds. It works fairly well in practice.
I'm going to punt on partitions and combinations until I actually have a use-case for them. I think that this issue is complete to the point I'd like to be.
It'd be very nice to have an API to specify that you want the first 10 seconds of a Signal. Or the last 20. Or 5 < t < 32.
But I don't know how to name this function.Simply namedwithtime(::Signal; start=5, stop=32)
?subtime(::Signal; from=5, upto=32)
? I don't have a good vocabulary for this.before
,after
, andwithin
, accepting one or two arguments in either indices (::Real
) or seconds (::SIQuantity{…}
).The TimeArray over in TimeSeries.jl has a great thing going for it: it's time indexes are of a different datatype than its column names. So whether you get a row or column depends upon the type you index a TimeArray with. It's very clever.
Perhaps we could use SIUnits here for that. Do I want to enforce that all time signals be defined in seconds? But then if I index with a FloatRange of Seconds, do I re-interpolate to those values? Hrm. I don't know if this solves the general "give me the first 10 seconds" problem.
And then what would it return? It could be a SubSignal type to provide a view instead of copying all the channels… but a simple first pass would just be a new Signal.
API:
timebefore, timeafter, timewithin and their idxs counterparts~before
,after
andwithin
.