Repository: climate
Updated Branches:
  refs/heads/master 926f65a3b -> 353bd505c


CLIMATE-956 - Revert the changes in run_statistical_downscaling.py

- Some of the changes made by PR #444 have been reverted to make the codes work.


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

Branch: refs/heads/master
Commit: f4aeb8bf4586ef98b40da9802e98e4519f9ad7c0
Parents: 926f65a
Author: huikyole <huiky...@argo.jpl.nasa.gov>
Authored: Sun Jun 17 19:53:21 2018 -0700
Committer: huikyole <huiky...@argo.jpl.nasa.gov>
Committed: Sun Jun 17 19:53:21 2018 -0700

----------------------------------------------------------------------
 .../run_statistical_downscaling.py                    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/f4aeb8bf/RCMES/statistical_downscaling/run_statistical_downscaling.py
----------------------------------------------------------------------
diff --git a/RCMES/statistical_downscaling/run_statistical_downscaling.py 
b/RCMES/statistical_downscaling/run_statistical_downscaling.py
index 62bc1a4..18b39fe 100644
--- a/RCMES/statistical_downscaling/run_statistical_downscaling.py
+++ b/RCMES/statistical_downscaling/run_statistical_downscaling.py
@@ -155,10 +155,16 @@ downscale = down.Downscaling(ref_subset, 
model_subset_present, model_subset_futu
 
 print(downscale_option_names[DOWNSCALE_OPTION]+": Downscaling model output")
 
-xdownscale = [downscale.Delta_addition, downscale.Delta_correction, 
downscale.Quantile_mapping, downscale.Asynchronous_regression]
-if 0 < DOWNSCALE_OPTION <= len(xdownscale): xdownscale[DOWNSCALE_OPTION - 1]()
-else: sys.exit("DOWNSCALE_OPTION must be an integer between 1 and " + 
len(xdownscale))
-
+if DOWNSCALE_OPTION == 1:
+    downscaled_model_present, downscaled_model_future = 
downscale.Delta_addition()
+elif DOWNSCALE_OPTION == 2:
+    downscaled_model_present, downscaled_model_future = 
downscale.Delta_correction()
+elif DOWNSCALE_OPTION == 3:
+    downscaled_model_present, downscaled_model_future = 
downscale.Quantile_mapping()
+elif DOWNSCALE_OPTION == 4:
+    downscaled_model_present, downscaled_model_future = 
downscale.Asynchronous_regression()
+else:
+    sys.exit("DOWNSCALE_OPTION must be an integer between 1 and 4")
 
 """ Step 5: Create plots and spreadsheet """
 print("Plotting results")

Reply via email to