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:
953 bytes
|
Line | |
---|
1 | //
|
---|
2 | // C++ Interface: Interpolator1D
|
---|
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_INTERPOLATOR_1D_H
|
---|
13 | #define ASAP_INTERPOLATOR_1D_H
|
---|
14 |
|
---|
15 | #include "Locator.h"
|
---|
16 |
|
---|
17 | namespace asap {
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Base class for interpolation operation
|
---|
21 | * @author TakeshiNakazato
|
---|
22 | */
|
---|
23 | class Interpolator1D {
|
---|
24 | public:
|
---|
25 | Interpolator1D();
|
---|
26 |
|
---|
27 | virtual ~Interpolator1D();
|
---|
28 |
|
---|
29 | void setData(double *x, float *y, unsigned int n);
|
---|
30 | void setX(double *x, unsigned int n);
|
---|
31 | void setY(float *y, unsigned int n);
|
---|
32 | void reset();
|
---|
33 |
|
---|
34 | // currently only effective for polynomial interpolation
|
---|
35 | void setOrder(unsigned int order) {order_ = order;}
|
---|
36 |
|
---|
37 | virtual float interpolate(double x) = 0;
|
---|
38 |
|
---|
39 | protected:
|
---|
40 | int locate(double x);
|
---|
41 | bool isready();
|
---|
42 | void createLocator();
|
---|
43 |
|
---|
44 | unsigned int order_;
|
---|
45 | unsigned int n_;
|
---|
46 | double *x_;
|
---|
47 | float *y_;
|
---|
48 | Locator *locator_;
|
---|
49 | };
|
---|
50 |
|
---|
51 | }
|
---|
52 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.