Skip to content

Commit

Permalink
AUS-4285 Fixed the no countSum value in newAlgoritm Job.
Browse files Browse the repository at this point in the history
  • Loading branch information
jia020 committed Nov 21, 2024
1 parent 92d8d5e commit de3c6e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class TSGModJobProcessor extends IJobProcessor{
private String tsgScript;
private String dataPath;
private String wvLogname = "Reflectance";
private double countSumMax = 0.0;


/**
Expand Down Expand Up @@ -416,6 +417,7 @@ else if (!Utility.stringIsBlankorNull(domainlogid))
String fileFullPath = filePath + "/" + holeIdentifier;
scalarArray.writeScalarCSV(fileFullPath + "-tsgScalar.csv");
scalarArray.writeDownSampledScalarCSV(fileFullPath + "-tsgScalarDownSampled-" + host + ".csv");
this.countSumMax = scalarArray.queryMaxCountSum();
scalarArray = null;
} catch (Exception e) {
logger.error("Exception: on getDownSampledData general failure "+e);
Expand All @@ -441,7 +443,7 @@ private String formatMessage(int type) {
resultMsg = "InitMessage:";
break;
}
return resultMsg;
return String.valueOf(this.countSumMax) + ","+ resultMsg;

}
}
11 changes: 11 additions & 0 deletions src/main/java/org/auscope/nvcl/server/vo/TSGScalarArrayVo.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,15 @@ public boolean query(String units, String logicalOp, double threshHold) {

return isHit;
}
public double queryMaxCountSum() {
double valueMax = 0.0;
/* Now, iterate over the map's contents, sorted by key. */
for (TSGScalarVo spectralData : downSampledScalarArray) {
double value = spectralData.getValue();
if (value>valueMax){
valueMax = value;
}
}
return valueMax;
}
}

0 comments on commit de3c6e2

Please sign in to comment.