stingray icon indicating copy to clipboard operation
stingray copied to clipboard

FAD documentation misleading.

Open matteobachetti opened this issue 2 years ago • 3 comments

segment_size: float
        The final Fourier products are averaged over many segments of the
        input light curves. This is the length of each segment being averaged.
        Note that the light curve must be long enough to have at least 30
        segments, as the result gets better as one averages more and more
        segments.

This leads people to use many short segments to calculate the FAD. In reality, the FAD uses a default 3Hz resolution for smoothing: this means that if people use 1-s segments, they will only average over 3 bins, invalidating the method. We should give a much better rule of thumb, to ensure a minimum good resolution.

Thanks to Xiaobo Li for reporting the issue.

matteobachetti avatar Apr 07 '22 07:04 matteobachetti

If I got the problem correctly, I want to propose a solution for it:

In the method specified in your post, we can try something like:

acceptable_values = list(range(3, any desired range))
if segement_size in acceptable_values:
    #continue with program
else:
    #return error saying that the FAD uses a default 3Hz resolution for smoothing and that you repeat input in the range(3, any desired range)

I can work on it as a future task if you are okay with this solution, professor @matteobachetti

mohamedmostafadawood avatar Apr 17 '22 18:04 mohamedmostafadawood

@mohamedmostafadawood I just think that we have to improve the docs :)

matteobachetti avatar Apr 19 '22 06:04 matteobachetti

@mohamedmostafadawood I just think that we have to improve the docs :)

Okay, thanks.

mohamedmostafadawood avatar Apr 28 '22 19:04 mohamedmostafadawood

@matteobachetti , I think that a good rule of thumb would be to put the segment_size atleast 16 as then for the default 3bins/Hz, we average on close to 50 bins for smoothening. I also tried this empirically for the example given on FAD_notebook.

Gaurav17Joshi avatar Feb 25 '23 09:02 Gaurav17Joshi

Fixed in https://github.com/StingraySoftware/notebooks/commit/b7f390843a700631d00e2799ab495b6dc915f989

matteobachetti avatar Jan 15 '24 14:01 matteobachetti