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
Fix spectrum plots for different states #403
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #403 +/- ##
==========================================
- Coverage 49.64% 49.56% -0.08%
==========================================
Files 60 60
Lines 8823 8828 +5
==========================================
- Hits 4380 4375 -5
- Misses 4443 4453 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@iaraota Thanks for finding the source of this bug! I think that we also need to fix the spectrograms, correct? For example, check out quiet and noisy state spectrograms here: https://ldas-jobs.ligo.caltech.edu/~detchar/summary/day/20240101/sei/bs/ |
Co-authored-by: Evan Goetz <32753745+eagoetz@users.noreply.github.com>
I didn't realize that, as the spectrogram for the strain works fine. I will have a look, thank you! |
@eagoetz I was looking into the problem of quiet and noise spectrograms and it seem to me that the problem is having a different definition for H1 and L1, in the configuration file we have:
And this page uses the state Thus, the issue does not lie within the |
@iaraota Yeah, I had a feeling it was more complicated, but at least we have some fixes for the spectra. Let's go ahead with this PR and continue working on the spectrogram issue in another PR |
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.
Thanks again @iaraota! LGTM
This PR addresses a bug related to computing the spectrum for different states. Previously, the same spectrogram was being plotted for different states despite having different segments, due to a global variable storing spectrum data with identical keys for all states. This issue has been resolved by introducing the
state
argument to theget_spectrum
andget_spectrum_range
functions, using the state name as a key to differentiate spectrum data.The original intention behind the removed snippet below
was to incorporate the state into the
name
variable. However, this condition always failed because of the decoratoruse_segmentlist
, which was already resetingsegments = segments.active
, therefore making it impossible to insert the state in thename
variable. With the introduction of thestate
variable, this redundant condition has been removed.Additionally, the range spectrogram also required fixing as it failed to change with the state. The code introduced mirrors that used in
_get_spectrogram
to ensure the correct data is returned.Example: