You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/04/07 00:12:22 UTC

[1/4] git commit: CLIMATE-402 - Fix ParameterSelectCtrl time value initialization

Repository: climate
Updated Branches:
  refs/heads/master e4c5ccca3 -> 6137db7aa


CLIMATE-402 - Fix ParameterSelectCtrl time value initialization

- The default start time is now set to 1900-01-01. This should prevent
  the dataset's start time from being prior to this date and thus
  ignored.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/f142c198
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/f142c198
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/f142c198

Branch: refs/heads/master
Commit: f142c19833d5d92341fdb97414da73819adb78ca
Parents: e4c5ccc
Author: Michael Joyce <jo...@apache.org>
Authored: Sun Apr 6 14:47:30 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Sun Apr 6 14:47:30 2014 -0700

----------------------------------------------------------------------
 ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/f142c198/ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js b/ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js
index c7636b6..d75e9d3 100644
--- a/ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js
+++ b/ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js
@@ -28,7 +28,7 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, region
 	$scope.latMax = 90;
 	$scope.lonMin = -180;
 	$scope.lonMax = 180;
-	$scope.start = "1980-01-01 00:00:00";
+	$scope.start = "1900-01-01 00:00:00";
 	$scope.end = "2030-01-01 00:00:00";
 
 	// The min/max lat/lon values that are displayed
@@ -245,7 +245,7 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, region
 					latMax        = 90,
 					lonMin        = -180,
 					lonMax        = 180,
-					start         = "1980-01-01 00:00:00",
+					start         = "1900-01-01 00:00:00",
 					end           = "2030-01-01 00:00:00",
 					datasetRegrid = false;
  				// Get the valid lat/lon range in the selected datasets.


[4/4] git commit: Resolve CLIMATE-403. Merge PR #20.

Posted by jo...@apache.org.
Resolve CLIMATE-403. Merge PR #20.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/6137db7a
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/6137db7a
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/6137db7a

Branch: refs/heads/master
Commit: 6137db7aa5bd61d18892f222cf769b3b58c0b6a9
Parents: c4dddba 2d30643
Author: Michael Joyce <jo...@apache.org>
Authored: Sun Apr 6 15:11:14 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Sun Apr 6 15:11:14 2014 -0700

----------------------------------------------------------------------
 .../app/js/controllers/RcmedSelectionCtrl.js    | 79 +++++++++++++-------
 1 file changed, 51 insertions(+), 28 deletions(-)
----------------------------------------------------------------------



[3/4] git commit: Resolve CLIMATE-402. Merge PR #21.

Posted by jo...@apache.org.
Resolve CLIMATE-402. Merge PR #21.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/c4dddba1
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/c4dddba1
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/c4dddba1

Branch: refs/heads/master
Commit: c4dddba1063d4ca668ded8fd20324c10bf7116ed
Parents: e4c5ccc f142c19
Author: Michael Joyce <jo...@apache.org>
Authored: Sun Apr 6 15:10:11 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Sun Apr 6 15:10:11 2014 -0700

----------------------------------------------------------------------
 ocw-ui/frontend/app/js/controllers/ParameterSelectCtrl.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: CLIMATE-403 - Integrate /parameters/bounds endpoint into UI

Posted by jo...@apache.org.
CLIMATE-403 - Integrate /parameters/bounds endpoint into UI

- Add getObservationBounds for retrieving bounds information from RCMED.
  This grabs all the parameter information from RCMED and stores it in
  observationBounds.
- Add getBoundsByParameterId helper for retrieving parameter information
  when adding a dataset. If not information is present for the requested
  parameter Id then a default value is returned instead.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/2d306436
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/2d306436
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/2d306436

Branch: refs/heads/master
Commit: 2d3064361d97e104e7066de3f6e4a9f4fb67dc13
Parents: e4c5ccc
Author: Michael Joyce <jo...@apache.org>
Authored: Sun Apr 6 15:02:33 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Sun Apr 6 15:02:33 2014 -0700

----------------------------------------------------------------------
 .../app/js/controllers/RcmedSelectionCtrl.js    | 79 +++++++++++++-------
 1 file changed, 51 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/2d306436/ocw-ui/frontend/app/js/controllers/RcmedSelectionCtrl.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/js/controllers/RcmedSelectionCtrl.js b/ocw-ui/frontend/app/js/controllers/RcmedSelectionCtrl.js
index db95bf8..1513d24 100644
--- a/ocw-ui/frontend/app/js/controllers/RcmedSelectionCtrl.js
+++ b/ocw-ui/frontend/app/js/controllers/RcmedSelectionCtrl.js
@@ -35,18 +35,40 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) {
 			});
 	};
 
-	$scope.getObservationTimeRange = function(datasetID) {
-		var times = {
-			'1' : {'start' : '1989-01-01 00:00:00','end' : '2009-12-31 00:00:00'},	// ERA-Interim
-			'2' : {'start' : '2002-08-31 00:00:00','end' : '2010-01-01 00:00:00'},	// AIRS
-			'3' : {'start' : '1998-01-01 00:00:00','end' : '2010-01-01 00:00:00'},	// TRMM
-			'4' : {'start' : '1948-01-01 00:00:00','end' : '2010-01-01 00:00:00'},	// URD
-			'5' : {'start' : '2000-02-24 00:00:00','end' : '2010-05-30 00:00:00'},	// MODIS
-			'6' : {'start' : '1901-01-01 00:00:00','end' : '2006-12-01 00:00:00'}   // CRU
-		};
+    $scope.getObservationBounds = function() {
+        $scope.observationBounds = {};
 
-		return ((datasetID in times) ? times[datasetID] : false);
-	};
+		$http.get($rootScope.baseURL + '/rcmed/parameters/bounds/').
+        success(function(data) {
+            $scope.observationBounds = data;
+            $scope.observationBounds['default'] = {
+                'start': '1900-01-01 00:00:00',
+                'end': '2050-01-01 00:00:00',
+                'latMin': -90,
+                'latMax': 89,
+                'lonMin': -180,
+                'lonMax': 179,
+            };
+        }).
+        error(function(data) {
+            $scope.observationBounds['default'] = {
+                'start': '1900-01-01 00:00:00',
+                'end': '2050-01-01 00:00:00',
+                'latMin': -90,
+                'latMax': 89,
+                'lonMin': -180,
+                'lonMax': 179,
+            };
+        });
+    };
+
+    $scope.getBoundsByParameterId = function(parameterId) {
+        if (parameterId in $scope.observationBounds) {
+            return $scope.observationBounds[parameterId];
+        } else {
+            return $scope.observationBounds['default'];
+        }
+    };
 
 	$scope.dataSelectUpdated = function() {
 		var urlString = $rootScope.baseURL + '/rcmed/parameters/?dataset=' +
@@ -62,11 +84,6 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) {
 	};
 
 	$scope.addObservation = function() {
-		// This is a horrible hack for temporarily getting a valid time range
-		// for the selected observation. Eventually we need to handle this more
-		// elegantly than indexing into an array...
-		var timeRange = $scope.getObservationTimeRange($scope.datasetSelection["dataset_id"]);
-
 		var newDataset = {};
 
 		newDataset['isObs'] = 1;
@@ -77,18 +94,23 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) {
 		newDataset['id']    = $scope.parameterSelection['parameter_id'];
 		newDataset['param'] = $scope.parameterSelection['parameter_id'];
 		newDataset['paramName'] = $scope.parameterSelection['longname'];
-		// Save the (fake) lat/lon information. We test with the TRMM dataset. RCMED currently
-		// doesn't return bounding information. This functionality is being added soon. When that
-		// is the case these hard coded values should be removed.
-		newDataset['latlonVals'] = {"latMin": -49.875, "latMax": 49.875, "lonMin": -179.875, "lonMax": 179.875};
-		// Set some defaults for lat/lon variable names. This just helps us display stuff later.
+
+        bounds = $scope.getBoundsByParameterId(newDataset['id']);
+        newDataset['latlonVals'] = {
+            'latMin': bounds['lat_min'],
+            'latMax': bounds['lat_max'],
+            'lonMin': bounds['lon_min'],
+            'lonMax': bounds['lon_max'],
+        };
+        newDataset['timeVals'] = {
+            'start': bounds['start_date'],
+            'end': bounds['end_date'],
+        };
+
+        // Set some defaults for lat/lon/time variable names. This just helps
+        // us display stuff later.
 		newDataset['lat'] = "N/A";
 		newDataset['lon'] = "N/A";
-		// Save time range information. If we don't have saved data for this observation then
-		// we set the values to extreme values so they'll be ignored when calculating overlaps.
-		newDataset['timeVals'] = {"start": (timeRange) ? timeRange['start'] : "1901-01-01 00:00:00",
-								  "end": (timeRange) ? timeRange['end'] : "2050-01-01 00:00:00"};
-		// Set a default for the time variable names for display convenience.
 		newDataset['time'] = "N/A";
 
 		selectedDatasetInformation.addDataset(newDataset);
@@ -105,6 +127,7 @@ function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) {
 		}, 2000);
 	};
 
-	// Grab the available observations from RCMED
-	$scope.getObservations();
+    // Grab the available observations from RCMED
+    $scope.getObservations();
+    $scope.getObservationBounds();
 }]);