-
Notifications
You must be signed in to change notification settings - Fork 76
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
Sonification plugin tweaks #3377
base: main
Are you sure you want to change the base?
Sonification plugin tweaks #3377
Conversation
…up-to-date n render
…ionality for flux %ile removal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't grok the algorithms but I left a general review. Hope this helps. Thanks.
@@ -3,7 +3,6 @@ | |||
import sys | |||
import os | |||
import time | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove this blank line.
@@ -43,7 +42,7 @@ def sonify_spectrum(spec, duration, overlap=0.05, system='mono', srate=44100, fm | |||
data = {'spectrum': [spec], 'pitch': [1]} | |||
|
|||
# again, use maximal range for the mapped parameters | |||
lims = {'spectrum': ('0', '100')} | |||
lims = {'spectrum': (0, '100')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we mixing number and string in this tuple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strauss
syntax where strings are used for percentiles while numeric represents absolute values. In this case the maximum of the spectrum is the 100th %ile (i.e. max) in flux but using 0 flux for the minimum, rather than the 0th %ile in flux (min). I'll add a comment to clarify this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is kinda confusing. Why not be more explicit in the string specs like '100%'
or '100pct'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that could be an improvement - I will add accepting 'XX%'
as a percentile format in the next batch of strauss changes - though would this be ok for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the limitation, sure. The comment is helpful enough for now. Thanks!
|
… formatting Co-authored-by: P. L. Lim <[email protected]>
… formatting Co-authored-by: P. L. Lim <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3377 +/- ##
==========================================
- Coverage 88.13% 88.10% -0.03%
==========================================
Files 127 127
Lines 19695 19738 +43
==========================================
+ Hits 17358 17390 +32
- Misses 2337 2348 +11 ☔ View full report in Codecov by Sentry. |
Co-authored-by: P. L. Lim <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using a composite spectral subset and it seemed to work, although I will trust that you've tested that and confirmed it also. If that is the case then this is good to be merged! My only request (for either this PR or a follow up) is to use more descriptive variable names. The following names could be changed for clarities sake: lims
, wl_unit
, wl_bounds
, wlens
, eln
, assidx
, ssvidx
, and pccut
. Thanks again for getting composite subsets working!
Co-authored-by: Jesse Averbukh <[email protected]>
Description
This pull request develops the Sonification functionality further
flux_viewer.update_listener_wls
now takes a sequence of ranges rather than a min and max, to allow for composite selections with appropriate@observe
keyword for spectral subselection.vue
file.True
Fixes #
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.