update eof function for NaN data processing

This commit is contained in:
wyq 2022-12-02 09:15:27 +08:00
parent 7f625c1308
commit b5fa6aa590
8 changed files with 53 additions and 31 deletions

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-core:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221130.170129-511.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221130.170129-511-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221130.170129-511-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-legacy-core:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221130.170129-645.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221130.170129-645-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221130.170129-645-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,34 +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\3d\jogl\volume">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\geoshow"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\taylor"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
<RecentFolder Folder="D:\Temp\test"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\wrf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW\airship"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW\airship"/>
<RecentFolder Folder="D:\Temp\test"/>
<RecentFolder Folder="D:\Temp\test\eof"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\linalg"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox\miml\neural_network"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox\miml"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox\miml\classification"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
</Path>
<File>
<OpenedFiles>
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_windspeed.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_dBZ.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_streamplot3.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\eof_elnino.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\anomalies.py"/>
</OpenedFiles>
<RecentFiles>
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_windspeed.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_dBZ.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\typhoon_streamplot3.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\eof_elnino.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\anomalies.py"/>
</RecentFiles>
</File>
<Font>
@ -36,5 +36,5 @@
</Font>
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
<Figure DoubleBuffering="true"/>
<Startup MainFormLocation="-7,0" MainFormSize="1468,831"/>
<Startup MainFormLocation="-7,0" MainFormSize="1370,772"/>
</MeteoInfo>

View File

@ -511,7 +511,8 @@ def eof(x, svd=True, transform=False, return_index=False):
"""
has_nan = False
if x.contains_nan(): #Has NaN value
valid_idx = np.where(x[:,0]!=np.nan)[0]
mask = np.isnan(x).sum(axis=1)
valid_idx = np.where(mask==0)[0]
xx = x[valid_idx,:]
has_nan = True
else:

View File

@ -19,6 +19,10 @@ class NDArray(object):
def __init__(self, array):
if not isinstance(array, Array):
array = ArrayUtil.array(array, None)
if array.getRank() == 0:
array = ArrayUtil.array([array.getIndexIterator().getObjectNext()])
self._array = array
self.ndim = array.getRank()
s = array.getShape()

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="config.xml" Type="configurefile">
<Path OpenPath="D:\Temp\grads"/>
<Path OpenPath="D:\Temp\traj\test"/>
<Font>
<TextFont FontName="YaHei Consolas Hybrid" FontSize="14"/>
<LegendFont FontName="宋体" FontSize="12"/>

View File

@ -2,14 +2,13 @@
<MeteoInfo File="default.mip" Type="projectfile">
<MapFrames>
<MapFrame Active="true" DrawGridLabel="true" DrawGridLine="false" DrawNeatLine="true" Expanded="true" GridFontName="Arial" GridFontSize="12" GridLineColor="0xff808080" GridLineSize="1.0" GridLineStyle="DASH" GridXDelt="10.0" GridXOrigin="-180.0" GridYDelt="10.0" GridYOrigin="-90.0" Height="364" Left="48" Name="New Map Frame" NeatLineColor="0xff000000" NeatLineSize="1.0" Order="0" Top="30" Width="776">
<Extents xMax="1.3153148906367643E7" xMin="1.281804897436543E7" yMax="4934473.71932323" yMin="4763254.775964434"/>
<Extents xMax="56.10991640761918" xMin="22.609371765495784" yMax="42.84901721616686" yMin="25.730607041895013"/>
<MapProperty BackColor="0xffffffff" ForeColor="0xff000000" HighSpeedWheelZoom="true" MultiGlobalDraw="true" PointSmoothingMode="true" SelectColor="0xff66ffff" SmoothingMode="false" XYScaleFactor="1.0"/>
<GridLine DrawGridLine="false" DrawGridTickLine="false" GridLineColor="0xff808080" GridLineSize="1.0" GridLineStyle="DASH"/>
<MaskOut MaskLayer="china.shp" SetMaskLayer="false"/>
<Projection IsLonLatMap="false" ProjStr="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 "/>
<Projection IsLonLatMap="true" ProjStr="+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees "/>
<GroupLayer>
<Layer Handle="3" IsMaskout="false" LayerDrawType="IMAGE" LayerName="WebMap_AMap" LayerType="WEB_MAP_LAYER" TransparencyPerc="0" Visible="true" WebMapProvider="AMap"/>
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\Distribution\Java\MeteoInfo\MeteoInfo\map\cn_province.shp" Handle="1" IsMaskout="false" LayerDrawType="MAP" LayerName="cn_province.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON_Z" TransparencyPerc="0" Visible="true">
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\Distribution\Java\MeteoInfo\MeteoInfo\map\cn_province.shp" Handle="2" IsMaskout="false" LayerDrawType="MAP" LayerName="cn_province.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON_Z" TransparencyPerc="0" Visible="true">
<LegendScheme BreakNum="1" FieldName="" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYGON_Z" UNDEF="-9999.0">
<Breaks>
<Break BackColor="0x00ffffff" Caption="" Color="0xfffffbc3" DrawFill="false" DrawOutline="true" DrawShape="true" EndValue="0" OutlineColor="0xff808080" OutlineSize="1.0" StartValue="0" Style="NONE" StyleSize="8" Tag=""/>
@ -25,7 +24,7 @@
<ChartGraphics/>
<VisibleScale EnableMaxVisScale="false" EnableMinVisScale="false" MaxVisScale="0.0" MinVisScale="0.0"/>
</Layer>
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\..\Temp\Map\country1.shp" Handle="2" IsMaskout="false" LayerDrawType="MAP" LayerName="country1.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON" TransparencyPerc="0" Visible="true">
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\..\Temp\Map\country1.shp" Handle="3" IsMaskout="false" LayerDrawType="MAP" LayerName="country1.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON" TransparencyPerc="0" Visible="true">
<LegendScheme BreakNum="1" FieldName="" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYGON" UNDEF="-9999.0">
<Breaks>
<Break BackColor="0x00ffffff" Caption="" Color="0xfffffbc3" DrawFill="false" DrawOutline="true" DrawShape="true" EndValue="0" OutlineColor="0xff000000" OutlineSize="1.0" StartValue="0" Style="NONE" StyleSize="8" Tag=""/>
@ -41,6 +40,24 @@
<ChartGraphics/>
<VisibleScale EnableMaxVisScale="false" EnableMinVisScale="false" MaxVisScale="0.0" MinVisScale="0.0"/>
</Layer>
<Group Expanded="true" GroupHandle="1" GroupName="Trajectory">
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\..\Temp\traj\test\201901mainversion.shp" Handle="4" IsMaskout="false" LayerDrawType="TRAJECTORY_LINE" LayerName="201901mainversion.shp" LayerType="VECTOR_LAYER" ShapeType="POLYLINE_Z" TransparencyPerc="0" Visible="true">
<LegendScheme BreakNum="1" FieldName="Year" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYLINE" UNDEF="-9999.0">
<Breaks>
<Break Caption="" Color="0xffff33cc" DrawShape="true" DrawSymbol="false" EndValue="0" FillSymbol="false" Size="1.0" StartValue="0" Style="SOLID" SymbolColor="0xff000000" SymbolFillColor="0xff000000" SymbolInterval="1" SymbolSize="8.0" SymbolStyle="UP_TRIANGLE" Tag=""/>
</Breaks>
</LegendScheme>
<LabelSet AlignType="CENTER" AutoDecimal="true" AvoidCollision="true" DecimalDigits="2" DrawLabels="false" DrawShadow="false" FieldName="" FontName="宋体" FontSize="12" LabelColor="0xff000000" Offset="0" ShadowColor="0xffffffff"/>
<Graphics/>
<ChartSet AlignType="CENTER" AvoidCollision="true" BarWidth="8" ChartType="BAR_CHART" DrawCharts="false" DrawLabel="false" FieldNames="" FontName="Arial" FontSize="12" LabelColor="0xff000000" MaxSize="50" MaxValue="0.0" MinSize="0" MinValue="0.0" Thickness="5" View3D="false" XShift="0" YShift="0">
<LegendScheme BreakNum="0" FieldName="" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYGON" UNDEF="0.0">
<Breaks/>
</LegendScheme>
</ChartSet>
<ChartGraphics/>
<VisibleScale EnableMaxVisScale="false" EnableMinVisScale="false" MaxVisScale="0.0" MinVisScale="0.0"/>
</Layer>
</Group>
</GroupLayer>
<Graphics/>
</MapFrame>