bugfix for ndarray slice

This commit is contained in:
wyq 2025-12-06 10:56:07 +08:00
parent ef01dad264
commit 16c48de0f5
8 changed files with 53 additions and 77 deletions

View File

@ -30,13 +30,13 @@ package org.meteoinfo.geometry.legend;
public class ColorBreak {
// <editor-fold desc="Variables">
protected BreakTypes breakType;
protected Object startValue;
protected Object endValue;
protected Color color;
protected String caption;
protected boolean isNoData;
protected boolean drawShape;
protected BreakTypes breakType = BreakTypes.COLOR_BREAK;
protected Object startValue = 0;
protected Object endValue = 0;
protected Color color = Color.BLACK;
protected String caption = "";
protected boolean isNoData = false;
protected boolean drawShape = true;
protected String tag;
// </editor-fold>
// <editor-fold desc="Constructor">
@ -45,13 +45,6 @@ package org.meteoinfo.geometry.legend;
* Constructor
*/
public ColorBreak() {
breakType = BreakTypes.COLOR_BREAK;
color = Color.BLACK;
isNoData = false;
drawShape = true;
startValue = 0;
endValue = 0;
caption = "";
}
// </editor-fold>
// <editor-fold desc="Get Set Methods">

View File

@ -28,17 +28,17 @@ package org.meteoinfo.geometry.legend;
public class PointBreak extends ColorBreak {
// <editor-fold desc="Variables">
protected MarkerType markerType;
protected Color outlineColor;
protected float outlineSize;
protected float size;
protected PointStyle style;
protected boolean drawOutline;
protected boolean drawFill;
protected String fontName;
protected int charIndex;
protected MarkerType markerType = MarkerType.SIMPLE;
protected Color outlineColor = Color.BLACK;
protected float outlineSize = 1.0f;
protected float size = 6.0f;
protected PointStyle style = PointStyle.CIRCLE;
protected boolean drawOutline = true;
protected boolean drawFill = true;
protected String fontName = "Arial";
protected int charIndex = 0;
protected String imagePath;
protected float angle;
protected float angle = 0;
// </editor-fold>
// <editor-fold desc="Constructor">

View File

@ -24,17 +24,17 @@ package org.meteoinfo.geometry.legend;
public class PolygonBreak extends ColorBreak {
// <editor-fold desc="Variables">
protected Color outlineColor;
protected float outlineSize;
protected boolean drawOutline;
protected boolean drawFill;
protected Color outlineColor = Color.BLACK;
protected float outlineSize = 1.0f;
protected boolean drawOutline = true;
protected boolean drawFill = false;
//private boolean usingHatchStyle;
protected HatchStyle style;
protected int styleSize;
protected float styleLineWidth;
protected Color backColor;
protected HatchStyle style = HatchStyle.NONE;
protected int styleSize = 8;
protected float styleLineWidth = 1;
protected Color backColor = new Color(1.0f, 1.0f, 1.0f, 0.0f);
//private int _transparencyPerc;
protected boolean isMaskout;
protected boolean isMaskout = false;
// </editor-fold>
// <editor-fold desc="Constructor">
@ -45,17 +45,6 @@ package org.meteoinfo.geometry.legend;
super();
this.color = Color.cyan;
this.breakType = BreakTypes.POLYGON_BREAK;
outlineColor = Color.black;
outlineSize = 1.0f;
drawOutline = true;
drawFill = true;
//usingHatchStyle = false;
style = HatchStyle.NONE;
styleSize = 8;
styleLineWidth = 1;
backColor = new Color(1.0f, 1.0f, 1.0f, 0.0f);
//_transparencyPerc = 0;
isMaskout = false;
}
// </editor-fold>
// <editor-fold desc="Get Set Methods">

View File

@ -24,17 +24,17 @@ import java.util.HashMap;
public class PolylineBreak extends ColorBreak {
// <editor-fold desc="Variables">
protected float width;
protected LineStyles style;
protected boolean drawPolyline;
protected boolean drawSymbol;
protected float symbolSize;
protected PointStyle symbolStyle;
protected Color symbolColor;
protected Color symbolFillColor;
protected boolean fillSymbol;
protected int symbolInterval;
protected float capSize;
protected float width = 1.0f;
protected LineStyles style = LineStyles.SOLID;
protected boolean drawPolyline = true;
protected boolean drawSymbol = false;
protected float symbolSize = 8.0f;
protected PointStyle symbolStyle = PointStyle.UP_TRIANGLE;
protected Color symbolColor = Color.BLACK;
protected Color symbolFillColor = Color.BLACK;
protected boolean fillSymbol = false;
protected int symbolInterval = 1;
protected float capSize = 0;
// </editor-fold>
// <editor-fold desc="Constructor">
@ -43,18 +43,8 @@ public class PolylineBreak extends ColorBreak {
*/
public PolylineBreak() {
super();
this.breakType = BreakTypes.POLYLINE_BREAK;
width = 1.0f;
style = LineStyles.SOLID;
drawPolyline = true;
drawSymbol = false;
symbolSize = 8.0f;
symbolStyle = PointStyle.UP_TRIANGLE;
symbolColor = this.color;
symbolFillColor = symbolColor;
fillSymbol = false;
symbolInterval = 1;
capSize = 0;
}
/**

View File

@ -1,32 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\dataset">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\test"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\burf"/>
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\netcdf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite\himawari"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array\slice"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataset"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\test"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\numpy"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
</Path>
<File>
<OpenedFiles>
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\netcdf\sht_coords.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\water_vapor_flux_digv_3.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\dataset\dimarray_slice.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\numpy\load_npy_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\mpv_3.py"/>
</OpenedFiles>
<RecentFiles>
<RecentFile File="D:\Working\MIScript\Jython\mis\io\netcdf\sht_coords.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\water_vapor_flux_digv_3.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\dataset\dimarray_slice.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\io\numpy\load_npy_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\mpv_3.py"/>
</RecentFiles>
</File>
<Font>
@ -34,5 +36,5 @@
</Font>
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
<Figure DoubleBuffering="true"/>
<Startup MainFormLocation="-6,0" MainFormSize="1377,854"/>
<Startup MainFormLocation="-6,0" MainFormSize="1443,844"/>
</MeteoInfo>

View File

@ -294,7 +294,8 @@ class DimArray(NDArray):
for i in flips:
r = r.flip(i)
r = r.reduce()
if squeeze:
r = r.reduce()
data = DimArray(r, ndims, self.proj)
if onlyrange:
data.base = self.get_base()

View File

@ -244,7 +244,8 @@ class NDArray(object):
for i in flips:
r = r.flip(i)
r = r.reduce()
if squeeze:
r = r.reduce()
r = NDArray(r)
if onlyrange:
r.base = self.get_base()