diff --git a/Appl/CEP/CS1/CS1_Interface/include/CS1_Interface/CS1_Parset.h b/Appl/CEP/CS1/CS1_Interface/include/CS1_Interface/CS1_Parset.h index abf9cfdc890170ce531edee52c7aad484cf04a92..21b4181f2fe9a61f2261edc193dc31c8b13092a7 100644 --- a/Appl/CEP/CS1/CS1_Interface/include/CS1_Interface/CS1_Parset.h +++ b/Appl/CEP/CS1/CS1_Interface/include/CS1_Interface/CS1_Parset.h @@ -62,8 +62,8 @@ public: double stopTime() const; uint32 nrStations() const; double sampleRate() const; - vector<double> physicalPhaseCentras() const; - vector<double> trackingPhaseCentras() const; + vector<double> positions() const; + vector<double> phaseCenters() const; uint32 nrSubbandSamples() const; double integrationTime() const; uint32 nrSamplesToBGLProc() const; @@ -82,7 +82,7 @@ public: double chanWidth() const; vector<string> delay_Ports() const; vector<string> getPortsOf(const string& aKey) const; - uint32 inputPortnr(const string& aKey) const; + string inputPortnr(const string& aKey) const; string stationName(const int index) const; string expandedArrayString(const string& orgStr) const; @@ -91,9 +91,6 @@ public: vector<double> itsStPositions; private: - uint32 getStationIndex(const string& aKey) const; - - void addPosition(string stName); }; @@ -109,9 +106,11 @@ inline double CS1_Parset::stopTime() const return to_time_t(time_from_string(getString("Observation.stopTime"))); } -inline uint32 CS1_Parset::inputPortnr(const string& aKey) const +inline string CS1_Parset::inputPortnr(const string& aKey) const { - return getUint32("OLAP.firstInputPortnr") + getStationIndex(aKey); + string rst = getString("PIC.Core." + aKey + ".port"); + int index = rst.find(":"); + return rst.substr(index+1,4); } inline string CS1_Parset::stationName(const int index) const diff --git a/Appl/CEP/CS1/CS1_Interface/src/CS1_Parset.cc b/Appl/CEP/CS1/CS1_Interface/src/CS1_Parset.cc index a55712cad4ec72181e577841c0ae799cbbf421ee..4926c62b68eace7716775ad5bf2954d82c01e4bb 100644 --- a/Appl/CEP/CS1/CS1_Interface/src/CS1_Parset.cc +++ b/Appl/CEP/CS1/CS1_Interface/src/CS1_Parset.cc @@ -42,21 +42,21 @@ CS1_Parset::~CS1_Parset() { } -vector<double> CS1_Parset::physicalPhaseCentras() const +vector<double> CS1_Parset::positions() const { vector<string> stNames = getStringVector("OLAP.storageStationNames"); vector<double> pos, list; - + for (uint i = 0; i < nrStations(); i++) { - pos = getDoubleVector(locateModule(stNames[i]) + stNames[i] + ".physicalPhaseCentre"); + pos = getDoubleVector("PIC.Core." + stNames[i] + ".position"); list.insert(list.end(), pos.begin(), pos.end()); } return list; } -vector<double> CS1_Parset::trackingPhaseCentras() const +vector<double> CS1_Parset::phaseCenters() const { vector<double> pos, list; vector<string> stNames = getStringVector("OLAP.storageStationNames"); @@ -65,32 +65,13 @@ vector<double> CS1_Parset::trackingPhaseCentras() const for (uint i = 0; i < nrStations(); i++) { index = stNames[i].find("_"); - pos = getDoubleVector(locateModule(stNames[i].substr(0,index)) + stNames[i].substr(0,index) + ".trackingPhaseCentre"); + pos = getDoubleVector(locateModule(stNames[i].substr(0,index)) + stNames[i].substr(0,index) + ".phaseCenter"); list.insert(list.end(), pos.begin(), pos.end()); } return list; } -uint32 CS1_Parset::getStationIndex(const string& aKey) const -{ - int pos = aKey.find("_"); - - if (aKey.substr(pos + 1,2) == "us") - return std::atoi(aKey.substr(aKey.size()-1,1).c_str()); - else if (aKey.substr(pos + 1,6) == "dipole") - { - if (aKey.size() < 14) - return std::atoi(aKey.substr(aKey.size()-1,1).c_str())/4; - else - return std::atoi(aKey.substr(aKey.size()-2,2).c_str())/4; - } - - cout << "Index of " << aKey << "not found." << endl; - - return 0; -} - vector<double> CS1_Parset::refFreqs() const { vector<uint32> subbandIDs = getUint32Vector("Observation.subbandList");