source: Sophya/trunk/SophyaLib/Samba/tod.h@ 4040

Last change on this file since 4040 was 2894, checked in by cmv, 20 years ago

variable cs_ non-definie rz+cmv 100106

File size: 1.6 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2#ifndef TOD_H_SEEN
3#define TOD_H_SEEN
4
5#include "machdefs.h"
6#include "spherepos.h"
7#include "misstime.h"
8
9namespace SOPHYA {
10template<class T>
11class TOD
12{
13public:
14 TOD(SphereCoordSys* cs = NULL)
15 { if (cs) cs_ = cs; else cs = new SphereCoordSys; }
16 virtual ~TOD()
17 { if (cs_) delete cs_; }
18
19// Set/Change/Get the coordinate system
20 virtual void SetCoordSys(SphereCoordSys* cs)
21 { if (cs) { delete cs_; cs_ = cs; } }
22 inline SphereCoordSys* GetCoordSys() const { return(cs_); }
23
24// Return the size / number of sample
25 virtual int_8 size() const = 0;
26 inline int_8 NbSample() const { return(size()); }
27
28// Start/End time
29 virtual MissionTime StartTime();
30 virtual MissionTime EndTime();
31
32// Sample time
33 virtual const MissionTime& SampleTime(int k) const = 0;
34 virtual MissionTime& SampleTime(int k) = 0;
35
36// Time to sample number - return the closest sample to time t
37 virtual int_8 IndexFromTime(MissionTime const & t) const = 0;
38
39// Sample value
40 virtual const T& SampleValue(int_8 k) const = 0;
41 virtual T& SampleValue(int_8 k) = 0;
42 virtual const T& ValueAtTime(MissionTime const & t) const
43 { return SampleValue(IndexFromTime(t)); }
44
45// Sample direction
46 virtual const UnitVector& SamplePointing(int_8 k) const = 0;
47 virtual UnitVector& SamplePointing(int_8 k) = 0;
48// Pointing at time t
49 virtual const UnitVector& PointingAtTime(MissionTime const & t ) const
50 { return SamplePointing(IndexFromTime(t)); }
51
52protected:
53 SphereCoordSys* cs_ ;
54};
55
56} // Fin du namespace
57
58#endif
Note: See TracBrowser for help on using the repository browser.