CARMA C++
AntennaControls.h
Go to the documentation of this file.
1 #ifndef CARMA_CONTROL_ANTENNA_CONTROLS_H
2 #define CARMA_CONTROL_ANTENNA_CONTROLS_H
3 
11 
12 
13 #include <memory>
14 #include <vector>
15 
16 #include "carma/corba/corba.h"
17 #include "carma/control/SubarrayControl.h"
18 #include "carma/monitor/ControlSubsystem.h"
20 #include "carma/services/Pad.h"
21 #include "carma/util/QuadraticInterpolatorNormal.h"
22 
23 
24 namespace carma {
25 
26 
27 namespace monitor {
28 
29 class MonitorSystem;
30 
31 } // namespace carma::monitor
32 
33 
34 namespace control {
35 
36 
37 class AntennaHandle;
38 class DriveHandle;
39 class CalibratorHandle;
40 class CryoHandle;
41 class FocusHandle;
42 class OpticalTelHandle;
43 class RxSelectorHandle;
44 
45 
58  public:
65  struct PersistentInfo {
66  explicit PersistentInfo( );
67 
68  // The pad upon which this antenna rests.
69  // Default constructor is carma reference position.
70  services::Pad pad;
71 
72  // The East, North, Up offsets with respect to the
73  // nominal Pad location (lon,lat,alt).
74  // These represent how an antenna sits on a pad and
75  // are the product of the baseline solution.
76  // The antenna's absolute location (lon,lat,alt) is
77  // Pad + pad offset + antenna offsets.
78  services::Length eastPadOffset;
79  services::Length northPadOffset;
80  services::Length upPadOffset;
81 
82  // These represent static properties of a particular
83  // antenna, e.g. the height of its receiver from the
84  // ground. They are given East, North, Up offsets with
85  // respect to the Pad location (lon,lat,alt).
86  // The antenna's absolute location (lon,lat,alt) is
87  // Pad + pad offset + antenna offsets.
88  services::Length eastAntennaOffset;
89  services::Length northAntennaOffset;
90  services::Length upAntennaOffset;
91 
92  // The antenna total offset in ENU coords from
93  // the array reference position. These don't contain
94  // any information not contained in X,Y,Z coords
95  // which are our standard, but easier for most
96  // people to conceptualize. So use these to
97  // create ENU monitor points for each antenna.
98  services::Length totalEast;
99  services::Length totalNorth;
100  services::Length totalUp;
101 
102  // measure of the non-intersection of elevation and azimuth axes.
103  services::Length axisMisalignment;
104 
105  };
106 
119  unsigned short carmaAntNo,
120  const PersistentInfo & persistentInfo,
121  monitor::MonitorSystem & monitorSystem,
122  monitor::ControlSubsystemBase::Antenna & antenna );
123 
126  unsigned short carmaAntNo,
127  const PersistentInfo & persistentInfo);
128 
129 
133  virtual ~AntennaControls( );
134 
141  void forceFullReconnect( );
142 
150 
154  AntennaHandle * antennaHandle( ) const;
155 
160 
164  CryoHandle * cryoHandle( ) const;
165 
169  DriveHandle * driveHandle( ) const;
170 
174  FocusHandle * focusHandle( ) const;
175 
180 
185 
189  services::Pad getPad( ) const;
190 
195  void setPad( const services::Pad & pad );
196 
202  ::std::vector< services::Length > getPadOffsets( ) const;
203 
218  void setPadOffsets( const services::Length & eastOffset,
219  const services::Length & northOffset,
220  const services::Length & upOffset );
221 
227  ::std::vector< services::Length > getAntennaOffsets( ) const;
228 
245  void setAntennaOffsets(
246  const services::Length & eastOffset,
247  const services::Length & northOffset,
248  const services::Length & upOffset );
249 
255  ::std::vector< services::Length > getTotalEnu( ) const;
256 
258  // (pad + pad offsets + antenna offsets).
260 
264 
270  void setAxisMisalignment(const services::Length& axisMis);
271 
274  unsigned short getCarmaAntennaNo( ) const;
275 
277  ::std::string getCarmaAntennaName( ) const;
278 
280  ::std::string getTypedAntennaName( ) const;
281 
282  struct Uvw {
283  double u;
284  double v;
285  double w;
286 
287  Uvw( );
288 
289  Uvw( double inU,
290  double inV,
291  double inW );
292  };
293 
307  void updateUVWInterpolators( const float U,
308  const float V,
309  const float W,
310  const double mjd,
311  const bool discontinuity );
312 
321  Uvw interpolateUVWfor( const double mjd );
322 
323  private:
324  AntennaControls( const AntennaControls & rhs );
325  AntennaControls & operator=( const AntennaControls & rhs );
326 
327  // common methods to compute a new total location when
328  // antenna offsets or pad offset ar given.
329  services::Location persistentInfoLocation() const;
330  void computeNewLocation();
331 
332  // absolute CARMA antena number (1-23).
333  const unsigned short carmaAntNo_;
334 
335  const ::std::auto_ptr< AntennaHandle > antennaHandle_;
336  const ::std::auto_ptr< CalibratorHandle > calibratorHandle_;
337  const ::std::auto_ptr< CryoHandle > cryoHandle_;
338  const ::std::auto_ptr< DriveHandle > driveHandle_;
339  const ::std::auto_ptr< FocusHandle > focusHandle_;
340  const ::std::auto_ptr< OpticalTelHandle > opticalTelHandle_;
341  const ::std::auto_ptr< RxSelectorHandle > rxSelectorHandle_;
342 
343  // Interpolators for the U,V,W coordinates.
344  // They are calculated every 20 seconds by delay engine,
345  // but science data need values on integration timescale.
346  // Note these should hold the J2000 UV(W) coordinates, not the
347  // current epoch. These containers should be filled AFTER
348  // precession done by rotateUVtoJ2000. UVW are in meters.
352 
353  PersistentInfo persistentInfo_;
354 
355 }; // class AntennaControls
356 
357 
358 } // namespace carma::control
359 } // namespace carma
360 
361 
362 inline
363 carma::control::AntennaControls::Uvw::Uvw( ) :
364 u( 0.0 ),
365 v( 0.0 ),
366 w( 0.0 )
367 {
368 }
369 
370 
371 inline
372 carma::control::AntennaControls::Uvw::Uvw(
373  const double inU,
374  const double inV,
375  const double inW ) :
376 u( inU ),
377 v( inV ),
378 w( inW )
379 {
380 }
381 
382 
383 #endif
void forceFullReconnect()
Reconnect to all subsystem DOs under control of this AntennaControls object.
This class specifies an antenna pad or station with coordinates, name, and array configuration member...
Definition: Pad.h:25
Uvw interpolateUVWfor(const double mjd)
@ param mjd The modified julian day at which to interpolate the data
unsigned short getCarmaAntennaNo() const
Persistent Info captures data about the antenna which goes with it regardless of the subarray in whic...
void setPad(const services::Pad &pad)
Set the pad for upon which this antenna rests.
services::Location getAbsoluteLocation() const
services::Length getAxisMisalignment() const
Class for interpolating normal (non-angle) ordinates.
Manages antenna focus control DO connections.
Definition: FocusHandle.h:30
CryoHandle * cryoHandle() const
AntennaHandle * antennaHandle() const
void setAntennaOffsets(const services::Length &eastOffset, const services::Length &northOffset, const services::Length &upOffset)
Set additional offsets for a given antena.
AntennaControls interface.
CalibratorHandle * calibratorHandle() const
RxSelectorHandle * rxSelectorHandle() const
::std::vector< services::Length > getTotalEnu() const
Location specifies a location (observatory if you wish) on planet earth, as longitude, latitude, and altitude above sea-level.
Definition: Location.h:32
void setPadOffsets(const services::Length &eastOffset, const services::Length &northOffset, const services::Length &upOffset)
Set The East, North, Up offsets with respect to the nominal Pad location (lon,lat,alt).
OpticalTelHandle * opticalTelHandle() const
::std::vector< services::Length > getAntennaOffsets() const
Manages antenna optical telescope control DO connections.
FocusHandle * focusHandle() const
::std::vector< services::Length > getPadOffsets() const
Manages antenna cryo control DO connections.
Definition: CryoHandle.h:29
Monitor system base class.
Definition: MonitorSystem.h:81
virtual ~AntennaControls()
Destructor.
void updateUVWInterpolators(const float U, const float V, const float W, const double mjd, const bool discontinuity)
Push new UVW values on to the quadratic interpolators for these data items.
Manages antenna drive control DO connections.
Definition: DriveHandle.h:55
Manages antenna Antenna control DO connections.
Definition: AntennaHandle.h:15
DriveHandle * driveHandle() const
::std::string getTypedAntennaName() const
The Length class can represent a length in any units.
Definition: Length.h:36
Manages antenna calibrator control DO connections.
::std::string getCarmaAntennaName() const
void attemptToReconnectIfNeeded()
Reconnect to all subsystem DOs under control of this AntennaControls object if necessary.
AntennaControls(unsigned short carmaAntNo, const PersistentInfo &persistentInfo, monitor::MonitorSystem &monitorSystem, monitor::ControlSubsystemBase::Antenna &antenna)
Construct an AntennControls object.
Manages antenna Rx selector control DO connections.
void setAxisMisalignment(const services::Length &axisMis)
Set the axis misalignment term.
services::Pad getPad() const