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