diff --git a/src/clickTrainDetector/clickTrainAlgorithms/mht/DefaultMHTParams.java b/src/clickTrainDetector/clickTrainAlgorithms/mht/DefaultMHTParams.java index 20d36b2a..fed45f55 100644 --- a/src/clickTrainDetector/clickTrainAlgorithms/mht/DefaultMHTParams.java +++ b/src/clickTrainDetector/clickTrainAlgorithms/mht/DefaultMHTParams.java @@ -1,10 +1,12 @@ package clickTrainDetector.clickTrainAlgorithms.mht; +import PamguardMVC.PamDataBlock; import clickTrainDetector.clickTrainAlgorithms.mht.mhtvar.BearingChi2VarParams; import clickTrainDetector.clickTrainAlgorithms.mht.mhtvar.BearingChi2VarParams.BearingJumpDrctn; import clickTrainDetector.clickTrainAlgorithms.mht.mhtvar.CorrelationChi2Params; import clickTrainDetector.clickTrainAlgorithms.mht.mhtvar.IDIChi2Params; import clickTrainDetector.clickTrainAlgorithms.mht.mhtvar.SimpleChi2VarParams; +import cpod.CPODClickDataBlock; /** * Default parameters for different species for the MHT click train detector. @@ -74,10 +76,11 @@ public class DefaultMHTParams { /** * Get default MHT parameters for a particular default species. + * @param pamDataBlock * * @return the default MHT parameters for giver DefaultMHTSpecies. */ - public static MHTParams getDefaultMHTParams(DefaultMHTSpecies defaultSpecies) { + public static MHTParams getDefaultMHTParams(DefaultMHTSpecies defaultSpecies, PamDataBlock pamDataBlock ) { MHTParams mhtParams = new MHTParams(); @@ -146,28 +149,70 @@ public class DefaultMHTParams { break; case PORPOISE: + + if (pamDataBlock!=null && pamDataBlock.getClass().isAssignableFrom(CPODClickDataBlock.class)) { + + chi2Settings[0]= new IDIChi2Params("ICI", "s", 0.2, 0.0002, SimpleChi2VarParams.SCALE_FACTOR_ICI); + ((IDIChi2Params) chi2Settings[0]).minIDI = 0.001; + chi2Settings[1]= new SimpleChi2VarParams("Amplitude", "dB", 100, 0.6, SimpleChi2VarParams.SCALE_FACTOR_AMPLITUDE); + chi2Settings[2]= new BearingChi2VarParams("Bearing Delta", "\u00b0", Math.toRadians(0.2), Math.toRadians(0.01), + SimpleChi2VarParams.SCALE_FACTOR_BEARING); //RADIANS + chi2Settings[3]= new CorrelationChi2Params("Correlation"); - chi2Settings[0]= new IDIChi2Params("ICI", "s", 0.2, 0.0002, SimpleChi2VarParams.SCALE_FACTOR_ICI); - chi2Settings[1]= new SimpleChi2VarParams("Amplitude", "dB", 30, 1, SimpleChi2VarParams.SCALE_FACTOR_AMPLITUDE); - chi2Settings[2]= new BearingChi2VarParams("Bearing Delta", "\u00b0", Math.toRadians(0.2), Math.toRadians(0.01), - SimpleChi2VarParams.SCALE_FACTOR_BEARING); //RADIANS - chi2Settings[3]= new CorrelationChi2Params("Correlation"); + simpleChi2Params.chi2Settings = chi2Settings; - simpleChi2Params.chi2Settings = chi2Settings; + simpleChi2Params.enable = new boolean[] {true, true, false, false, false, false}; + + simpleChi2Params.maxICI = 0.25; + + simpleChi2Params.coastPenalty = 10; + simpleChi2Params.newTrackPenalty = 50; + simpleChi2Params.longTrackExponent = 0.01; + simpleChi2Params.lowICIExponent = 2; + simpleChi2Params.newTrackN = 3; - simpleChi2Params.enable = new boolean[] {true, true, true, false, false, false}; + //the MHT kernel params + mhtKernelParams.maxCoast = 2; + mhtKernelParams.nHold = 100; + mhtKernelParams.nPruneBackStart = 15; + mhtKernelParams.nPruneback = 8; + + mhtKernelParams.nPruneback = 8; + + + + //set the two main parameter classes. + mhtParams.chi2Params = simpleChi2Params; + mhtParams.mhtKernal = mhtKernelParams; + + } + + else { - - //the MHT kernel params - mhtKernelParams.maxCoast = 7; - mhtKernelParams.nHold = 40; - mhtKernelParams.nPruneBackStart = 15; - mhtKernelParams.nPruneback = 7; - - //set the two main parameter classes. - mhtParams.chi2Params = simpleChi2Params; - mhtParams.mhtKernal = mhtKernelParams; + chi2Settings[0]= new IDIChi2Params("ICI", "s", 0.2, 0.0002, SimpleChi2VarParams.SCALE_FACTOR_ICI); + chi2Settings[1]= new SimpleChi2VarParams("Amplitude", "dB", 30, 1, SimpleChi2VarParams.SCALE_FACTOR_AMPLITUDE); + chi2Settings[2]= new BearingChi2VarParams("Bearing Delta", "\u00b0", Math.toRadians(0.2), Math.toRadians(0.01), + SimpleChi2VarParams.SCALE_FACTOR_BEARING); //RADIANS + chi2Settings[3]= new CorrelationChi2Params("Correlation"); + + simpleChi2Params.chi2Settings = chi2Settings; + + simpleChi2Params.enable = new boolean[] {true, true, true, false, false, false}; + + + + //the MHT kernel params + mhtKernelParams.maxCoast = 7; + mhtKernelParams.nHold = 40; + mhtKernelParams.nPruneBackStart = 15; + mhtKernelParams.nPruneback = 7; + + //set the two main parameter classes. + mhtParams.chi2Params = simpleChi2Params; + mhtParams.mhtKernal = mhtKernelParams; + + } break; diff --git a/src/clickTrainDetector/layout/mht/MHTSettingsPane.java b/src/clickTrainDetector/layout/mht/MHTSettingsPane.java index 887a4194..dc0e1c6d 100644 --- a/src/clickTrainDetector/layout/mht/MHTSettingsPane.java +++ b/src/clickTrainDetector/layout/mht/MHTSettingsPane.java @@ -222,7 +222,7 @@ public class MHTSettingsPane extends SettingsPane { for (DefaultMHTSpecies speciesTypes: DefaultMHTSpecies.values()) { menuItem = new MenuItem(DefaultMHTParams.getDefaultSpeciesName(speciesTypes)); menuItem.setOnAction((action)->{ - setParams(DefaultMHTParams.getDefaultMHTParams(speciesTypes)); + setParams(DefaultMHTParams.getDefaultMHTParams(speciesTypes, mhtClickTrainAlgorithm.getClickTrainControl().getParentDataBlock())); }); speciesChoiceBox.getItems().add(menuItem); } diff --git a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericDLClassifier.java b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericDLClassifier.java index 909cf7aa..9efc88f6 100644 --- a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericDLClassifier.java +++ b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericDLClassifier.java @@ -92,6 +92,12 @@ public class GenericDLClassifier implements DLClassiferModel, PamSettings { //System.out.println("PrepModel! !!!"); genericModelWorker.prepModel(genericModelParams, dlControl); //set cusotm transforms in the model. + + if (genericModelParams.dlTransfromParams!=null) { + //important to remkae transforms from params + genericModelParams.dlTransfroms = DLTransformsFactory.makeDLTransforms((ArrayList)genericModelParams.dlTransfromParams); + } + genericModelWorker.setModelTransforms(genericModelParams.dlTransfroms); diff --git a/src/rawDeepLearningClassifier/dlClassification/ketos/KetosWorker.java b/src/rawDeepLearningClassifier/dlClassification/ketos/KetosWorker.java index 85de0e4d..c3c6f161 100644 --- a/src/rawDeepLearningClassifier/dlClassification/ketos/KetosWorker.java +++ b/src/rawDeepLearningClassifier/dlClassification/ketos/KetosWorker.java @@ -120,11 +120,7 @@ public class KetosWorker extends DLModelWorker { // System.out.println("Class name " + i + " " + dlParams.classNames[i]); // } // } - - // ketosDLParams.classNames = dlControl.getClassNameManager().makeClassNames(ketosParams.classNames); - - // if (ketosParams.classNames!=null) { // for (int i = 0; i