mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
Exception handling in CTD
This commit is contained in:
parent
156952bafe
commit
1200b13f95
@ -354,6 +354,7 @@ public class MHTClickTrainAlgorithm implements ClickTrainAlgorithm, PamSettings
|
|||||||
TrackBitSet trackBitSet;
|
TrackBitSet trackBitSet;
|
||||||
TrackDataUnits trackUnits;
|
TrackDataUnits trackUnits;
|
||||||
if (nTracks>0) Debug.out.println("-------------------Grab Done Trains---------------");
|
if (nTracks>0) Debug.out.println("-------------------Grab Done Trains---------------");
|
||||||
|
try {
|
||||||
for (int i =0; i<nTracks; i++) {
|
for (int i =0; i<nTracks; i++) {
|
||||||
trackBitSet=mhtKernal.getConfirmedTrack(i);
|
trackBitSet=mhtKernal.getConfirmedTrack(i);
|
||||||
Debug.out.println("MHTAlgorithm: Confirmed Track Grab: No. " + MHTKernel.getTrueBitCount(trackBitSet.trackBitSet) + " flag: " + trackBitSet.flag + " chi2: " +trackBitSet.chi2Track.getChi2());
|
Debug.out.println("MHTAlgorithm: Confirmed Track Grab: No. " + MHTKernel.getTrueBitCount(trackBitSet.trackBitSet) + " flag: " + trackBitSet.flag + " chi2: " +trackBitSet.chi2Track.getChi2());
|
||||||
@ -379,6 +380,10 @@ public class MHTClickTrainAlgorithm implements ClickTrainAlgorithm, PamSettings
|
|||||||
trackCount++;
|
trackCount++;
|
||||||
saveClickTrain(trackUnits, trackBitSet.chi2Track.getMHTChi2Info());
|
saveClickTrain(trackUnits, trackBitSet.chi2Track.getMHTChi2Info());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
System.out.printf("******* MHTClickTrainAlgorithm Exception %s in grabDoneTrains: %s\n", e.getClass().getSimpleName(), e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if (nTracks>0) Debug.out.println("-------------------------------------------------");
|
if (nTracks>0) Debug.out.println("-------------------------------------------------");
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package clickTrainDetector.clickTrainAlgorithms.mht;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
import PamUtils.PamArrayUtils;
|
import PamUtils.PamArrayUtils;
|
||||||
import PamguardMVC.debug.Debug;
|
import PamguardMVC.debug.Debug;
|
||||||
@ -286,6 +287,7 @@ public class MHTKernel<T> {
|
|||||||
MHTChi2<T> mhtChi2;
|
MHTChi2<T> mhtChi2;
|
||||||
int index;
|
int index;
|
||||||
synchronized(trackSynchronisation) {
|
synchronized(trackSynchronisation) {
|
||||||
|
try {
|
||||||
for (int i=0; i<possibleTracks.size(); i++) {
|
for (int i=0; i<possibleTracks.size(); i++) {
|
||||||
|
|
||||||
currentBitSet=possibleTracks.get(i).trackBitSet;
|
currentBitSet=possibleTracks.get(i).trackBitSet;
|
||||||
@ -314,6 +316,10 @@ public class MHTKernel<T> {
|
|||||||
newPossibilities.add(new TrackBitSet(currentBitSet, mhtChi2));
|
newPossibilities.add(new TrackBitSet(currentBitSet, mhtChi2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
System.out.printf("******* MHTKernel Exception %s in growProbMatrix: %s\n", e.getClass().getSimpleName(), e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long time2 = System.currentTimeMillis();
|
long time2 = System.currentTimeMillis();
|
||||||
@ -348,10 +354,21 @@ public class MHTKernel<T> {
|
|||||||
//first sort the tracks by increasing chi2 values.
|
//first sort the tracks by increasing chi2 values.
|
||||||
//sort the possible tracks by chi2 values
|
//sort the possible tracks by chi2 values
|
||||||
//now sort the chi2 values so they correspond to the track list.
|
//now sort the chi2 values so they correspond to the track list.
|
||||||
Collections.sort(newPossibleTracks, (left, right)->{
|
// Collections.sort(newPossibleTracks, (left, right)->{
|
||||||
//Note- this is definitely in the correct order
|
// //Note- this is definitely in the correct order
|
||||||
|
// return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2());
|
||||||
|
// });
|
||||||
|
try {
|
||||||
|
Collections.sort(newPossibleTracks, new Comparator<TrackBitSet>() {
|
||||||
|
@Override
|
||||||
|
public int compare(TrackBitSet left, TrackBitSet right) {
|
||||||
return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2());
|
return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
System.out.printf("******* MHTKernel Exception %s in pruneProbMatrix: %s\n", e.getClass().getSimpleName(), e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
// for (int i=0; i<newPossibleTracks.size(); i++) {
|
// for (int i=0; i<newPossibleTracks.size(); i++) {
|
||||||
// System.out.print("Possibility chi2: " + i + " " + String.format("%.3f", newPossibleTracks.get(i).chi2Track.getChi2()));
|
// System.out.print("Possibility chi2: " + i + " " + String.format("%.3f", newPossibleTracks.get(i).chi2Track.getChi2()));
|
||||||
|
Loading…
Reference in New Issue
Block a user