Re: Smoothing Spline -- any existing efficient routines? [message #72086] |
Thu, 12 August 2010 06:53  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Aug 12, 6:25 am, "Neil B." <neil.h.bh...@gmail.com> wrote:
> Hi,
>
> I am trying to find the continuum of various stellar spectra. The
> noise of these spectra are fairly non-intrusive and there aren't many
> outliers (spikes due to calibration errors etc.).
>
> The arrays I am working with contain about 40000+ elements.
>
> I want to essentially turn the spectra into some linear function, so I
> can remove any curvature in the observed data.
>
> I know of the procedure Spline_smooth (http://astro.uni-tuebingen.de/
> software/idl/astrolib/math/spline_smooth.html). However, this
> function as the restriction tag in its header suggests, is extremely
> slow.... It takes about 40 minutes to process a 1000 element sub-
> array. The speed issues in this program are due to the fact that it
> does not use Cholesky Decomposition. Further more, when I try the
> routine on the 40000 element array I receive an error message that
> informs me that there are too many elements in the array...
>
> Does anyone know of an efficient version of this routine.
>
> Or is there a better way for determining the continuum of a spectrum?
>
> Thanks very much in advance.
You can use SAVGOL filter for smoothing. It is a built in function and
quiet fast.
From help:
The SAVGOL function returns the coefficients of a Savitzky-Golay
smoothing filter, which can then be applied using the CONVOL function.
The Savitzky-Golay smoothing filter, also known as least squares or
DISPO (digital smoothing polynomial), can be used to smooth a noisy
signal.
Cheers
Dave
|
|
|
Re: Smoothing Spline -- any existing efficient routines? [message #72194 is a reply to message #72086] |
Mon, 16 August 2010 10:48  |
Neil B.
Messages: 2 Registered: August 2010
|
Junior Member |
|
|
On Aug 12, 9:53 am, Dave Poreh <d.po...@gmail.com> wrote:
> On Aug 12, 6:25 am, "Neil B." <neil.h.bh...@gmail.com> wrote:
>
>
>
>> Hi,
>
>> I am trying to find the continuum of various stellar spectra. The
>> noise of these spectra are fairly non-intrusive and there aren't many
>> outliers (spikes due to calibration errors etc.).
>
>> The arrays I am working with contain about 40000+ elements.
>
>> I want to essentially turn the spectra into some linear function, so I
>> can remove any curvature in the observed data.
>
>> I know of the procedure Spline_smooth (http://astro.uni-tuebingen.de/
>> software/idl/astrolib/math/spline_smooth.html). However, this
>> function as the restriction tag in its header suggests, is extremely
>> slow.... It takes about 40 minutes to process a 1000 element sub-
>> array. The speed issues in this program are due to the fact that it
>> does not use Cholesky Decomposition. Further more, when I try the
>> routine on the 40000 element array I receive an error message that
>> informs me that there are too many elements in the array...
>
>> Does anyone know of an efficient version of this routine.
>
This worked fairly well and ran very quickly. The only issue I found
is that it follows the absorptions a little too much. Perhaps this
just means I need to find the best parameters...
Thank you very much. This was a very fast routine!
>> Or is there a better way for determining the continuum of a spectrum?
>
>> Thanks very much in advance.
>
> You can use SAVGOL filter for smoothing. It is a built in function and
> quiet fast.
> From help:
> The SAVGOL function returns the coefficients of a Savitzky-Golay
> smoothing filter, which can then be applied using the CONVOL function.
> The Savitzky-Golay smoothing filter, also known as least squares or
> DISPO (digital smoothing polynomial), can be used to smooth a noisy
> signal.
> Cheers
> Dave
|
|
|