stingray icon indicating copy to clipboard operation
stingray copied to clipboard

Method to smoothen a light curve

Open Sauravroy34 opened this issue 1 year ago • 2 comments

I found this cool method which is used to smoothen the lightcurves to get rid of short term factors that influence the light curve that comes from the star. source: https://ui.adsabs.harvard.edu/abs/1964AnaCh..36.1627S/abstract

Sauravroy34 avatar Mar 19 '25 08:03 Sauravroy34

I’ve been exploring a potential solution to smoothen the light curves and reduce short-term fluctuations that may be affecting the signal from the star. As you said one method that I also came across is the Savitzky Golay filter, which is often used in time series analysis for smoothing data without distorting the underlying signal. As made a glance in the paper and found that this technique fits a polynomial to a moving window of data points, which could be effective in filtering out noise in light curves while preserving important trends. Some approach :

  • Window size: We can adjust the window size to balance between noise reduction and retaining features of the signal.
  • Polynomial order: Typically, a second-order polynomial is used, but this could be customized based on the specific nature of the light curve. If there is an interest in integrating this approach into the Stingray framework, I’d be happy to contribute a function or implementation that incorporates the Savitzky Golay filter for light curve smoothing. Please let me know your thoughts, and I’d be happy to discuss further or assist in any way! Thank you for considering this approach.

jsdingra11 avatar Apr 14 '25 01:04 jsdingra11

Hi @jsdingra11 ,I don't think using Savitzky-Golay (which relies on the least squares method) is ideal for light curves since it assumes the errors are Gaussian-distributed. However, light curve data—especially from photon-counting instruments—follow a Poisson distribution.

source

  1. https://github.com/StingraySoftware/stingray/pull/906#:~:text=The%20methods%20you,one%20in%20mind%3F

  2. Least square fitting error distributions assumptions

However, in my pr #906 I use poission regressor with spline basis

Sauravroy34 avatar Apr 14 '25 10:04 Sauravroy34