Last change
on this file since 2729 was 2727, checked in by Takeshi Nakazato, 12 years ago |
New Development: No
JIRA Issue: Yes CAS-4770, CAS-4774
Ready for Test: Yes
Interface Changes: No
What Interface Changed: Please list interface changes
Test Programs: List test programs
Put in Release Notes: Yes/No
Module(s): Module Names change impacts.
Description: Describe your changes here...
Updated STApplyCal to be able to specify interpolation method.
The method can be specified in time and frequency axes independently.
Possible options are nearest, linear (default), (natural) cubic spline,
and polynomial with arbitrary order.
|
File size:
916 bytes
|
Rev | Line | |
---|
[2727] | 1 | //
|
---|
| 2 | // C++ Interface: CubicSplineInterpolator1D
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | //
|
---|
| 6 | //
|
---|
| 7 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2012
|
---|
| 8 | //
|
---|
| 9 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | #ifndef ASAP_CUBIC_SPLINE_INTERPOLATOR_1D_H
|
---|
| 13 | #define ASAP_CUBIC_SPLINE_INTERPOLATOR_1D_H
|
---|
| 14 |
|
---|
| 15 | #include "Interpolator1D.h"
|
---|
| 16 |
|
---|
| 17 | namespace asap {
|
---|
| 18 |
|
---|
| 19 | /**
|
---|
| 20 | * Cubic spline interpolation
|
---|
| 21 | * @author TakeshiNakazato
|
---|
| 22 | */
|
---|
| 23 | class CubicSplineInterpolator1D : public Interpolator1D {
|
---|
| 24 | public:
|
---|
| 25 | CubicSplineInterpolator1D();
|
---|
| 26 |
|
---|
| 27 | virtual ~CubicSplineInterpolator1D();
|
---|
| 28 |
|
---|
| 29 | void setY(float *y, unsigned int n);
|
---|
| 30 | float interpolate(double x);
|
---|
| 31 | private:
|
---|
| 32 | // determine second derivatives of each point based on
|
---|
| 33 | // natural cubic spline condition
|
---|
| 34 | void spline();
|
---|
| 35 |
|
---|
| 36 | // do interpolation using second derivatives from spline()
|
---|
| 37 | float splint(double x, unsigned int i);
|
---|
| 38 |
|
---|
| 39 | float *y2_;
|
---|
| 40 | unsigned int ny2_;
|
---|
| 41 | bool reusable_;
|
---|
| 42 | };
|
---|
| 43 |
|
---|
| 44 | }
|
---|
| 45 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.