MTStationList.h

Go to the documentation of this file.
00001 #ifndef CMTSTATIONLIST_H
00002 #define CMTSTATIONLIST_H
00003 
00004 #include <string>
00005 #include "MTStation.h"
00006 #include <vector>
00007 #include <utility>
00008 
00009 namespace gplib
00010   {
00011     /** \addtogroup mttools MT data analysis, processing and inversion */
00012     /* @{ */
00013 
00014     typedef std::vector<MTStation> tStationList;
00015     //! MTStationList holds a number of MTSites, usually associated with a single project, line, etc.
00016     class MTStationList
00017       {
00018     private:
00019       //! A vector that holds the frequencies common to all sites
00020       trealdata commonfrequencies;
00021       //! A vector that holds the storage index for each of the commonfrequencies for each site
00022       std::vector<tindexvector> cfindices;
00023       //! The vector holding the actual site data
00024       tStationList StationData;
00025       //! A helper function that finds all common frequencies
00026       void FindCommon(void);
00027     public:
00028       //! Access to the complete vector of Stations
00029       tStationList &GetList()
00030         {
00031           return StationData;
00032         }
00033       //! Read a list of filenames and the associated data in those files to fill the list
00034       void GetData(const std::string filename);
00035       //! Write the names of the sites in the current list to a file
00036       void WriteList(const std::string filename = "station.list");
00037       //! Write the data of each station to an individual file
00038       void WriteAllData();
00039       //! Get a vector that for each site contains the indices to the common frequencies
00040       const std::vector<tindexvector> &GetComFreqIndices()
00041         {
00042           return cfindices;
00043         }
00044       //! Get a vector with frequencies that are common to all sites
00045       const trealdata &GetCommonFrequencies()
00046         {
00047           return commonfrequencies;
00048         }
00049       //! Get a reference to a site at a given index
00050       MTStation& at(int loc);
00051       MTStationList();
00052       virtual ~MTStationList();
00053       };
00054 
00055     typedef std::vector<std::pair<MTStation*, MTStation*> > tStatSyncPair;
00056     //! Take two different site Lists of arguments and return a vector of pairs that point to the sites that correspond to each other
00057     tStatSyncPair FindCorrespondingSites(tStationList &MasterList,
00058         tStationList &SlaveList);
00059   /* @} */
00060   }
00061 #endif // CMTSTATIONLIST_H

Generated on Tue May 4 16:52:14 2010 for GPLIB++ by  doxygen 1.5.8