NoisyLeon/pyaftan

Possibility of the first segment as the longest one of frequency range after jump correction

ghraecakter opened this issue · 0 comments

Hi Lili,

After jump correction, the frequency range is divided into multiple segments by jump points.
However, your code neglects the possibility that the first segment being the longest

pyaftan/pyaftan.py

Lines 633 to 634 in 976efd2

indx = np.where(np.abs(trig)>0.5)[0]
indx = np.append(indx, nfin-1)

I'm wondering if you deliberately did it or overlooked Misha's original code

indx(1) = 1

If it's the former case, my guess is that you always want to save the longer periods.
If it's the latter, a possible fix would be

indx = np.concatenate(([0], indx, [nfin-1]))

Best,
Shane