From f4aeb8bf4586ef98b40da9802e98e4519f9ad7c0 Mon Sep 17 00:00:00 2001 From: huikyole Date: Sun, 17 Jun 2018 19:53:21 -0700 Subject: [PATCH] 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. --- .../run_statistical_downscaling.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/RCMES/statistical_downscaling/run_statistical_downscaling.py b/RCMES/statistical_downscaling/run_statistical_downscaling.py index 62bc1a4c..18b39fe1 100644 --- a/RCMES/statistical_downscaling/run_statistical_downscaling.py +++ b/RCMES/statistical_downscaling/run_statistical_downscaling.py @@ -155,10 +155,16 @@ def extract_data_at_nearest_grid_point(target_dataset, longitude, latitude): 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")