You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2014/06/02 23:16:40 UTC

[1/4] git commit: Fix model to model script to prevent re-downloading

Repository: climate
Updated Branches:
  refs/heads/master 0fba21fdd -> e9437d04e


Fix model to model script to prevent re-downloading


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

Branch: refs/heads/master
Commit: 6713d723ffea1ae28179a6b55b1078ea70cdd56a
Parents: 0fba21f
Author: cgoodale <si...@gmail.com>
Authored: Mon Jun 2 13:34:52 2014 -0700
Committer: cgoodale <si...@gmail.com>
Committed: Mon Jun 2 13:34:52 2014 -0700

----------------------------------------------------------------------
 examples/simple_model_to_model_bias.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/6713d723/examples/simple_model_to_model_bias.py
----------------------------------------------------------------------
diff --git a/examples/simple_model_to_model_bias.py b/examples/simple_model_to_model_bias.py
index 8b9dcea..59e42a5 100644
--- a/examples/simple_model_to_model_bias.py
+++ b/examples/simple_model_to_model_bias.py
@@ -1,7 +1,8 @@
 import datetime
+from os import path
+import urllib
 
 import numpy as np
-import urllib
 
 import ocw.data_source.local as local
 import ocw.dataset_processor as dsp
@@ -17,9 +18,16 @@ FILE_2 = "AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc"
 # Filename for the output image/plot (without file extension)
 OUTPUT_PLOT = "wrf_bias_compared_to_knmi"
 
-# Download necessary NetCDF files
-urllib.urlretrieve(FILE_LEADER + FILE_1, FILE_1)
-urllib.urlretrieve(FILE_LEADER + FILE_2, FILE_2)
+# Download necessary NetCDF files if not present
+if path.exists(FILE_1):
+    pass
+else:
+    urllib.urlretrieve(FILE_LEADER + FILE_1, FILE_1)
+
+if path.exists(FILE_2):
+    pass
+else:
+    urllib.urlretrieve(FILE_LEADER + FILE_2, FILE_2)
 
 """ Step 1: Load Local NetCDF Files into OCW Dataset Objects """
 print("Loading %s into an OCW Dataset Object" % (FILE_1,))


[2/4] git commit: Prevent re-downloading the model file

Posted by go...@apache.org.
Prevent re-downloading the model file


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

Branch: refs/heads/master
Commit: 50cee8126f7e4a0b57570da5eb4cf120d02de03b
Parents: 6713d72
Author: cgoodale <si...@gmail.com>
Authored: Mon Jun 2 13:38:35 2014 -0700
Committer: cgoodale <si...@gmail.com>
Committed: Mon Jun 2 13:38:35 2014 -0700

----------------------------------------------------------------------
 examples/knmi_to_cru31_full_bias.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/50cee812/examples/knmi_to_cru31_full_bias.py
----------------------------------------------------------------------
diff --git a/examples/knmi_to_cru31_full_bias.py b/examples/knmi_to_cru31_full_bias.py
index 50b9f96..7440ea7 100644
--- a/examples/knmi_to_cru31_full_bias.py
+++ b/examples/knmi_to_cru31_full_bias.py
@@ -1,7 +1,8 @@
 import datetime
+import urllib
+from os import path
 
 import numpy as np
-import urllib
 
 import ocw.data_source.local as local
 import ocw.data_source.rcmed as rcmed
@@ -20,8 +21,11 @@ MODEL = "AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc"
 # Filename for the output image/plot (without file extension)
 OUTPUT_PLOT = "cru_31_tmax_knmi_africa_bias_full"
 
-# Download necessary NetCDF file
-urllib.urlretrieve(FILE_LEADER + MODEL, MODEL)
+# Download necessary NetCDF file if not present
+if path.exists(MODEL):
+    pass
+else:
+    urllib.urlretrieve(FILE_LEADER + MODEL, MODEL)
 
 """ Step 1: Load Local NetCDF File into OCW Dataset Objects """
 print("Loading %s into an OCW Dataset Object" % (MODEL,))


[3/4] git commit: Prevent re-downloading the model file

Posted by go...@apache.org.
Prevent re-downloading the model file


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

Branch: refs/heads/master
Commit: 00ff21bc8ff2a691075aea4447f568edb4641dc9
Parents: 50cee81
Author: cgoodale <si...@gmail.com>
Authored: Mon Jun 2 13:41:36 2014 -0700
Committer: cgoodale <si...@gmail.com>
Committed: Mon Jun 2 13:41:36 2014 -0700

----------------------------------------------------------------------
 examples/simple_model_tstd.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/00ff21bc/examples/simple_model_tstd.py
----------------------------------------------------------------------
diff --git a/examples/simple_model_tstd.py b/examples/simple_model_tstd.py
index 46ff7ae..3420f9b 100644
--- a/examples/simple_model_tstd.py
+++ b/examples/simple_model_tstd.py
@@ -16,6 +16,7 @@
 # under the License.
 
 
+from os import path
 import urllib
 
 import ocw.data_source.local as local
@@ -31,8 +32,11 @@ FILE_1 = "AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc"
 # Filename for the output image/plot (without file extension)
 OUTPUT_PLOT = "knmi_temporal_std"
 
-# Download necessary NetCDF file
-urllib.urlretrieve(FILE_LEADER + FILE_1, FILE_1)
+# Download necessary NetCDF file if needed
+if path.exists(FILE_1):
+    pass
+else:
+    urllib.urlretrieve(FILE_LEADER + FILE_1, FILE_1)
 
 """ Step 1: Load Local NetCDF File into OCW Dataset Objects """
 print "Loading %s into an OCW Dataset Object" % (FILE_1,)


[4/4] git commit: Merge branch 'CLIMATE-450'

Posted by go...@apache.org.
Merge branch 'CLIMATE-450'

- Resolves #53


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

Branch: refs/heads/master
Commit: e9437d04e95b87bef315d648f5f40c8021a44b1d
Parents: 0fba21f 00ff21b
Author: cgoodale <si...@gmail.com>
Authored: Mon Jun 2 14:15:55 2014 -0700
Committer: cgoodale <si...@gmail.com>
Committed: Mon Jun 2 14:15:55 2014 -0700

----------------------------------------------------------------------
 examples/knmi_to_cru31_full_bias.py    | 10 +++++++---
 examples/simple_model_to_model_bias.py | 16 ++++++++++++----
 examples/simple_model_tstd.py          |  8 ++++++--
 3 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------