mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
add normalize_axis_index function
This commit is contained in:
parent
55b2ec7fa5
commit
8d3e56e1db
@ -568,6 +568,7 @@ public class NetCDFDataInfo extends DataInfo implements IGridDataInfo, IStationD
|
||||
for (ucar.nc2.Variable aVar : ncVariables) {
|
||||
if (aVar.getShortName().equals("_HDFEOS_CRS")) {
|
||||
pVar = aVar;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -595,9 +596,9 @@ public class NetCDFDataInfo extends DataInfo implements IGridDataInfo, IStationD
|
||||
ucar.nc2.Attribute ulAtt = pVar.findAttributeIgnoreCase("UpperLeftPointMtrs");
|
||||
ucar.nc2.Attribute lrAtt = pVar.findAttributeIgnoreCase("LowerRightMtrs");
|
||||
double xmin = ulAtt.getValues().getDouble(0);
|
||||
double ymax = ulAtt.getValues().getDouble(1);
|
||||
double ymin = ulAtt.getValues().getDouble(1);
|
||||
double xmax = lrAtt.getValues().getDouble(0);
|
||||
double ymin = lrAtt.getValues().getDouble(1);
|
||||
double ymax = lrAtt.getValues().getDouble(1);
|
||||
if (proj.contains("GCTP_GEO")) {
|
||||
if (Math.abs(xmax) > 1000000) {
|
||||
xmin = xmin / 1000000;
|
||||
@ -607,9 +608,9 @@ public class NetCDFDataInfo extends DataInfo implements IGridDataInfo, IStationD
|
||||
}
|
||||
}
|
||||
if (ymin > ymax) {
|
||||
double temp = ymax;
|
||||
ymax = ymin;
|
||||
ymin = temp;
|
||||
// double temp = ymax;
|
||||
// ymax = ymin;
|
||||
// ymin = temp;
|
||||
if (this._fileTypeId.equals("HDF5-EOS")) {
|
||||
this.setYReverse(true);
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\traj">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\cuace\script"/>
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\satellite">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
@ -14,19 +12,23 @@
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
||||
<RecentFolder Folder="D:\Run\emips\run_meic"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\traj"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\hdf"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contourf_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\classification\moon.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\traj\hy_conc_minutes.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\satellite\sea_ice.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contourf_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\classification\moon.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\traj\hy_conc_minutes.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\satellite\sea_ice.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
@ -34,5 +36,5 @@
|
||||
</Font>
|
||||
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
|
||||
<Figure DoubleBuffering="true"/>
|
||||
<Startup MainFormLocation="-7,-7" MainFormSize="1293,693"/>
|
||||
<Startup MainFormLocation="-7,0" MainFormSize="1362,788"/>
|
||||
</MeteoInfo>
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
from .multiarray import NDArray
|
||||
from .multiarray import NDArray, normalize_axis_index
|
||||
from .dimarray import DimArray, dimension
|
||||
from .mitable import PyTableData
|
||||
from ._dtype import dtype
|
||||
@ -7,6 +7,6 @@ from numeric import *
|
||||
from . import fromnumeric
|
||||
from fromnumeric import *
|
||||
|
||||
__all__ = ['NDArray','DimArray','PyTableData','dtype','dimension']
|
||||
__all__ = ['NDArray','DimArray','PyTableData','dtype','dimension','normalize_axis_index']
|
||||
__all__ += numeric.__all__
|
||||
__all__ += fromnumeric.__all__
|
||||
19
meteoinfo-lab/pylib/mipylib/numeric/core/_exceptions.py
Normal file
19
meteoinfo-lab/pylib/mipylib/numeric/core/_exceptions.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""
|
||||
Exceptions
|
||||
"""
|
||||
|
||||
class AxisError(IndexError):
|
||||
""" Axis supplied was invalid. """
|
||||
def __init__(self, axis, ndim=None, msg_prefix=None):
|
||||
# single-argument form just delegates to base class
|
||||
if ndim is None and msg_prefix is None:
|
||||
msg = axis
|
||||
|
||||
# do the string formatting here, to save work in the C code
|
||||
else:
|
||||
msg = ("axis {} is out of bounds for array of dimension {}"
|
||||
.format(axis, ndim))
|
||||
if msg_prefix is not None:
|
||||
msg = "{}: {}".format(msg_prefix, msg)
|
||||
|
||||
super(IndexError, self).__init__(msg)
|
||||
1021
meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py
Normal file
1021
meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user