beacon-biosignals / OndaEDF.jl

utilities for importing/exporting EDF Files to/from Onda datasets
Other
3 stars 2 forks source link

offset `EDF.Signals` in time based on their start_nanosecond value in an `Onda.Signal` #2

Closed jrevels closed 1 year ago

jrevels commented 3 years ago

(transferred from https://github.com/beacon-biosignals/OldOndaEDF.jl/issues/14)

from @OTDE:

Onda.Signals can have non-zero offsets from the start of a recording. If multiple Onda.Signals in a recording are present in a recording, we should be able to offset the samples in their corresponding EDF.Signals from the rest of the signals in the EDF.File. One way to do this would be to pad the ends of the samples for a signal with the appropriate "zero" value (determined by sample_offset_in_unit) such that the signal's start time aligns with its value in its Onda.Signal.

kleinschmidt commented 1 year ago

Not sure if this is a bug or an enhancement...export doesn't consume Signals, it consumes Samples, which don't have a sense of start time baked into them anymore. So we'd need to somehow pass that information in as well.

jrevels commented 1 year ago

export doesn't consume Signals, it consumes Samples, which don't have a sense of start time baked into them anymore

yeah, I'd be very okay with just closing this at this point

if we wanted to support something akin to this these days, we could add generic utility function(s) to Onda for padding sample data chunks and/or concatenating discontiguous chunks according to caller-provided signal metadata. then users could just use those utilities as desired before passing their sample data to OndaEDF for export

kleinschmidt commented 1 year ago

generic utility function(s) to Onda for padding sample data chunks and/or concatenating discontiguous chunks according to caller-provided signal metadata

yeah Onda seems like a better place to host this ability.