Update run_RCMES.py for new DatasetLoader w/ minor config file API changes
Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8553dfe3 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8553dfe3 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8553dfe3 Branch: refs/heads/master Commit: 8553dfe341d6abe1e101729d32fdc710014d254b Parents: 9797d97 Author: Alex Goodman <[email protected]> Authored: Mon Aug 8 16:53:07 2016 -0700 Committer: Alex Goodman <[email protected]> Committed: Mon Aug 8 16:53:07 2016 -0700 ---------------------------------------------------------------------- .../CORDEX-Africa_examples/Fig10a_cru.yaml | 26 +- .../CORDEX-Africa_examples/Fig10b_cru.yaml | 20 +- .../CORDEX-Africa_examples/Fig1_2_4a_5.yaml | 14 +- .../CORDEX-Africa_examples/Fig3a_summer.yaml | 22 +- .../CORDEX-Africa_examples/Fig3a_winter.yaml | 22 +- .../CORDEX-Africa_examples/Fig3b_summer.yaml | 22 +- .../CORDEX-Africa_examples/Fig3b_winter.yaml | 22 +- .../CORDEX-Africa_examples/Fig4d_7d_8ad.yaml | 18 +- .../CORDEX-Africa_examples/Fig4f_9bcd.yaml | 24 +- .../CORDEX-Africa_examples/Fig7e_8be.yaml | 18 +- .../CORDEX-Africa_examples/Fig7f_8cf.yaml | 22 +- ...ordex-arctic_cloud_fraction_bias_to_SRB.yaml | 25 +- .../cordex-arctic_rlds_bias_to_SRB.yaml | 25 +- .../cordex-arctic_rlus_bias_to_SRB.yaml | 25 +- .../cordex-arctic_rsds_bias_to_SRB.yaml | 25 +- .../ESGF_example/ESGF-Example.yaml | 26 +- .../ESGF_example/ESGF-Example_local.yaml | 20 +- .../NARCCAP_examples/Fig10_and_Fig11.yaml | 36 +-- .../NARCCAP_examples/Fig12_summer.yaml | 34 +-- .../NARCCAP_examples/Fig12_winter.yaml | 36 +-- .../NARCCAP_examples/Fig14_and_Fig15.yaml | 33 ++- .../NARCCAP_examples/Fig16_summer.yaml | 34 +-- .../NARCCAP_examples/Fig16_winter.yaml | 34 +-- .../NARCCAP_examples/Fig5_and_Fig6.yaml | 18 +- .../NARCCAP_examples/Fig7_summer.yaml | 34 +-- .../NARCCAP_examples/Fig7_winter.yaml | 36 +-- .../NARCCAP_examples/Fig8_and_Fig9.yaml | 18 +- .../dscale_prmo-eus_rcmed.yaml | 36 +-- .../dscale_prmo-wus_local.yaml | 34 +-- .../dscale_prmo-wus_rcmed.yaml | 36 +-- .../dscale_wus_prec_trmm_vs_nldas.yaml | 36 +-- ...prec_subregion_annual_cycle_time_series.yaml | 18 +- RCMES/run_RCMES.py | 280 ++++++++++--------- 33 files changed, 576 insertions(+), 553 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig10a_cru.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig10a_cru.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig10a_cru.yaml index 14f176f..76dbf5a 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig10a_cru.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig10a_cru.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig10a_cru.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,18 +25,18 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 42 - multiplying_factor: 0.01 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 42 + multiplying_factor: 0.01 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*clt.nc - variable: clt - latitude_name: lat - longitude_name: lon + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*clt.nc + variable: clt + lat_name: lat + lon_name: lon number_of_metrics_and_plots: 1 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig10b_cru.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig10b_cru.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig10b_cru.yaml index 10c64e0..013b943 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig10b_cru.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig10b_cru.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig10b_cru.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*pr.nc - variable: pr + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*pr.nc + variable: pr number_of_metrics_and_plots: 1 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig1_2_4a_5.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig1_2_4a_5.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig1_2_4a_5.yaml index 405245b..231555d 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig1_2_4a_5.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig1_2_4a_5.yaml @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*pr.nc - variable: pr + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*pr.nc + variable: pr number_of_metrics_and_plots: 4 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_summer.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_summer.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_summer.yaml index 25f5794..8ad99ce 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_summer.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_summer.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig3a_summer.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 6 month_end: 8 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*pr.nc - variable: pr + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*pr.nc + variable: pr number_of_metrics_and_plots: 1 @@ -42,7 +42,7 @@ metrics1: Taylor_diagram_spatial_pattern_of_multiyear_climatology plots1: file_name: Fig3a_summer -use_subregions: False +use_subregions: False subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_winter.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_winter.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_winter.yaml index 00f03eb..b147118 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_winter.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3a_winter.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig3a_winter.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 12 month_end: 2 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*pr.nc - variable: pr + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*pr.nc + variable: pr number_of_metrics_and_plots: 1 @@ -42,7 +42,7 @@ metrics1: Taylor_diagram_spatial_pattern_of_multiyear_climatology plots1: file_name: Fig3a_winter -use_subregions: False +use_subregions: False subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_summer.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_summer.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_summer.yaml index 88f9a6a..9545a7f 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_summer.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_summer.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig3b_summer.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 6 month_end: 8 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*tas.nc - variable: tas + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*tas.nc + variable: tas number_of_metrics_and_plots: 1 @@ -42,7 +42,7 @@ metrics1: Taylor_diagram_spatial_pattern_of_multiyear_climatology plots1: file_name: Fig3b_summer -use_subregions: False +use_subregions: False subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_winter.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_winter.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_winter.yaml index 1633b8f..893e007 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_winter.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig3b_winter.yaml @@ -1,16 +1,16 @@ workdir: ./ output_netcdf_filename: Fig3b_winter.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly month_start: 12 month_end: 2 - average_each_year: True + average_each_year: True space: min_lat: -45.76 @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*tas.nc - variable: tas + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*tas.nc + variable: tas number_of_metrics_and_plots: 1 @@ -42,7 +42,7 @@ metrics1: Taylor_diagram_spatial_pattern_of_multiyear_climatology plots1: file_name: Fig3b_winter -use_subregions: False +use_subregions: False subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig4d_7d_8ad.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig4d_7d_8ad.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig4d_7d_8ad.yaml index cc6371e..5beaf88 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig4d_7d_8ad.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig4d_7d_8ad.yaml @@ -1,10 +1,10 @@ workdir: ./ output_netcdf_filename: Fig4d_7d_8ad.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*tas.nc - variable: tas + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*tas.nc + variable: tas number_of_metrics_and_plots: 3 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig4f_9bcd.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig4f_9bcd.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig4f_9bcd.yaml index feaec94..7d7d438 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig4f_9bcd.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig4f_9bcd.yaml @@ -1,10 +1,10 @@ workdir: ./ output_netcdf_filename: Fig4f_9bcd.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -25,18 +25,18 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 42 - multiplying_factor: 0.01 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 42 + multiplying_factor: 0.01 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*clt.nc - variable: clt - latitude_name: lat - longitude_name: lon + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*clt.nc + variable: clt + lat_name: lat + lon_name: lon number_of_metrics_and_plots: 3 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig7e_8be.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig7e_8be.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig7e_8be.yaml index 5caf4da..dd93409 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig7e_8be.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig7e_8be.yaml @@ -1,10 +1,10 @@ workdir: ./ output_netcdf_filename: Fig7e_8be.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -25,15 +25,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 39 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 39 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*tasmax.nc - variable: tasmax + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*tasmax.nc + variable: tasmax number_of_metrics_and_plots: 2 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Africa_examples/Fig7f_8cf.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Africa_examples/Fig7f_8cf.yaml b/RCMES/configuration_files/CORDEX-Africa_examples/Fig7f_8cf.yaml index 1f2c5f0..ace3a73 100644 --- a/RCMES/configuration_files/CORDEX-Africa_examples/Fig7f_8cf.yaml +++ b/RCMES/configuration_files/CORDEX-Africa_examples/Fig7f_8cf.yaml @@ -1,10 +1,10 @@ workdir: ./ output_netcdf_filename: Fig7f_8cf.nc -# (RCMES will temporally subset data between month_start and month_end. +# (RCMES will temporally subset data between month_start and month_end. # If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -25,17 +25,17 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 41 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 41 targets: - loader_name: local - path: ./data/CORDEX-Africa_data/AFRICA*tasmin.nc - variable: tasmin - latitude_name: lat - longitude_name: lon + - loader_name: local + path: ./data/CORDEX-Africa_data/AFRICA*tasmin.nc + variable: tasmin + lat_name: lat + lon_name: lon number_of_metrics_and_plots: 2 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml index 6dcb3f7..64cda36 100644 --- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml +++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml @@ -20,7 +20,7 @@ output_netcdf_filename: cordex-arctic_clt_MAR-SEP.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -29,8 +29,8 @@ time: average_each_year: False space: - min_lat: 55.00 - max_lat: 89.5 + min_lat: 55.00 + max_lat: 89.5 min_lon: -179.75 max_lon: 178.50 @@ -41,16 +41,16 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc - variable: cld_frac - multiplying_factor: 100.0 + - loader_name: local + name: SRB + path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc + variable: cld_frac + multiplying_factor: 100.0 targets: - loader_name: local - path: ./data/CORDEX-Arctic_data/clt*.nc - variable: clt + - loader_name: local + path: ./data/CORDEX-Arctic_data/clt*.nc + variable: clt number_of_metrics_and_plots: 1 @@ -58,8 +58,7 @@ metrics1: Map_plot_bias_of_multiyear_climatology plots1: file_name: cordex-arctic_clt_MAR-SEP_mean_bias_to_SRB - subplots_array: !!python/tuple [2,2] + subplots_array: !!python/tuple [2,2] map_projection: npstere use_subregions: False - http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml index 25919da..8d7d2ef 100644 --- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml +++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml @@ -20,7 +20,7 @@ output_netcdf_filename: cordex-arctic_rlds_JUL.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -29,8 +29,8 @@ time: average_each_year: False space: - min_lat: 55.00 - max_lat: 89.5 + min_lat: 55.00 + max_lat: 89.5 min_lon: -179.75 max_lon: 178.50 @@ -41,16 +41,16 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc - variable: lw_sfc_dn - multiplying_factor: 1 + - loader_name: local + name: SRB + path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc + variable: lw_sfc_dn + multiplying_factor: 1 targets: - loader_name: local - path: ./data/CORDEX-Arctic_data/rlds*.nc - variable: rlds + - loader_name: local + path: ./data/CORDEX-Arctic_data/rlds*.nc + variable: rlds number_of_metrics_and_plots: 1 @@ -58,8 +58,7 @@ metrics1: Map_plot_bias_of_multiyear_climatology plots1: file_name: cordex-arctic_rlds_JUL_mean_bias_to_SRB - subplots_array: !!python/tuple [1,2] + subplots_array: !!python/tuple [1,2] map_projection: npstere use_subregions: False - http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml index decb9f0..5cf1a9b 100644 --- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml +++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml @@ -20,7 +20,7 @@ output_netcdf_filename: cordex-arctic_rlus_JUL.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -29,8 +29,8 @@ time: average_each_year: False space: - min_lat: 55.00 - max_lat: 89.5 + min_lat: 55.00 + max_lat: 89.5 min_lon: -179.75 max_lon: 178.50 @@ -41,16 +41,16 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc - variable: lw_sfc_up - multiplying_factor: 1 + - loader_name: local + name: SRB + path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc + variable: lw_sfc_up + multiplying_factor: 1 targets: - loader_name: local - path: ./data/CORDEX-Arctic_data/rlus*.nc - variable: rlus + - loader_name: local + path: ./data/CORDEX-Arctic_data/rlus*.nc + variable: rlus number_of_metrics_and_plots: 1 @@ -58,8 +58,7 @@ metrics1: Map_plot_bias_of_multiyear_climatology plots1: file_name: cordex-arctic_rlus_JUL_mean_bias_to_SRB - subplots_array: !!python/tuple [2,2] + subplots_array: !!python/tuple [2,2] map_projection: npstere use_subregions: False - http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml index 050c385..bc6cbb0 100644 --- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml +++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml @@ -20,7 +20,7 @@ output_netcdf_filename: cordex-arctic_rsds_JUL.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1990-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -29,8 +29,8 @@ time: average_each_year: False space: - min_lat: 55.00 - max_lat: 89.5 + min_lat: 55.00 + max_lat: 89.5 min_lon: -179.75 max_lon: 178.50 @@ -41,16 +41,16 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc - variable: sw_sfc_dn - multiplying_factor: 1 + - loader_name: local + name: SRB + path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc + variable: sw_sfc_dn + multiplying_factor: 1 targets: - loader_name: local - path: ./data/CORDEX-Arctic_data/rsds*.nc - variable: rsds + - loader_name: local + path: ./data/CORDEX-Arctic_data/rsds*.nc + variable: rsds number_of_metrics_and_plots: 1 @@ -58,8 +58,7 @@ metrics1: Map_plot_bias_of_multiyear_climatology plots1: file_name: cordex-arctic_rsds_JUL_mean_bias_to_SRB - subplots_array: !!python/tuple [2,2] + subplots_array: !!python/tuple [2,2] map_projection: npstere use_subregions: False - http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml b/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml index 1e56b83..175ee5f 100644 --- a/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml +++ b/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml @@ -13,24 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -workdir: ./results/ESGF_example +workdir: ./results/ESGF_example output_netcdf_filename: zos_annual_mean.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: False + maximum_overlap_period: False start_time: 1995-01-01 end_time: 2004-12-31 temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: False + average_each_year: False space: min_lat: -70 max_lat: 70 min_lon: -178.5 - max_lon: 178.5 + max_lon: 178.5 regrid: regrid_on_reference: True @@ -39,17 +39,17 @@ regrid: datasets: reference: - loader_name: ESGF - data_name: AVISO - dataset_id: obs4MIPs.CNES.AVISO.zos.mon.v20110829|esgf-data.jpl.nasa.gov - variable: zos + - loader_name: ESGF + name: AVISO + dataset_id: obs4MIPs.CNES.AVISO.zos.mon.v20110829|esgf-data.jpl.nasa.gov + variable: zos targets: - loader_name: ESGF - data_name: MPI-ESM - dataset_id: cmip5.output1.MPI-M.MPI-ESM-LR.decadal1994.mon.ocean.Omon.r1i1p1.v20120529|esgf1.dkrz.de - variable: zos - GCM_data: True + - loader_name: ESGF + name: MPI-ESM + dataset_id: cmip5.output1.MPI-M.MPI-ESM-LR.decadal1994.mon.ocean.Omon.r1i1p1.v20120529|esgf1.dkrz.de + variable: zos + boundary_check: False number_of_metrics_and_plots: 1 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml b/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml index bd66825..76fbd52 100644 --- a/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml +++ b/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -workdir: ./results/ESGF_example +workdir: ./results/ESGF_example output_netcdf_filename: zos_annual_mean_local.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) @@ -24,7 +24,7 @@ time: temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: False + average_each_year: False space: min_lat: -70 @@ -39,16 +39,16 @@ regrid: datasets: reference: - loader_name: local - data_name: AVISO - path: ./data/ESGF_data/zos_AVISO_L4_199210-201012.nc - variable: zos + - loader_name: local + name: AVISO + path: ./data/ESGF_data/zos_AVISO_L4_199210-201012.nc + variable: zos targets: - loader_name: local - path: ./data/ESGF_data/zos_Omon_MPI-ESM-LR_decadal1994_r1i1p1_199501-200412.nc - variable: zos - GCM_data: True + - loader_name: local + path: ./data/ESGF_data/zos_Omon_MPI-ESM-LR_decadal1994_r1i1p1_199501-200412.nc + variable: zos + GCM_data: True number_of_metrics_and_plots: 1 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig10_and_Fig11.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig10_and_Fig11.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig10_and_Fig11.yaml index c5f9e70..082f57f 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig10_and_Fig11.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig10_and_Fig11.yaml @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/NARCCAP_data/prec*ncep.monavg.nc - variable: prec + - loader_name: local + path: ./data/NARCCAP_data/prec*ncep.monavg.nc + variable: prec number_of_metrics_and_plots: 2 @@ -42,22 +42,22 @@ plots1: file_name: Fig10 subplots_array: !!python/tuple [7,2] -metrics2: Portrait_diagram_subregion_annual_cycle +metrics2: Portrait_diagram_subregion_annual_cycle plots2: file_name: Fig11 -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -65,17 +65,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig12_summer.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig12_summer.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig12_summer.yaml index 9af97f6..8efba11 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig12_summer.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig12_summer.yaml @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/NARCCAP_data/prec*ncep.monavg.nc - variable: prec + - loader_name: local + path: ./data/NARCCAP_data/prec*ncep.monavg.nc + variable: prec number_of_metrics_and_plots: 1 @@ -41,17 +41,17 @@ metrics1: Portrait_diagram_subregion_interannual_variability plots1: file_name: Fig12_summer -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig12_winter.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig12_winter.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig12_winter.yaml index 6f829bd..0aba7f6 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig12_winter.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig12_winter.yaml @@ -24,34 +24,34 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/NARCCAP_data/prec*ncep.monavg.nc - variable: prec + - loader_name: local + path: ./data/NARCCAP_data/prec*ncep.monavg.nc + variable: prec number_of_metrics_and_plots: 1 metrics1: Portrait_diagram_subregion_interannual_variability plots1: - file_name: Fig12_winter + file_name: Fig12_winter -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml index f012ed9..8a7dd2c 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml @@ -24,16 +24,15 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc - variable: sw_sfc_dn - + - loader_name: local + name: SRB + path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc + variable: sw_sfc_dn targets: - loader_name: local - path: ./data/NARCCAP_data/rsds*ncep.monavg.nc - variable: rsds + - loader_name: local + path: ./data/NARCCAP_data/rsds*ncep.monavg.nc + variable: rsds number_of_metrics_and_plots: 2 @@ -52,13 +51,13 @@ use_subregions: False subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -66,17 +65,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml index eee5f2c..76ed2cc 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc - variable: sw_sfc_dn + - loader_name: local + name: SRB + path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc + variable: sw_sfc_dn targets: - loader_name: local - path: ./data/NARCCAP_data/rsds*ncep.monavg.nc - variable: rsds + - loader_name: local + path: ./data/NARCCAP_data/rsds*ncep.monavg.nc + variable: rsds number_of_metrics_and_plots: 1 @@ -41,17 +41,17 @@ metrics1: Portrait_diagram_subregion_interannual_variability plots1: file_name: Fig16_summer -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml index 9a31b21..aacf827 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: local - data_name: SRB - path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc - variable: sw_sfc_dn + - loader_name: local + name: SRB + path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc + variable: sw_sfc_dn targets: - loader_name: local - path: ./data/NARCCAP_data/rsds*ncep.monavg.nc - variable: rsds + - loader_name: local + path: ./data/NARCCAP_data/rsds*ncep.monavg.nc + variable: rsds number_of_metrics_and_plots: 1 @@ -41,17 +41,17 @@ metrics1: Portrait_diagram_subregion_interannual_variability plots1: file_name: Fig16_winter -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig5_and_Fig6.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig5_and_Fig6.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig5_and_Fig6.yaml index 929b5c9..5413f51 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig5_and_Fig6.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig5_and_Fig6.yaml @@ -1,4 +1,4 @@ -workdir: ./NARCCAP_results +workdir: ./NARCCAP_results output_netcdf_filename: narccap_tas_annual_mean_1980-2003.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: True + average_each_year: True space: min_lat: 23.75 @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/NARCCAP_data/temp.*ncep.monavg.nc - variable: temp + - loader_name: local + path: ./data/NARCCAP_data/temp.*ncep.monavg.nc + variable: temp number_of_metrics_and_plots: 2 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig7_summer.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig7_summer.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig7_summer.yaml index fb9f8d1..ef7552c 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig7_summer.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig7_summer.yaml @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/NARCCAP_data/temp*ncep.monavg.nc - variable: temp + - loader_name: local + path: ./data/NARCCAP_data/temp*ncep.monavg.nc + variable: temp number_of_metrics_and_plots: 1 @@ -41,17 +41,17 @@ metrics1: Portrait_diagram_subregion_interannual_variability plots1: file_name: Fig7_summer -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig7_winter.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig7_winter.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig7_winter.yaml index 3416167..9f71482 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig7_winter.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig7_winter.yaml @@ -24,34 +24,34 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 38 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 38 targets: - loader_name: local - path: ./data/NARCCAP_data/temp*ncep.monavg.nc - variable: temp + - loader_name: local + path: ./data/NARCCAP_data/temp*ncep.monavg.nc + variable: temp number_of_metrics_and_plots: 1 metrics1: Portrait_diagram_subregion_interannual_variability plots1: - file_name: Fig7_winter + file_name: Fig7_winter -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] - R01: + R01: [42.75, 49.75, -123.75, -120.25] R02: [42.75, 49.75, -119.75, -112.75] R03: [37.25, 42.25, -123.75, -117.75] - R04: + R04: [32.25, 37.25, -122.75, -114.75] R05: [31.25, 37.25, -113.75, -108.25] @@ -59,17 +59,17 @@ subregions: [31.25, 37.25, -108.25, -99.75] R07: [37.25, 43.25, -110.25, -103.75] - R08: + R08: [45.25, 49.25, -99.75, -90.25] - R09: + R09: [34.75, 45.25, -99.75, -90.25] - R10: + R10: [29.75, 34.75, -95.75, -84.75] - R11: + R11: [38.25, 44.75, -89.75, -80.25] - R12: + R12: [38.25, 44.75, -79.75, -70.25] - R13: + R13: [30.75, 38.25, -83.75, -75.25] - R14: + R14: [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NARCCAP_examples/Fig8_and_Fig9.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig8_and_Fig9.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig8_and_Fig9.yaml index bf4ca80..16b456e 100644 --- a/RCMES/configuration_files/NARCCAP_examples/Fig8_and_Fig9.yaml +++ b/RCMES/configuration_files/NARCCAP_examples/Fig8_and_Fig9.yaml @@ -1,4 +1,4 @@ -workdir: ./ +workdir: ./ output_netcdf_filename: narccap_prec_annual_mean_1980-2003.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 1 month_end: 12 - average_each_year: True + average_each_year: True space: min_lat: 23.75 @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/NARCCAP_data/prec.*ncep.monavg.nc - variable: prec + - loader_name: local + path: ./data/NARCCAP_data/prec.*ncep.monavg.nc + variable: prec number_of_metrics_and_plots: 2 http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-eus_rcmed.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-eus_rcmed.yaml b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-eus_rcmed.yaml index 8f27517..ffca5f6 100644 --- a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-eus_rcmed.yaml +++ b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-eus_rcmed.yaml @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 11 month_end: 3 - average_each_year: True + average_each_year: True space: min_lat: 25.063 @@ -24,16 +24,16 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: TRMM - dataset_id: 3 - parameter_id: 36 - variable: pr + - loader_name: rcmed + name: TRMM + dataset_id: 3 + parameter_id: 36 + variable: pr targets: - loader_name: local - path: ./data/dscale/prmo*.nc - variable: pr + - loader_name: local + path: ./data/dscale/prmo*.nc + variable: pr number_of_metrics_and_plots: 2 @@ -53,13 +53,13 @@ use_subregions: False #subregions: ##subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] -# R01: +# R01: # [42.75, 49.75, -123.75, -120.25] # R02: # [42.75, 49.75, -119.75, -112.75] # R03: # [37.25, 42.25, -123.75, -117.75] -# R04: +# R04: # [32.25, 37.25, -122.75, -114.75] # R05: # [31.25, 37.25, -113.75, -108.25] @@ -67,17 +67,17 @@ use_subregions: False # [31.25, 37.25, -108.25, -99.75] # R07: # [37.25, 43.25, -110.25, -103.75] -# R08: +# R08: # [45.25, 49.25, -99.75, -90.25] -# R09: +# R09: # [34.75, 45.25, -99.75, -90.25] -# R10: +# R10: # [29.75, 34.75, -95.75, -84.75] -# R11: +# R11: # [38.25, 44.75, -89.75, -80.25] -# R12: +# R12: # [38.25, 44.75, -79.75, -70.25] -# R13: +# R13: # [30.75, 38.25, -83.75, -75.25] -# R14: +# R14: # [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml index 2f6948c..e1aeda5 100644 --- a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml +++ b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 11 month_end: 3 - average_each_year: True + average_each_year: True space: min_lat: 25.063 @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: local - data_name: NLDAS - path: ./data/dscale/obs/prmo_lds-lds_1999-2010.nc - variable: pr + - loader_name: local + name: NLDAS + path: ./data/dscale/obs/prmo_lds-lds_1999-2010.nc + variable: pr targets: - loader_name: local - path: ./data/dscale/prmo*.nc - variable: pr + - loader_name: local + path: ./data/dscale/prmo*.nc + variable: pr number_of_metrics_and_plots: 2 @@ -52,13 +52,13 @@ use_subregions: False #subregions: ##subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] -# R01: +# R01: # [42.75, 49.75, -123.75, -120.25] # R02: # [42.75, 49.75, -119.75, -112.75] # R03: # [37.25, 42.25, -123.75, -117.75] -# R04: +# R04: # [32.25, 37.25, -122.75, -114.75] # R05: # [31.25, 37.25, -113.75, -108.25] @@ -66,17 +66,17 @@ use_subregions: False # [31.25, 37.25, -108.25, -99.75] # R07: # [37.25, 43.25, -110.25, -103.75] -# R08: +# R08: # [45.25, 49.25, -99.75, -90.25] -# R09: +# R09: # [34.75, 45.25, -99.75, -90.25] -# R10: +# R10: # [29.75, 34.75, -95.75, -84.75] -# R11: +# R11: # [38.25, 44.75, -89.75, -80.25] -# R12: +# R12: # [38.25, 44.75, -79.75, -70.25] -# R13: +# R13: # [30.75, 38.25, -83.75, -75.25] -# R14: +# R14: # [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_rcmed.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_rcmed.yaml b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_rcmed.yaml index fb26f7c..919a1f9 100644 --- a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_rcmed.yaml +++ b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_rcmed.yaml @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 11 month_end: 3 - average_each_year: True + average_each_year: True space: min_lat: 25.063 @@ -24,16 +24,16 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: TRMM - dataset_id: 3 - parameter_id: 36 - variable: pr + - loader_name: rcmed + name: TRMM + dataset_id: 3 + parameter_id: 36 + variable: pr targets: - loader_name: local - path: ./data/dscale/prmo*.nc - variable: pr + - loader_name: local + path: ./data/dscale/prmo*.nc + variable: pr number_of_metrics_and_plots: 2 @@ -53,13 +53,13 @@ use_subregions: False #subregions: ##subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] -# R01: +# R01: # [42.75, 49.75, -123.75, -120.25] # R02: # [42.75, 49.75, -119.75, -112.75] # R03: # [37.25, 42.25, -123.75, -117.75] -# R04: +# R04: # [32.25, 37.25, -122.75, -114.75] # R05: # [31.25, 37.25, -113.75, -108.25] @@ -67,17 +67,17 @@ use_subregions: False # [31.25, 37.25, -108.25, -99.75] # R07: # [37.25, 43.25, -110.25, -103.75] -# R08: +# R08: # [45.25, 49.25, -99.75, -90.25] -# R09: +# R09: # [34.75, 45.25, -99.75, -90.25] -# R10: +# R10: # [29.75, 34.75, -95.75, -84.75] -# R11: +# R11: # [38.25, 44.75, -89.75, -80.25] -# R12: +# R12: # [38.25, 44.75, -79.75, -70.25] -# R13: +# R13: # [30.75, 38.25, -83.75, -75.25] -# R14: +# R14: # [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_wus_prec_trmm_vs_nldas.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_wus_prec_trmm_vs_nldas.yaml b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_wus_prec_trmm_vs_nldas.yaml index d3474fd..989254f 100644 --- a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_wus_prec_trmm_vs_nldas.yaml +++ b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_wus_prec_trmm_vs_nldas.yaml @@ -9,7 +9,7 @@ time: temporal_resolution: monthly month_start: 12 month_end: 3 - average_each_year: True + average_each_year: True space: min_lat: 25.063 @@ -24,16 +24,16 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: TRMM - dataset_id: 3 - parameter_id: 36 - variable: pr + - loader_name: rcmed + name: TRMM + dataset_id: 3 + parameter_id: 36 + variable: pr targets: - loader_name: local - path: ./data/dscale/obs/prmo*.nc - variable: pr + - loader_name: local + path: ./data/dscale/obs/prmo*.nc + variable: pr number_of_metrics_and_plots: 2 @@ -52,13 +52,13 @@ use_subregions: False #subregions: ##subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] -# R01: +# R01: # [42.75, 49.75, -123.75, -120.25] # R02: # [42.75, 49.75, -119.75, -112.75] # R03: # [37.25, 42.25, -123.75, -117.75] -# R04: +# R04: # [32.25, 37.25, -122.75, -114.75] # R05: # [31.25, 37.25, -113.75, -108.25] @@ -66,17 +66,17 @@ use_subregions: False # [31.25, 37.25, -108.25, -99.75] # R07: # [37.25, 43.25, -110.25, -103.75] -# R08: +# R08: # [45.25, 49.25, -99.75, -90.25] -# R09: +# R09: # [34.75, 45.25, -99.75, -90.25] -# R10: +# R10: # [29.75, 34.75, -95.75, -84.75] -# R11: +# R11: # [38.25, 44.75, -89.75, -80.25] -# R12: +# R12: # [38.25, 44.75, -79.75, -70.25] -# R13: +# R13: # [30.75, 38.25, -83.75, -75.25] -# R14: +# R14: # [24.25, 30.75, -83.75, -80.25] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/configuration_files/cordex_AF_prec_subregion_annual_cycle_time_series.yaml ---------------------------------------------------------------------- diff --git a/RCMES/configuration_files/cordex_AF_prec_subregion_annual_cycle_time_series.yaml b/RCMES/configuration_files/cordex_AF_prec_subregion_annual_cycle_time_series.yaml index 2ef6d5e..c60e1f9 100644 --- a/RCMES/configuration_files/cordex_AF_prec_subregion_annual_cycle_time_series.yaml +++ b/RCMES/configuration_files/cordex_AF_prec_subregion_annual_cycle_time_series.yaml @@ -3,7 +3,7 @@ output_netcdf_filename: cordex_AF_prec_monthly_mean_1990-2007.nc # (RCMES will temporally subset data between month_start and month_end. If average_each_year is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.) time: - maximum_overlap_period: True + maximum_overlap_period: True start_time: 1998-01-01 end_time: 2007-12-31 temporal_resolution: monthly @@ -24,15 +24,15 @@ regrid: datasets: reference: - loader_name: rcmed - data_name: CRU - dataset_id: 10 - parameter_id: 37 + - loader_name: rcmed + name: CRU + dataset_id: 10 + parameter_id: 37 targets: - loader_name: local - path: ./data/config_training/AFRICA*pr.nc - variable: pr + - loader_name: local + path: ./data/config_training/AFRICA*pr.nc + variable: pr number_of_metrics_and_plots: 1 @@ -42,7 +42,7 @@ plots1: file_name: cordex_AF_prec_subregion_annual_cycle_time_series subplots_array: !!python/tuple [7,3] -use_subregions: True +use_subregions: True subregions: #subregion name (R01, R02, R03,....) followed by an array of boundaries [south, north, west, east] http://git-wip-us.apache.org/repos/asf/climate/blob/8553dfe3/RCMES/run_RCMES.py ---------------------------------------------------------------------- diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py index c4424e7..2816d02 100644 --- a/RCMES/run_RCMES.py +++ b/RCMES/run_RCMES.py @@ -15,28 +15,43 @@ # specific language governing permissions and limitations # under the License. -#Apache OCW lib immports -import ocw.plotter as plotter -import ocw.utils as utils -from ocw.dataset import Bounds -from ocw.dataset_loader import DatasetLoader - -import matplotlib.pyplot as plt -from matplotlib import rcParams -import numpy as np -import numpy.ma as ma -import yaml -from glob import glob -import operator -from dateutil import parser -from datetime import datetime import os import sys +import ssl +import yaml +import operator +from glob import glob from getpass import getpass - +import numpy as np +import ocw.utils as utils +from ocw.dataset import Bounds +from ocw.dataset_loader import DatasetLoader from metrics_and_plots import * -import ssl +def load_datasets_from_config(*loader_options, **kwargs): + ''' + Generic dataset loading function. + ''' + for opt in loader_options: + loader_name = opt['loader_name'] + if loader_name == 'ESGF': + if password is None: + username=raw_input('Enter your ESGF OpenID:\n') + password=getpass(prompt='Enter your ESGF password:\n') + + opt['username'] = username + opt['password'] = password + elif loader_name == 'rcmed': + opt['min_lat'] = kwargs['min_lat'] + opt['max_lat'] = kwargs['max_lat'] + opt['min_lon'] = kwargs['min_lon'] + opt['max_lon'] = kwargs['max_lon'] + opt['start_time'] = kwargs['start_time'] + opt['end_time'] = kwargs['end_time'] + + loader = DatasetLoader(*loader_options) + loader.load_datasets() + return loader.datasets if hasattr(ssl, '_create_unverified_context'): ssl._create_default_https_context = ssl._create_unverified_context @@ -48,83 +63,55 @@ config = yaml.load(open(config_file)) time_info = config['time'] temporal_resolution = time_info['temporal_resolution'] +# Read time info start_time = datetime.strptime(time_info['start_time'].strftime('%Y%m%d'),'%Y%m%d') end_time = datetime.strptime(time_info['end_time'].strftime('%Y%m%d'),'%Y%m%d') +# Read space info space_info = config['space'] min_lat = space_info['min_lat'] max_lat = space_info['max_lat'] min_lon = space_info['min_lon'] max_lon = space_info['max_lon'] +kwargs = {'min_lat': min_lat, 'max_lat': max_lat, 'min_lon': min_lon, + 'max_lon': max_lon, 'start_time': start_time, 'end_time': end_time} +# Get the dataset loader options obs_data_info = config['datasets']['reference'] model_data_info = config['datasets']['targets'] -if obs_data_info['loader_name'] == 'ESGF' or model_data_info['loader_name'] == 'ESGF': - username=raw_input('Enter your ESGF OpenID:\n') - password=getpass(prompt='Enter your ESGF password:\n') - -""" Step 1: Load the reference data """ -obs_lat_name = None -obs_lon_name = None -if 'lat_name' in obs_data_info.keys(): - obs_lat_name = obs_data_info['lat_name'] -if 'lon_name' in obs_data_info.keys(): - obs_lon_name = obs_data_info['long_name'] -print 'Loading observation dataset:\n',obs_data_info -obs_name = obs_data_info['data_name'] -if obs_data_info['loader_name'] == 'local': - obs_dataset = local.load_file(obs_data_info['path'], - obs_data_info['variable'], name=obs_name, - lat_name=obs_lat_name, lon_name=obs_lon_name) -elif obs_data_info['loader_name'] == 'rcmed': - obs_dataset = rcmed.parameter_dataset(obs_data_info['dataset_id'], - obs_data_info['parameter_id'], - min_lat, max_lat, min_lon, max_lon, - start_time, end_time) -elif obs_data_info['loader_name'] == 'ESGF': - ds = esgf.load_dataset(dataset_id = obs_data_info['dataset_id'], - variable = obs_data_info['variable'], - esgf_username=username, - esgf_password=password) - obs_dataset = ds[0] -else: - print ' ' -if temporal_resolution == 'daily' or temporal_resolution == 'monthly': - obs_dataset = dsp.normalize_dataset_datetimes(obs_dataset, temporal_resolution) -if 'multiplying_factor' in obs_data_info.keys(): - obs_dataset.values = obs_dataset.values*obs_data_info['multiplying_factor'] + +# Extract info we don't want to put into the loader config +# Multiplying Factor to scale obs by +multiplying_factor = np.ones(nobs) +for i, info in enumerate(obs_data_info): + if 'multiplying_factor' in info: + multiplying_factor[i] = info.pop('multiplying_factor') + +# GCM Boundary Check for Regridding +boundary_check = np.ones(nmodels, dtype='bool') +for i, info in enumerate(model_data_info): + if 'boundary_check' in info: + boundary_check[i] = info.pop('boundary_check') + +""" Step 1: Load the observation data """ +print 'Loading observation datasets:\n',obs_data_info +obs_datasets = load_datasets_from_config(*obs_data_info, **kwargs) +obs_names = [dataset.name for dataset in obs_datasets] +for i, dataset in enumerate(obs_datasets): + if temporal_resolution == 'daily' or temporal_resolution == 'monthly': + obs_datasets[i] = dsp.normalize_dataset_datetimes(obs_dataset, + temporal_resolution) + + if multiplying_factor[i] != 1: + obs_dataset.values *= multiplying_factor[i] """ Step 2: Load model NetCDF Files into OCW Dataset Objects """ -model_lat_name = None -model_lon_name = None -if 'latitude_name' in model_data_info.keys(): - model_lat_name = model_data_info['latitude_name'] -if 'longitude_name' in model_data_info.keys(): - model_lon_name = model_data_info['longitude_name'] -boundary_check_model = True -if 'GCM_data' in model_data_info.keys(): - if model_data_info['GCM_data']: - boundary_check_model = False -print 'Loading model datasets:\n',model_data_info -if model_data_info['loader_name'] == 'local': - model_datasets, model_names = local.load_multiple_files(file_path = model_data_info['path'], - variable_name =model_data_info['variable'], - lat_name=model_lat_name, lon_name=model_lon_name) -elif model_data_info['loader_name'] == 'ESGF': - md = esgf.load_dataset(dataset_id=model_data_info['dataset_id'], - variable=model_data_info['variable'], - esgf_username=username, - esgf_password=password) - model_datasets = [] - model_names = [] - model_datasets.append(md[0]) - model_names.append(model_data_info['data_name']) -else: - print ' ' - # TO DO: support RCMED +model_datasets = load_datasets_from_config(*model_data_info, **kwargs) +model_names = [dataset.name for dataset in model_datasets] if temporal_resolution == 'daily' or temporal_resolution == 'monthly': - for idata,dataset in enumerate(model_datasets): - model_datasets[idata] = dsp.normalize_dataset_datetimes(dataset, temporal_resolution) + for i, dataset in enumerate(model_datasets): + model_datasets[i] = dsp.normalize_dataset_datetimes(dataset, + temporal_resolution) """ Step 3: Subset the data for temporal and spatial domain """ # Create a Bounds object to use for subsetting @@ -135,30 +122,45 @@ if time_info['maximum_overlap_period']: print 'end_time:', end_time if temporal_resolution == 'monthly' and end_time.day !=1: - end_time = end_time.replace(day=1) -if obs_data_info['loader_name'] == 'rcmed': + end_time = end_time.replace(day=1) + +for i, dataset in enumerate(obs_datasets): min_lat = np.max([min_lat, obs_dataset.lats.min()]) max_lat = np.min([max_lat, obs_dataset.lats.max()]) min_lon = np.max([min_lon, obs_dataset.lons.min()]) - max_lon = np.min([max_lon, obs_dataset.lons.max()]) -bounds = Bounds(lat_min=min_lat, lat_max=max_lat, lon_min=min_lon, lon_max=max_lon, start=start_time, end=end_time) + max_lon = np.min([max_lon, obs_dataset.lons.max()]) -obs_dataset = dsp.subset(obs_dataset, bounds) -if obs_dataset.temporal_resolution() != temporal_resolution: - obs_dataset = dsp.temporal_rebin(obs_dataset, temporal_resolution) -for idata,dataset in enumerate(model_datasets): - model_datasets[idata] = dsp.subset(dataset, bounds) +bounds = Bounds(lat_min=min_lat, + lat_max=max_lat, + lon_min=min_lon, + lon_max=max_lon, + start=start_time, + end=end_time) + +for i, dataset in enumerate(obs_datasets): + obs_datasets[i] = dsp.subset(dataset, bounds) if dataset.temporal_resolution() != temporal_resolution: - model_datasets[idata] = dsp.temporal_rebin(dataset, temporal_resolution) + obs_datasets[i] = dsp.temporal_rebin(dataset, temporal_resolution) -# Temporaly subset both observation and model datasets for the user specified season +for i, dataset in enumerate(model_datasets): + model_datasets[i] = dsp.subset(dataset, bounds) + if dataset.temporal_resolution() != temporal_resolution: + model_datasets[i] = dsp.temporal_rebin(dataset, temporal_resolution) + +# Temporally subset both observation and model datasets +# for the user specified season month_start = time_info['month_start'] month_end = time_info['month_end'] average_each_year = time_info['average_each_year'] +# TODO: Fully support multiple observation / reference datasets. +# For now we will only use the first reference dataset listed in the config file +obs_dataset = obs_datasets[0] +obs_name = obs_names[0] obs_dataset = dsp.temporal_subset(obs_dataset,month_start, month_end,average_each_year) -for idata,dataset in enumerate(model_datasets): - model_datasets[idata] = dsp.temporal_subset(dataset,month_start, month_end,average_each_year) +for i, dataset in enumerate(model_datasets): + model_datasets[i] = dsp.temporal_subset(dataset, month_start, month_end, + average_each_year) # generate grid points for regridding if config['regrid']['regrid_on_reference']: @@ -172,8 +174,6 @@ else: new_lat = np.linspace(min_lat, max_lat, nlat) new_lon = np.linspace(min_lon, max_lon, nlon) -# number of models -nmodel = len(model_datasets) print 'Dataset loading completed' print 'Observation data:', obs_name print 'Number of model datasets:',nmodel @@ -185,9 +185,10 @@ print 'Regridding datasets: ', config['regrid'] if not config['regrid']['regrid_on_reference']: obs_dataset = dsp.spatial_regrid(obs_dataset, new_lat, new_lon) print 'Reference dataset has been regridded' -for idata,dataset in enumerate(model_datasets): - model_datasets[idata] = dsp.spatial_regrid(dataset, new_lat, new_lon, boundary_check = boundary_check_model) - print model_names[idata]+' has been regridded' +for i, dataset in enumerate(model_datasets): + model_datasets[i] = dsp.spatial_regrid(dataset, new_lat, new_lon, + boundary_check=boundary_check[i]) + print model_names[i]+' has been regridded' print 'Propagating missing data information' obs_dataset = dsp.mask_missing_data([obs_dataset]+model_datasets)[0] model_datasets = dsp.mask_missing_data([obs_dataset]+model_datasets)[1:] @@ -212,10 +213,13 @@ if config['use_subregions']: # number of subregions nsubregion = len(subregions) - print 'Calculating spatial averages and standard deviations of ',str(nsubregion),' subregions' + print ('Calculating spatial averages and standard deviations of ', + str(nsubregion),' subregions') - obs_subregion_mean, obs_subregion_std, subregion_array = utils.calc_subregion_area_mean_and_std([obs_dataset], subregions) - model_subregion_mean, model_subregion_std, subregion_array = utils.calc_subregion_area_mean_and_std(model_datasets, subregions) + obs_subregion_mean, obs_subregion_std, subregion_array = ( + utils.calc_subregion_area_mean_and_std([obs_dataset], subregions)) + model_subregion_mean, model_subregion_std, subregion_array = ( + utils.calc_subregion_area_mean_and_std(model_datasets, subregions)) """ Step 7: Write a netCDF file """ workdir = config['workdir'] @@ -226,14 +230,19 @@ if not os.path.exists(workdir): os.system("mkdir -p "+workdir) if config['use_subregions']: - dsp.write_netcdf_multiple_datasets_with_subregions(obs_dataset, obs_name, model_datasets, model_names, - path=workdir+config['output_netcdf_filename'], - subregions=subregions, subregion_array = subregion_array, - obs_subregion_mean=obs_subregion_mean, obs_subregion_std=obs_subregion_std, - model_subregion_mean=model_subregion_mean, model_subregion_std=model_subregion_std) + dsp.write_netcdf_multiple_datasets_with_subregions( + obs_dataset, obs_name, model_datasets, model_names, + path=workdir+config['output_netcdf_filename'], + subregions=subregions, subregion_array=subregion_array, + obs_subregion_mean=obs_subregion_mean, + obs_subregion_std=obs_subregion_std, + model_subregion_mean=model_subregion_mean, + model_subregion_std=model_subregion_std) else: - dsp.write_netcdf_multiple_datasets_with_subregions(obs_dataset, obs_name, model_datasets, model_names, - path=workdir+config['output_netcdf_filename']) + dsp.write_netcdf_multiple_datasets_with_subregions( + obs_dataset, obs_name, model_datasets, + model_names, + path=workdir+config['output_netcdf_filename']) """ Step 8: Calculate metrics and draw plots """ nmetrics = config['number_of_metrics_and_plots'] @@ -251,28 +260,47 @@ if nmetrics > 0: if metrics_name == 'Map_plot_bias_of_multiyear_climatology': row, column = plot_info['subplots_array'] if 'map_projection' in plot_info.keys(): - Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets, model_names, - file_name, row, column, map_projection=plot_info['map_projection']) + Map_plot_bias_of_multiyear_climatology( + obs_dataset, obs_name, model_datasets, model_names, + file_name, row, column, + map_projection=plot_info['map_projection']) else: - Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets, model_names, - file_name, row, column) + Map_plot_bias_of_multiyear_climatology( + obs_dataset, obs_name, model_datasets, model_names, + file_name, row, column) elif metrics_name == 'Taylor_diagram_spatial_pattern_of_multiyear_climatology': - Taylor_diagram_spatial_pattern_of_multiyear_climatology(obs_dataset, obs_name, model_datasets, model_names, - file_name) + Taylor_diagram_spatial_pattern_of_multiyear_climatology( + obs_dataset, obs_name, model_datasets, model_names, + file_name) elif config['use_subregions']: - if metrics_name == 'Timeseries_plot_subregion_interannual_variability' and average_each_year: + if (metrics_name == 'Timeseries_plot_subregion_interannual_variability' + and average_each_year): row, column = plot_info['subplots_array'] - Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, False, - file_name, row, column, x_tick=['Y'+str(i+1) for i in np.arange(model_subregion_mean.shape[1])]) - if metrics_name == 'Timeseries_plot_subregion_annual_cycle' and not average_each_year and month_start==1 and month_end==12: + Time_series_subregion( + obs_subregion_mean, obs_name, model_subregion_mean, + model_names, False, file_name, row, column, + x_tick=['Y'+str(i+1) + for i in np.arange(model_subregion_mean.shape[1])]) + + if (metrics_name == 'Timeseries_plot_subregion_annual_cycle' + and not average_each_year and month_start==1 and month_end==12): row, column = plot_info['subplots_array'] - Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, True, - file_name, row, column, x_tick=['J','F','M','A','M','J','J','A','S','O','N','D']) - if metrics_name == 'Portrait_diagram_subregion_interannual_variability' and average_each_year: - Portrait_diagram_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, False, - file_name) - if metrics_name == 'Portrait_diagram_subregion_annual_cycle' and not average_each_year and month_start==1 and month_end==12: - Portrait_diagram_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, True, - file_name) + Time_series_subregion( + obs_subregion_mean, obs_name, + model_subregion_mean, model_names, True, + file_name, row, column, + x_tick=['J','F','M','A','M','J','J','A','S','O','N','D']) + + if (metrics_name == 'Portrait_diagram_subregion_interannual_variability' + and average_each_year): + Portrait_diagram_subregion(obs_subregion_mean, obs_name, + model_subregion_mean, model_names, + False, file_name) + + if (metrics_name == 'Portrait_diagram_subregion_annual_cycle' + and not average_each_year and month_start==1 and month_end==12): + Portrait_diagram_subregion(obs_subregion_mean, obs_name, + model_subregion_mean, model_names, + True, file_name) else: print 'please check the currently supported metrics'
