You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2015/09/10 18:45:17 UTC
[1/4] climate git commit: CLIMATE-667 - OCW spatial_boundaries bug
Repository: climate
Updated Branches:
refs/heads/master 34cadf03d -> 31f0ff298
CLIMATE-667 - OCW spatial_boundaries bug
- ocw.dataset.spatial_boundaries uses np.min and np.max instead of min and max
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/a0d70579
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a0d70579
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a0d70579
Branch: refs/heads/master
Commit: a0d705794f4bb2ba682a306b0e618d5feab78ef8
Parents: 7f34fc3
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Sep 8 23:03:30 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Sep 8 23:03:30 2015 -0700
----------------------------------------------------------------------
ocw/dataset.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/a0d70579/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index e432928..342e370 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -89,8 +89,8 @@ class Dataset:
:class:`float`, :class:`float`).
'''
- return (float(min(self.lats)), float(max(self.lats)),
- float(min(self.lons)), float(max(self.lons)))
+ return (float(numpy.min(self.lats)), float(numpy.max(self.lats)),
+ float(numpy.min(self.lons)), float(numpy.max(self.lons)))
def time_range(self):
[2/4] climate git commit: CLIMATE-668 -
ocw.dataset_spatial_resolution needs to be fixed
Posted by hu...@apache.org.
CLIMATE-668 - ocw.dataset_spatial_resolution needs to be fixed
- without this fix, ocw.dataset.spatial_resolution cannot handle two dimensional latitudes and longitudes
- for curvilinear latitudes and longitudes, the output of ocw.dataset.spatial_resolution is approximate.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/d3b9bb5b
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/d3b9bb5b
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/d3b9bb5b
Branch: refs/heads/master
Commit: d3b9bb5b3b294051043ce0e127dd4396ca0d7cf8
Parents: a0d7057
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Sep 8 23:53:59 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Sep 8 23:53:59 2015 -0700
----------------------------------------------------------------------
ocw/dataset.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/d3b9bb5b/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index 342e370..80be53c 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -111,16 +111,20 @@ class Dataset:
def spatial_resolution(self):
'''Calculate the latitudinal and longitudinal spatial resolution.
- .. warning:: This only works with properly gridded data.
-
+ If self.lats and self.lons are from curvilinear coordinates,
+ the output resolutions are approximate values.
:returns: The Dataset's latitudinal and longitudinal spatial resolution
as a tuple of the form (lat_resolution, lon_resolution).
:rtype: (:class:`float`, :class:`float`)
'''
- sorted_lats = numpy.sort(list(set(self.lats)))
- sorted_lons = numpy.sort(list(set(self.lons)))
- lat_resolution = sorted_lats[1] - sorted_lats[0]
- lon_resolution = sorted_lons[1] - sorted_lons[0]
+ if self.lats.ndim == 1 and self.lons.ndim ==1:
+ sorted_lats = numpy.sort(list(set(self.lats)))
+ sorted_lons = numpy.sort(list(set(self.lons)))
+ lat_resolution = sorted_lats[1] - sorted_lats[0]
+ lon_resolution = sorted_lons[1] - sorted_lons[0]
+ if self.lats.ndim == 2 and self.lons.ndim ==2:
+ lat_resolution = self.lats[1,1] - self.lats[0,0]
+ lon_resolution = self.lons[1,1] - self.lons[0,0]
return (lat_resolution, lon_resolution)
[3/4] climate git commit: CLIMATE-668 -
ocw.dataset_spatial_resolution needs to be fixed
Posted by hu...@apache.org.
CLIMATE-668 - ocw.dataset_spatial_resolution needs to be fixed
- without this fix, ocw.dataset.spatial_resolution cannot handle two dimensional latitudes and longitudes
- for curvilinear latitudes and longitudes, the output of ocw.dataset.spatial_resolution is approximate.
- suggested changes in CLIMATE-667 are removed
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/998df0cb
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/998df0cb
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/998df0cb
Branch: refs/heads/master
Commit: 998df0cbe543d76b5f4261aa919d07300ecd85fa
Parents: d3b9bb5
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Sep 8 23:59:39 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Sep 8 23:59:39 2015 -0700
----------------------------------------------------------------------
ocw/dataset.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/998df0cb/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index 80be53c..e6b0bc6 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -89,8 +89,8 @@ class Dataset:
:class:`float`, :class:`float`).
'''
- return (float(numpy.min(self.lats)), float(numpy.max(self.lats)),
- float(numpy.min(self.lons)), float(numpy.max(self.lons)))
+ return (float(min(self.lats)), float(max(self.lats)),
+ float(min(self.lons)), float(max(self.lons)))
def time_range(self):
[4/4] climate git commit: CLIMATE-668 -
ocw.dataset_spatial_resolution needs to be fixed
Posted by hu...@apache.org.
CLIMATE-668 - ocw.dataset_spatial_resolution needs to be fixed
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/31f0ff29
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/31f0ff29
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/31f0ff29
Branch: refs/heads/master
Commit: 31f0ff2989008c166bb19983566a56f9e30f7ef4
Parents: 34cadf0 998df0c
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Thu Sep 10 09:44:37 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Thu Sep 10 09:44:37 2015 -0700
----------------------------------------------------------------------
ocw/dataset.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------