Merge pull request #24 from PAMGuard/main

Fixes to click train detector (#73)
This commit is contained in:
Douglas Gillespie 2022-09-30 14:24:34 +01:00 committed by GitHub
commit de809b6572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -231,9 +231,9 @@ public class TOADBearingAlgorithm extends BaseFFTBearingAlgorithm {
*/
// locBearings[0][0] = Math.PI/2-locBearings[0][0];
if (arrayShape == ArrayManager.ARRAY_TYPE_PLANE) {
locBearings[0][0] = Math.PI/2-locBearings[0][0];
}
// if (arrayShape == ArrayManager.ARRAY_TYPE_PLANE) {
// locBearings[0][0] = Math.PI/2-locBearings[0][0];
// }
PamVector[] arrayAxis = bearingLocaliser.getArrayAxis();
double[] arrayAngles = PamVector.getMinimalHeadingPitchRoll(arrayAxis);

View File

@ -49,6 +49,13 @@ public class CTClassifierParams implements Cloneable, Serializable, ManagedParam
*/
public CTClassifierType type;
/**
* Create a new unique string identifier - USE WITH CAUTION as the unique ID is used to identify data selectors.
*/
public void newUniqueID() {
this.uniqueID = UUID.randomUUID().toString();
};
public CTClassifierParams clone() {
try {
CTClassifierParams clonedParams =(CTClassifierParams) super.clone();

View File

@ -119,6 +119,8 @@ public class Chi2ThresholdClassifier implements CTClassifier {
public void createDataSelector(PamDataBlock<?> source) {
//System.out.println("Create data selector " +" " + clssfrParams.classifierName + " " + clssfrParams.speciesFlag + " " + clssfrParams.uniqueID );
if (clssfrParams.uniqueID==null) clssfrParams.newUniqueID();
if (dataSelector==null || dataSelector.getPamDataBlock()!=source) {
//create the data selector
//System.out.println("Data selector: " + dataSelector);

View File

@ -148,13 +148,13 @@ public class StandardClassifier implements CTClassifier {
// + " sub species: "+ classifiers.get(i).getParams().speciesFlag + " standard species: " +speciesID + " use? : " + standardClssfrParams.enable[i]);
if (standardClssfrParams.enable[i]) {
if (ctClassification[i].getSpeciesID() != SUB_CLASSIFIER_SPECIESID){
if (ctClassification[i].getSpeciesID() < 0){
speciesID = CTClassifier.NOSPECIES;
}
}
}
//System.out.println("SPECIES ID: " + speciesID);
//System.out.println("SPECIES ID: " + speciesID + " clickTrain: " + clickTrain.getUID());
//create the classification.
StandardClassification classification = new StandardClassification(ctClassification, speciesID);