mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-28 01:52:28 +00:00
Update to the same format as PAMBinaries for exporting to R
This commit is contained in:
parent
a05c77b2fd
commit
4f233dd43e
27
pom.xml
27
pom.xml
@ -23,6 +23,8 @@
|
||||
<jaxb.runtime.version>2.4.0-b180830.0438</jaxb.runtime.version>
|
||||
<jaxb.api.version>2.4.0-b180830.0359</jaxb.api.version>
|
||||
<jaxb.xjc.version>2.4.0-b180830.0438</jaxb.xjc.version>
|
||||
<mockito.version>1.10.19</mockito.version>
|
||||
<powermock.version>1.6.6</powermock.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@ -888,7 +890,7 @@
|
||||
<dependency>
|
||||
<groupId>tethys.org</groupId>
|
||||
<artifactId>nilus</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -971,6 +973,29 @@
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Four dependencies from xbee library that are needed for Genus module. -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>${mockito.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-module-junit4</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-api-mockito</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -33,7 +33,10 @@ public abstract class RDataUnitExport<T extends PamDataUnit<?, ?>> {
|
||||
rData.add("UID", dataUnit.getUID());
|
||||
rData.add("startSample", dataUnit.getStartSample());
|
||||
rData.add("sampleDuration", dataUnit.getSampleDuration());
|
||||
rData.add("freqLimits", new DoubleArrayVector(dataUnit.getBasicData().getFrequency()));
|
||||
// rData.add("freqLimits", new DoubleArrayVector(dataUnit.getBasicData().getFrequency()));
|
||||
rData.add("minFreq", dataUnit.getBasicData().getFrequency()[0]);
|
||||
rData.add("maxFreq", dataUnit.getBasicData().getFrequency()[1]);
|
||||
rData.add("amplitude", dataUnit.getBasicData().getCalculatedAmlitudeDB());
|
||||
|
||||
//there may be no delay info
|
||||
if (dataUnit.getBasicData().getTimeDelaysSeconds()!=null && dataUnit.getBasicData().getTimeDelaysSeconds().length>=1){
|
||||
|
@ -187,7 +187,9 @@ public class RExportManager implements PamDataUnitExporter {
|
||||
//check whether the same.
|
||||
if (rDataExport.get(i).getUnitClass().isAssignableFrom(dataUnits.get(j).getClass()) && !alreadyStruct[j]) {
|
||||
dataList=rDataExport.get(i).detectionToStruct(dataUnits.get(j), n);
|
||||
dataListArray.add((rDataExport.get(i).getName() + "_" + dataUnits.get(j).getUID()), dataList);
|
||||
//dataListArray.add((rDataExport.get(i).getName() + "_" + dataUnits.get(j).getUID()), dataList);
|
||||
// format used in PAMBinaries
|
||||
dataListArray.add(String.valueOf(dataUnits.get(j).getUID()), dataList);
|
||||
|
||||
sampleRate = dataUnits.get(j).getParentDataBlock().getSampleRate();
|
||||
n++;
|
||||
|
@ -4,9 +4,6 @@ import org.renjin.sexp.AttributeMap;
|
||||
import org.renjin.sexp.IntArrayVector;
|
||||
import org.renjin.sexp.ListVector;
|
||||
import export.MLExport.MLWhistleMoanExport;
|
||||
import us.hebi.matlab.mat.format.Mat5;
|
||||
import us.hebi.matlab.mat.types.Struct;
|
||||
|
||||
import org.renjin.sexp.ListVector.NamedBuilder;
|
||||
|
||||
import PamUtils.PamArrayUtils;
|
||||
@ -37,7 +34,7 @@ public class RWhistleExport extends RDataUnitExport<ConnectedRegionDataUnit> {
|
||||
rData.add("nSlices", dataUnit.getConnectedRegion().getNumSlices());
|
||||
rData.add("sliceData", peakDatas);
|
||||
rData.add("contour", contours);
|
||||
rData.add("contourWidth", contourWidth);
|
||||
rData.add("contWidth", contourWidth);
|
||||
rData.add("meanWidth", PamArrayUtils.mean(contourData[0]));
|
||||
|
||||
|
||||
@ -83,9 +80,7 @@ public class RWhistleExport extends RDataUnitExport<ConnectedRegionDataUnit> {
|
||||
|
||||
ListVector.NamedBuilder peakDatas = new ListVector.NamedBuilder(); ;
|
||||
|
||||
|
||||
Struct mlStructure= Mat5.newStruct(dataUnit.getConnectedRegion().getSliceData().size(), 1);
|
||||
|
||||
|
||||
//the start sample.
|
||||
int sliceNumber;
|
||||
int nPeaks;
|
||||
@ -127,7 +122,7 @@ public class RWhistleExport extends RDataUnitExport<ConnectedRegionDataUnit> {
|
||||
rData.add("nPeaks", nPeaks);
|
||||
rData.add("peakData", peakDataR);
|
||||
|
||||
peakDatas.add(String.valueOf(sliceNumber), rData);
|
||||
peakDatas.add("[["+String.valueOf(i)+"]]", rData);
|
||||
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.dataSelector.DataSelectParams;
|
||||
import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
|
||||
import rawDeepLearningClassifier.DLControl;
|
||||
import rawDeepLearningClassifier.dlClassification.DLDetection;
|
||||
import rawDeepLearningClassifier.dlClassification.PredictionResult;
|
||||
import rawDeepLearningClassifier.logging.DLAnnotation;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user