grd349/PBjam

Star should warn if input periodogram is not flattened or update docs.

alexlyttle opened this issue · 2 comments

Context

When I tried passing the following periodogram to the star class,

pg = lc.to_periodogram(normalization='psd')

I got this output from star.run_asy_peakbag():

image

For comparison, when I passed the following periodogram, (flatten() is Lightkurves method to remove noise and smooth the periodogram)

pg = lc.to_periodogram(normalization='psd').flatten()

I get this:

image

Issue

PBjam docs suggests a periodogram with power in any units may be passed, but not that it needs to be flattened. Clearly the periodogram needs to be flattened for this to work, as that would explain the dodgy units in the plot.

Suggestion

  1. (easy) Update the docs to specify the input periodogram must be flattened.
  2. (additional) PBjam raises an error or warning if it detects that the input periodogram is not flattened.
  3. (alternative) star flattens the periodogram if it is not already

I've put in a flatten method call in the init of star. Not the best procedure I guess, but it does the trick.

I tested flattening on the same spectrum 10x and it made no measureable difference after the first flattening (does this make sense?). It was a high SNR target, don't know if low SNR targets behave the same.

Tested on 4448777 and it works, feel free to close issue.