stingray icon indicating copy to clipboard operation
stingray copied to clipboard

Bug in example code on the docs page

Open juliadeneva opened this issue 3 months ago • 1 comments

Description of the Issue

In the Thresholding section in the online docs there is this example code:

ntrial = (frequencies[-1] - frequencies[0]) / df_min z_detlev = z2_n_detection_level(n=1, epsilon=0.001, ntrial=len(freq)) ef_detlev = fold_detection_level(nbin, epsilon=0.001, ntrial=len(freq))

The last argument to both of the detection_level functions should be ntrial=ntrial as that is the number of trial frequencies without oversampling. (The text above that code says, "The ntrial parameter should be set to an estimate of the statistically independent frequencies in the periodogram.")

In the example, len(freq) is the number of trial frequencies with oversampling.

Suggestions regarding the Issue

No response

juliadeneva avatar Sep 19 '25 17:09 juliadeneva

Thanks @juliadeneva! I opened a sub-issue in the notebooks repository where the docs are hosted.

matteobachetti avatar Sep 19 '25 18:09 matteobachetti