Skip to content
Snippets Groups Projects
Commit 5f107a1d authored by Arthur Coolen's avatar Arthur Coolen
Browse files

Task #6553: readStationConfigs need to handle new antennaConfig file layout

parent 089fa9fd
No related branches found
No related tags found
No related merge requests found
......@@ -105,8 +105,8 @@ main()
continue;
}
if (bDebug) DebugN("working on: ",dynStr_fileContent[index-1]);
if (bDebug) DebugN("str1: ",str1," str2: ",str2);
// if (bDebug) DebugN("working on: ",dynStr_fileContent[index-1]);
// if (bDebug) DebugN("str1: ",str1," str2: ",str2);
if (strtoupper(str1) == "NORMAL_VECTOR" ) {
if (strtoupper(str2) != "LBA" && strtoupper(str2) != "HBA0" && strtoupper(str2) != "HBA1" && strtoupper(str2) != "HBA") {
......@@ -359,7 +359,9 @@ dyn_string lto_getFile_asDynStr(string aFileName) {
void processNormalVector(string aS) {
float fX=0,fY=0,fZ=0;
sscanf(dynStr_fileContent[index++],"%*d %*s %lf %lf %lf",fX,fY,fZ);
int dummy, lenx, leny;
sscanf(dynStr_fileContent[index++],"(%d,%d) x (%d,%d) %*s %lf %lf %lf",dummy,lenx,dummy,leny,fX,fY,fZ);
if (bDebug) DebugN("Reading NORMAL_VECTOR "+aS+" X,Y,Z :" + fX + " " + fY + " " + fZ);
if (aS == "LBA" ) {
norVecLBAFound=true;
......@@ -386,9 +388,12 @@ void processNormalVector(string aS) {
void processRotationMatrix(string aS) {
dyn_float fX,fY,fZ;
int nr_rows=0;
int dummy,nr_rows=0;
// read nr of rows
sscanf(dynStr_fileContent[index++],"%d",nr_rows);
sscanf(dynStr_fileContent[index++],"(%d,%d)",dummy,nr_rows);
nr_rows+=1;
if (bDebug) DebugN("index: "+(index-1)+" nr_rows: "+nr_rows);
for (int i = 1; i <= nr_rows; i++) {
sscanf(dynStr_fileContent[index++],"%lf %lf %lf",fX[i],fY[i],fZ[i]);
......@@ -420,7 +425,8 @@ void processRotationMatrix(string aS) {
void processFieldCenter(string aS) {
float fX=0,fY=0,fZ=0;
sscanf(dynStr_fileContent[index++],"%*d %*s %lf %lf %lf",fX,fY,fZ);
int dummy;
sscanf(dynStr_fileContent[index++],"(%d,%d) %*s %f %f %f",dummy, dummy, fX, fY, fZ);
if (bDebug) DebugN("Reading fieldcenter "+aS+"X,Y,Z:" + fX + " " + fY + " " + fZ);
if (aS== "LBA") {
centerLBAFound=true;
......@@ -453,11 +459,12 @@ void processFieldDeltas(string aS) {
dyn_float antConfFileX;
dyn_float antConfFileY;
dyn_float antConfFileZ;
int dummy;
// read nr of antennas
sscanf(dynStr_fileContent[index++],"%d",nr_ofAnt);
sscanf(dynStr_fileContent[index++],"(%d,%d)",dummy, nr_ofAnt);
nr_ofAnt+=1;
if (aS== "LBA") {
deltasLBAFound=true;
nr_LBA=nr_ofAnt;
......@@ -515,8 +522,7 @@ void calcRotated(string aS) {
float centerX,centerY,centerZ;
float X,Y,Z;
float x1=0,x2=0,y1=0,y2=0,x3=0,x4=0,y3=0,y4=0;
if (aS=="LBA") {
dpGet("LOFAR_PIC_StationInfo.LBA.RotationMatrix.X",rotX,"LOFAR_PIC_StationInfo.LBA.RotationMatrix.Y",rotY,"LOFAR_PIC_StationInfo.LBA.RotationMatrix.Z",rotZ,
"LOFAR_PIC_StationInfo.LBA.centerX",centerX,"LOFAR_PIC_StationInfo.LBA.centerY",centerY,"LOFAR_PIC_StationInfo.LBA.centerZ",centerZ);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment