You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Making possible to edit first_samp after using crop #13278
I want to suggest the possibility to change the first_samp attribute when using crop on a raw object.
I understand that the reason why this attribute does not start at 0 is to mantain a record of the time frame of the original signal where the segment was extracted, but there are cases where you owuld like to treat the cropped segments as independient signals.
It has been suggested to usea RawArrays as an alternative to reset first_samp values, but in my point of view, implementing the option on the crop function makes it easier and faster.
Describe your proposed implementation
Just that, the ability to reset the value of the attribute to treat cropped signals independient raw objects.
Describe possible alternatives
Another alternative is to include information on the documentation about the way crop treats the first _samp on the segments and alternatives to reset it, because this is not noted, and by looking at different entries both on the forum and github we can tell is not that obvious.
I guess we could add a reset_first_samp=False default where if you set it to True would have the desired behavior. I could live with it as long as we document that it could mess things up (e.g., if you extract events then crop with reset_first_samp=True and try to use those original events, things will be broken).
HI @lilly-sanchezz@larsoner , I'd be happy to start with the documentation improvement while
the feature design is being discussed. I can add a note to the
crop() docstring explaining how first_samp behaves after cropping
and mention RawArray as the current workaround.
Activity
larsoner commentedon Jun 10, 2025
I guess we could add a
reset_first_samp=Falsedefault where if you set it toTruewould have the desired behavior. I could live with it as long as we document that it could mess things up (e.g., if you extract events then crop withreset_first_samp=Trueand try to use those original events, things will be broken).Famous077 commentedon Feb 25, 2026
HI @lilly-sanchezz @larsoner , I'd be happy to start with the documentation improvement while
the feature design is being discussed. I can add a note to the
crop() docstring explaining how first_samp behaves after cropping
and mention RawArray as the current workaround.