climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1525908 - in /incubator/climate/trunk/examples: knmi_to_cru31_full_bias.py simple_model_to_model_bias.py
Date Tue, 24 Sep 2013 14:46:47 GMT
Author: joyce
Date: Tue Sep 24 14:46:46 2013
New Revision: 1525908

URL: http://svn.apache.org/r1525908
Log:
CLIMATE-307 - OCW examples now pull NetCDF files from external server

Modified:
    incubator/climate/trunk/examples/knmi_to_cru31_full_bias.py
    incubator/climate/trunk/examples/simple_model_to_model_bias.py

Modified: incubator/climate/trunk/examples/knmi_to_cru31_full_bias.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/examples/knmi_to_cru31_full_bias.py?rev=1525908&r1=1525907&r2=1525908&view=diff
==============================================================================
--- incubator/climate/trunk/examples/knmi_to_cru31_full_bias.py (original)
+++ incubator/climate/trunk/examples/knmi_to_cru31_full_bias.py Tue Sep 24 14:46:46 2013
@@ -1,6 +1,7 @@
 import datetime
 
 import numpy as np
+import urllib
 
 import ocw.data_source.local as local
 import ocw.data_source.rcmed as rcmed
@@ -10,6 +11,8 @@ import ocw.evaluation as evaluation
 import ocw.metrics as metrics
 import ocw.plotter as plotter
 
+# File URL leader
+FILE_LEADER = "http://zipper.jpl.nasa.gov/dist/"
 # This way we can easily adjust the time span of the retrievals
 YEARS = 3
 # Two Local Model Files 
@@ -17,6 +20,9 @@ MODEL = "AFRICA_KNMI-RACMO2.2b_CTL_ERAIN
 # 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)
+
 """ Step 1: Load Local NetCDF File into OCW Dataset Objects """
 print("Loading %s into an OCW Dataset Object" % (MODEL,))
 knmi_dataset = local.load_file(MODEL, "tasmax")
@@ -145,4 +151,4 @@ sub_titles = ["Full Temporal Range"]
  
 plotter.draw_contour_map(results, lats, lons, fname,
                          gridshape=gridshape, ptitle=plot_title, 
-                         subtitles=sub_titles)
\ No newline at end of file
+                         subtitles=sub_titles)

Modified: incubator/climate/trunk/examples/simple_model_to_model_bias.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/examples/simple_model_to_model_bias.py?rev=1525908&r1=1525907&r2=1525908&view=diff
==============================================================================
--- incubator/climate/trunk/examples/simple_model_to_model_bias.py (original)
+++ incubator/climate/trunk/examples/simple_model_to_model_bias.py Tue Sep 24 14:46:46 2013
@@ -1,6 +1,7 @@
 import datetime
 
 import numpy as np
+import urllib
 
 import ocw.data_source.local as local
 import ocw.dataset_processor as dsp
@@ -8,12 +9,18 @@ import ocw.evaluation as evaluation
 import ocw.metrics as metrics
 import ocw.plotter as plotter
 
+# File URL leader
+FILE_LEADER = "http://zipper.jpl.nasa.gov/dist/"
 # Two Local Model Files 
 FILE_1 = "AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc"
 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)
+
 """ Step 1: Load Local NetCDF Files into OCW Dataset Objects """
 print("Loading %s into an OCW Dataset Object" % (FILE_1,))
 knmi_dataset = local.load_file(FILE_1, "tasmax")
@@ -92,4 +99,4 @@ sub_titles = range(1989, 2009, 1)
 
 plotter.draw_contour_map(results, lats, lons, fname, 
                          gridshape=gridshape, ptitle=plot_title, 
-                         subtitles=sub_titles)
\ No newline at end of file
+                         subtitles=sub_titles)



Mime
View raw message