From 29ecb628d396cd2938b29fad04dee0aec4154e69 Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Thu, 11 Jul 2024 11:27:25 +0100 Subject: [PATCH] Bug fix to data transforms if the wave data and sample length are different --- src/PamguardMVC/RawDataTransforms.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PamguardMVC/RawDataTransforms.java b/src/PamguardMVC/RawDataTransforms.java index 44690ed1..2c7380b3 100644 --- a/src/PamguardMVC/RawDataTransforms.java +++ b/src/PamguardMVC/RawDataTransforms.java @@ -411,7 +411,15 @@ public class RawDataTransforms { paddedRawData = new double[fftLength]; rawData = getWaveData(channel); //double[] rotData = getRotationCorrection(channel); - mn = Math.min(fftLength, getSampleDuration().intValue()); + + /** + *FIXME + * 11/07 Changed from getSampleDuration because an error sometimes occurs where the sample duration + * is not the same as the wavefom length...not sure why. + */ + //mn = Math.min(fftLength, getSampleDuration().intValue()); + mn = Math.min(fftLength, rawData.length); +// System.out.println("fftLength: " + rawData.length + " " + getSampleDuration().intValue() + " mn " +mn); for (i = 0; i < mn; i++) { paddedRawData[i] = rawData[i];//-rotData[i]; }