-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend apfrequency operation with method instantaneous pair #1607
Conversation
@timjarsky Before I add tests and docu, could you please verify that the calculation works as intended by the brief issue? |
c99c414
to
9807db5
Compare
@MichaelHuth The new method is looking good. Can you add the unit to the y-axis? I also need help understanding the x-axis unit. It should reflect the AP number in some way. |
@timjarsky I think the kHz should actually be on the y-axis. (I will fix this). About the x-axis in the issue is stated
|
Hi @MichaelHuth, Let's keep the x-axis as spike time but add an option to have the x-axis be spike count. I'd also like to add an option to have the Y values be time or frequency (default to frequency). One final option is to have the Y-values be normalized to the first interval time/frequency (default to non-normalized). Thank you! |
@MichaelHuth It might make sense to have these new optional parameters for all methods. |
@timjarsky So the third option would actually be two options?
|
Yes, you can think of it that way. I was first defining whether the user wants to work with frequency or time, then letting the user decide if they want the data normalized or not. |
58abf0a
to
5b97273
Compare
I added two more optional parameters: time/freq has only an effect for the result values on method 3 (pairs) as I currently don't see a senseful application on the other methods that return integrated values. normalize works on all methods and requires at least 2 peaks per sweep to be applied. The normalization divisor depends on the time/freq setting. I have fixed also the Y-axis label and simplified the X-axis label under the assumption that the input is always sweep data with ms a x wave units. |
@MichaelHuth, thank you for adding the new features. I would still like to add an x-axis option that plots the frequency/time (Y) values against spike count instead of spike time. Minor: when using the normalized option, y-axis labels could be something like: "normalized frequency" instead of (Hz), which is confusing. |
@MichaelHuth In addition to axis label changes, you may also want to utilize the legend labels to make plots like this interpretable. |
@MichaelHuth It would also be helpful if the Y-axis label included the method string. |
77820a9
to
c533b27
Compare
Good for another try. I added after normalize another argument that can either be The bigger part was to make traces and annotations from different formulas in the same plot distinguishable. |
@MichaelHuth, how are the normalized values calculated with method I was expecting the value to be normalized to the first sweep. |
The normalization factor does not depend on the method, only if you use peakTimeFreq = 1.0 / ( (peaksAt[1] - peaksAt[0]) * MILLI_TO_ONE) // frequency in Hz from the first two peaks
result = result / peakTimeFreq // apply normalization factor |
Thanks for the explanation @MichaelHuth So, I think normalization should depend on the method. For methods where a single value is returned for each sweep, the normalization should be across all sweeps. |
@MichaelHuth , i want to modify what I said above. Rather than have the normalization depend on the method, i think it makes sense to give the user to specify if they want the normalization to occur within the sweep or across sweeps. |
b8ab81c
to
bdb78c9
Compare
Failing tests:
|
bdb78c9
to
df1b74f
Compare
Review: Nice test coverage for apfrequency! I've only looked at the code.
|
- This allows to distinguish if another formula is differently parameterized. This information is suitable to decide if traces should be displayed different or give the user information what parameter is different. "operation stack nice" is operation return information in a human readable form that is more than just the operation name.
- previously the markers property was set globally depending on the data of the last formula plotted. Effectively this was not fully correct since the introduction of the "with" keyword that allows plotting different formulas into the same plot.
… same plot - The marker codes and line codes are defined in a helper function.
- normOverSweepsMin: normalizes over all sweeps based on the minimum result value in all sweeps based on the current method - normOverSweepsMax: normalizes over all sweeps based on the maximum result value in all sweeps based on the current method - normOverSweepsAvg: normalizes over all sweeps based on the average result value in all sweeps based on the current method - normInSweepsMin: normalizes each sweep based on the minimum result value in the specific sweep based on the current method - normInSweepsMax: normalizes each sweep based on the maximum result value in the specific sweep based on the current method - normInSweepsAvg: normalizes each sweep based on the average result value in the specific sweep based on the current method - removed special handling of single peak sweeps, single peaks are treated now in methods that require peak pairs as "no result" - sweeps that contain only a single peak are now treated by the apfrequency methods that require pairs of peaks as data that gives no result. This simplifies the code a lot.
- also add section for argSetup stack
df1b74f
to
550e545
Compare
@MichaelHuth Nice. Thanks! |
close #1119
The new method number for apfrequency is 3.