[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 Observation data and points

The Gama observation data structures are designed to enable adjustment of any combination of possibly correlated observations. At its very early stage Gama was limited to adjustment of uncorrelated observations. Only directions and distances were available and observable’s weight was stored together with the observed value in a single object. A single array of pointers to observation objects was sufficient for handling all observations. So called orientation shifts corresponding to directions measured form a point were stored together with coordinations in point objects.

fig/obsdata-fig

To enable adjustment of possibly correlated observations (like angles derived from observed directions or already adjusted coordinates from a previous adjustment) Gama has come with the concept of clusters. Cluster is an object with a common variance-covariance matrix and a list of pointers to observation objects (distances, directions, angles, etc.). Weights were removed from observation objects and replaced with a pointer to the cluster to which the observation belong. All clusters are joined in a common object ObservationData; similarly to observations, each cluster contains a pointer to its parent Observation Data object. Orientation shifts were separated from coordinates and are stored in the cluster containing the bunch of directions and thus number of orientations is not limited to one for a point.

This organisation of observational information has proved to be effective. Template classes ObservationData and Cluster are used as base classes both in gama-local and gama-g3

template <typename Observation>
  class ObservationData
  {
  public:    
    ClusterList<Observation>  CL;
    
    ObservationData();
    ObservationData(const ObservationData& cod);
    ~ObservationData();
    
    ObservationData& operator=(const ObservationData& cod);   
    template <typename P> void for_each(const P& p) const;
  };

template <typename Observation>  
  class Cluster 
  {
  public:
    const ObservationData<Observation>*     observation_data;
    ObservationList<Observation>            observation_list;
    typename Observation::CovarianceMatrix  covariance_matrix;  
    
    Cluster(const ObservationData<Observation>* od);
    virtual ~Cluster();
    
    virtual Cluster* clone(const ObservationData<Observation>*) const = 0;
    double stdDev(int i) const;
    int size() const;
    void update();
    int  activeCount() const;
    typename Observation::CovarianceMatrix activeCov() const; 
  };

The following template class PointBase for handling point information is used in gama-g3. The template class PointBase relies internally on std::map container but comes with its own interface (in gama-local std::map was used directly for storing points).

template <typename Point>
  class PointBase
  {
    typedef std::map<typename Point::Name, Point*>  Points;

  public:    
    PointBase();
    PointBase(const PointBase& cod);
    ~PointBase();
    
    PointBase& operator=(const PointBase& cod);
    void put(const Point&);
    void put(Point*);
    Point*       find(const typename Point::Name&);
    const Point* find(const typename Point::Name&) const;
    void erase(const typename Point::Name&);
    void erase();
    
    class const_iterator;
    const_iterator  begin();
    const_iterator  end  ();

    class iterator;
    iterator  begin();
    iterator  end  ();
  };

Template classes ObservationData and PointBase are defined in namespace GNU_gama and are located in the source directory gnu_gama.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on February 17, 2024 using texi2html 1.82.