mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
fix micaps mdfs data reading bug for missing value
This commit is contained in:
parent
fac368dc7c
commit
bc19343cc5
@ -67,7 +67,7 @@ import java.util.zip.ZipInputStream;
|
||||
public static String getVersion(){
|
||||
String version = GlobalUtil.class.getPackage().getImplementationVersion();
|
||||
if (version == null || version.equals("")) {
|
||||
version = "3.6.1";
|
||||
version = "3.6.2";
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
@ -363,6 +363,34 @@ public class MDFSDataInfo extends DataInfo implements IGridDataInfo, IStationDat
|
||||
}
|
||||
}
|
||||
|
||||
private Array initDataArray(DataType dataType) {
|
||||
Array array = Array.factory(dataType, new int[]{numStation});
|
||||
switch (dataType) {
|
||||
case FLOAT:
|
||||
for (int i = 0; i < numStation; i++) {
|
||||
array.setFloat(i, Float.NaN);
|
||||
}
|
||||
break;
|
||||
case DOUBLE:
|
||||
for (int i = 0; i < numStation; i++) {
|
||||
array.setDouble(i, Double.NaN);
|
||||
}
|
||||
break;
|
||||
case SHORT:
|
||||
for (int i = 0; i < numStation; i++) {
|
||||
array.setShort(i, Short.MIN_VALUE);
|
||||
}
|
||||
break;
|
||||
case INT:
|
||||
for (int i = 0; i < numStation; i++) {
|
||||
array.setInt(i, Integer.MIN_VALUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
private DataFrame readDataFrame(RandomAccessFile br) throws IOException {
|
||||
List<Array> data = new ArrayList<>();
|
||||
ColumnIndex columns = new ColumnIndex();
|
||||
@ -370,7 +398,7 @@ public class MDFSDataInfo extends DataInfo implements IGridDataInfo, IStationDat
|
||||
for (Variable var : this.variables) {
|
||||
varSizes.add(this.getDataTypeSize(var.getDataType()));
|
||||
columns.add(new Column(var.getName(), var.getDataType()));
|
||||
data.add(Array.factory(var.getDataType(), new int[]{numStation}));
|
||||
data.add(initDataArray(var.getDataType()));
|
||||
}
|
||||
|
||||
List<String> idxList = new ArrayList<>();
|
||||
@ -720,7 +748,7 @@ public class MDFSDataInfo extends DataInfo implements IGridDataInfo, IStationDat
|
||||
if (this.varMap.containsKey(varId)) {
|
||||
return (String)varMap.get(varId);
|
||||
} else {
|
||||
return "Undefine";
|
||||
return "Undefine_" + String.valueOf(varId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,40 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\funny">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\io\micaps">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\savefig"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\wind"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\funny"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\micaps"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\_reload.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour\contour3_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot\streamplot_3.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot\streamplot_2d_2.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf\surf_peaks.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\funny\butterfly.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\micaps\mdfs_dataframe_2.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\_reload.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour\contour3_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot\streamplot_3.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot\streamplot_2d_2.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf\surf_peaks.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\funny\butterfly.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\io\micaps\mdfs_dataframe_2.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user