[ENH] Min-to-min and max-to-max phase shifting #247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This expands phase shifting to allow for minima-to-minima and maxima-to-maxima sims. It also add phase shifting to
sim_bursty_oscillation
, which wasn't possible before. Thephase
kwarg was added tosim_cycle
so phase shifting could be done before tiling.The motivation for this was working with sims + bycycle and the lack of a convenient way to sim cycles from trough-to-trough or peak-to-peak. When simulating from zerox-to-zerox, but bycycle defined cycles otherwise, cyclepoints could get messy. Maybe bycycle could be updated to define cycles from zerox-to-zerox, but that will likely have other side-effects to work out.
The
phase
argument still accepts a float from [0, 1], but it also acceptsmin
ormax
strings to automatically determine the phase shift required to sim from trough-to-trough or peak-to-peak. I'm not sure a mixed param type is the best design so I'm open to suggestions.Simple example:
Bycycle cyclepoints example: