Skip to content

Conversation

@avivajpeyi
Copy link

This is really neat repo, @farr ! Popped up when i was looking online for implementations for Lorentzian lines.

Id like to automate the process of determining the lines to be removed.

Following Gupta and Cornish '24, we can identify the locations of narrowband spectral lines using a running median of the periodogram.

Any frequency bins where the periodogram power exceeds the running median by a chosen threshold (e.g., a factor of 10) can be marked as narrowband lines.

These identified lines can then treated using your mcmc script :)

@avivajpeyi
Copy link
Author

Examples of identified lines (f0 and bws):

Screenshot 2025-06-27 at 3 22 47 PM Screenshot 2025-06-27 at 3 24 13 PM

@avivajpeyi
Copy link
Author

avivajpeyi commented Jun 27, 2025

Hmmm in some cases i guess the line-cleaner didnt work so well...

Im guessing the MCMC might not have converged or smth...

Any tips @farr, before i start looking at trace plots?

Frequency Range (Hz) Strain Plot
26 – 29 26–29
35 – 38 35–38
40 – 42 40–42
59 – 61 59–61
119 – 121 119–121
127 – 129 127–129
179 – 181 179–181
255 – 257 255–257
299 – 304 299–304
331 – 333 331–333
499 – 510 499–510
598 – 600 598–600
604 – 608 604–608
991 – 1000 991–1000

@avivajpeyi avivajpeyi marked this pull request as ready for review June 27, 2025 10:14
@farr
Copy link
Owner

farr commented Jul 2, 2025

Hi @avivajpeyi --- glad that you're looking into it! I have a few thoughts (before you go looking at trace plots):

  • The line cleaner will not handle intervals where there are multiple lines---it explicitly assumes that the power spectrum of the narrow-band data it is presented with is a flat "continuum" plus exactly one Lorentzian profile. So I wouldn't expect it to do well in those cases (like, say, 35 to 38, where the lines aren't well separated, or 26 to 29).
  • In other cases, it looks to me like your bandwidth is too narrow---the line cleaner will need to have a fair amount of "flat" PSD outside the line (i.e. after the line has fallen below the continuum by a sufficient amount) in order to get a good estimate of the background white-noise level (assumed white because the band is assumed to be narrow enough that the PSD doesn't evolve). I think that's the issue 171-181, and (to a lesser extent) 331-333 as well, and many other cases. As a rule of thumb, I would include at least as big a range of frequencies outside the line as the line's bandwidth itself.

Unfortunately, this will likely mean that at least some of the lines (e.g. 598-600) which aren't formally overlapping will still not be treatable with this simple model.

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