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") if not os.path.exists(case_name): os.system("mkdir " + case_name) os.chdir(os.getcwd() + "/" + case_name) plotter.draw_marker_on_map(grid_lat, grid_lon, fname='downscaling_location', location_name=config['location']['name']) plotter.draw_histogram([ ref_subset.ravel(), model_subset_present.ravel(), model_subset_future.ravel() ], data_names=[ ref_info['data_name'], model_info['data_name'], model_info['future']['scenario_name'] ], fname=OUTPUT + '_original') plotter.draw_histogram( [ref_subset.ravel(), downscaled_model_present, downscaled_model_future],
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") if not os.path.exists(case_name): os.system("mkdir "+case_name) os.chdir(os.getcwd()+"/"+case_name) plotter.draw_marker_on_map(grid_lat, grid_lon, fname='downscaling_location', location_name=config['location']['name']) plotter.draw_histogram([ref_subset.ravel(), model_subset_present.ravel(), model_subset_future.ravel()], data_names = [ref_info['data_name'], model_info['data_name'], model_info['future']['scenario_name']], fname=OUTPUT+'_original') plotter.draw_histogram([ref_subset.ravel(), downscaled_model_present, downscaled_model_future], data_names = [ref_info['data_name'], model_info['data_name'], model_info['future']['scenario_name']], fname=OUTPUT+'_downscaled_using_'+downscale_option_names[DOWNSCALE_OPTION]) print("Generating spreadsheet") workbook = xlwt.Workbook() sheet = workbook.add_sheet(downscale_option_names[config['downscaling_option']]) sheet.write(0, 0, config['location']['name'])