Skip to content

Add period slice functions#689

Open
psanchez0046 wants to merge 6 commits intoscipp:mainfrom
psanchez0046:period_slice
Open

Add period slice functions#689
psanchez0046 wants to merge 6 commits intoscipp:mainfrom
psanchez0046:period_slice

Conversation

@psanchez0046
Copy link
Copy Markdown

No description provided.

@jokasimr
Copy link
Copy Markdown
Contributor

jokasimr commented Mar 18, 2026

Thanks for the PR! Let's talk tomorrow about what the public interface of this functionality should look like.

Spontaneously I'm thinking something along these lines:

@dataclass
class SignalParameters:
    period: sc.Variable
    phase: sc.Variable
    

def estimate_signal_phase_and_period(signal: DataArray, method: Literal['fit] | Literal['fft'] = 'fit') -> SignalParameters:
    '''Lets the user estimate the parameters they need to associate events to a period slice.'''
    ...


def associate_events_to_period_slice(events: DataArray, signal_parameters: SignalParameters, period_slices: int) -> DataArray:
    '''Adds the period slice index, or the phase of the center of the period slice, as a coord on the event data.'''
    ...

This is very much a suggestion, so don't feel this is the only possible option.

Other than

  1. estimating parameters from the signal, and
  2. associating events to their period slice

what other functionality should there be in this module?

Maybe some sort of helper for visualizing the quality of the signal fit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants