mbauman / Signals.jl

An abandoned work-in-progress for a high level Signal type with a common timebase (in seconds) and groups of channels. Deprecated in favor of AxisArrays.jl.
github.com/JuliaArrays/AxisArrays.jl
Other
6 stars 0 forks source link

Time restriction/selection API #4

Closed mbauman closed 9 years ago

mbauman commented 10 years ago

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. withtime(::Signal; start=5, stop=32)? subtime(::Signal; from=5, upto=32)? I don't have a good vocabulary for this. Simply named before, after, and within, 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:

mbauman commented 10 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.

mbauman commented 9 years ago

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.