GPLIB++
MTStationList.h
Go to the documentation of this file.
1 #ifndef CMTSTATIONLIST_H
2 #define CMTSTATIONLIST_H
3 
4 #include <string>
5 #include "MTStation.h"
6 #include <vector>
7 #include <utility>
8 
9 namespace gplib
10  {
11  /** \addtogroup mttools MT data analysis, processing and inversion */
12  /* @{ */
13 
14  typedef std::vector<MTStation> tStationList;
15  //! MTStationList holds a number of MTSites, usually associated with a single project, line, etc.
17  {
18  private:
19  //! The relative tolerance at which we accept two frequencies as being euqal
20  double tolerance;
21  //! A vector that holds the frequencies common to all sites
22  trealdata commonfrequencies;
23  //! A vector that holds the storage index for each of the commonfrequencies for each site
24  std::vector<tindexvector> cfindices;
25  //! The vector holding the actual site data
26  tStationList StationData;
27  //! A helper function that finds all common frequencies
28  void FindCommon(void);
29  public:
30  //! Access to the complete vector of Stations
32  {
33  return StationData;
34  }
35  //! Read a list of filenames and the associated data in those files to fill the list
36  void GetData(const std::string filename);
37  //! Write the names of the sites in the current list to a file
38  void WriteList(const std::string filename = "station.list");
39  //! Write the data of each station to an individual file
40  void WriteAllData();
41  //! Get a vector that for each site contains the indices to the common frequencies
42  const std::vector<tindexvector> &GetComFreqIndices()
43  {
44  return cfindices;
45  }
46  //! Get a vector with frequencies that are common to all sites
47  const trealdata &GetCommonFrequencies()
48  {
49  return commonfrequencies;
50  }
51  //! Get a reference to a site at a given index
52  MTStation& at(int loc);
53  MTStationList(double freqtol = 0.05);
54  virtual ~MTStationList();
55  };
56 
57  typedef std::vector<std::pair<MTStation*, MTStation*> > tStatSyncPair;
58  //! Take two different site Lists of arguments and return a vector of pairs that point to the sites that correspond to each other
60  tStationList &SlaveList);
61  /* @} */
62  }
63 #endif // CMTSTATIONLIST_H
MTStation & at(int loc)
Get a reference to a site at a given index.
void WriteAllData()
Write the data of each station to an individual file.
void WriteList(const std::string filename="station.list")
Write the names of the sites in the current list to a file.
std::vector< std::pair< MTStation *, MTStation * > > tStatSyncPair
Definition: MTStationList.h:57
tStatSyncPair FindCorrespondingSites(tStationList &MasterList, tStationList &SlaveList)
Take two different site Lists of arguments and return a vector of pairs that point to the sites that ...
const trealdata & GetCommonFrequencies()
Get a vector with frequencies that are common to all sites.
Definition: MTStationList.h:47
The class MTStation is used to store the transfer functions and related information for a MT-site...
Definition: MTStation.h:17
MTStationList holds a number of MTSites, usually associated with a single project, line, etc.
Definition: MTStationList.h:16
MTStationList(double freqtol=0.05)
std::vector< MTStation > tStationList
Definition: MTStationList.h:14
tStationList & GetList()
Access to the complete vector of Stations.
Definition: MTStationList.h:31
const std::vector< tindexvector > & GetComFreqIndices()
Get a vector that for each site contains the indices to the common frequencies.
Definition: MTStationList.h:42
void GetData(const std::string filename)
Read a list of filenames and the associated data in those files to fill the list. ...