You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2016/05/08 07:43:04 UTC

[1/3] climate git commit: Merge pull request #1 from apache/master

Repository: climate
Updated Branches:
  refs/heads/master d85484018 -> 4388924ba


Merge pull request #1 from apache/master

Update fork

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

Branch: refs/heads/master
Commit: 95afddff4239e0424a4bdde23912be06978199b9
Parents: d2861de d854840
Author: Mazi Boustani <ma...@yahoo.com>
Authored: Tue Apr 26 14:41:16 2016 -0700
Committer: Mazi Boustani <ma...@yahoo.com>
Committed: Tue Apr 26 14:41:16 2016 -0700

----------------------------------------------------------------------
 .travis.yml                                     |   36 +
 MANIFEST.in                                     |    3 +
 RCMES/cli_app.py                                | 1439 ++++++++++++++++++
 .../CORDEX-Africa_examples/Fig10a_cru.yaml      |   93 ++
 .../CORDEX-Africa_examples/Fig10b_cru.yaml      |   90 ++
 .../CORDEX-Africa_examples/Fig1_2_4a_5.yaml     |  107 ++
 .../CORDEX-Africa_examples/Fig3a_summer.yaml    |   90 ++
 .../CORDEX-Africa_examples/Fig3a_winter.yaml    |   90 ++
 .../CORDEX-Africa_examples/Fig3b_summer.yaml    |   90 ++
 .../CORDEX-Africa_examples/Fig3b_winter.yaml    |   90 ++
 .../CORDEX-Africa_examples/Fig4d_7d_8ad.yaml    |  101 ++
 .../CORDEX-Africa_examples/Fig4f_9bcd.yaml      |  104 ++
 .../CORDEX-Africa_examples/Fig7e_8be.yaml       |   95 ++
 .../CORDEX-Africa_examples/Fig7f_8cf.yaml       |   97 ++
 ...ordex-arctic_cloud_fraction_bias_to_SRB.yaml |   65 +
 .../cordex-arctic_rlds_bias_to_SRB.yaml         |   65 +
 .../cordex-arctic_rlus_bias_to_SRB.yaml         |   65 +
 .../cordex-arctic_rsds_bias_to_SRB.yaml         |   65 +
 .../ESGF_example/ESGF-Example.yaml              |   62 +
 .../ESGF_example/ESGF-Example_local.yaml        |   62 +
 .../NARCCAP_examples/Fig10_and_Fig11.yaml       |   81 +
 .../NARCCAP_examples/Fig12_summer.yaml          |   75 +
 .../NARCCAP_examples/Fig12_winter.yaml          |   75 +
 .../NARCCAP_examples/Fig14_and_Fig15.yaml       |   82 +
 .../NARCCAP_examples/Fig16_summer.yaml          |   75 +
 .../NARCCAP_examples/Fig16_winter.yaml          |   75 +
 .../NARCCAP_examples/Fig5_and_Fig6.yaml         |   50 +
 .../NARCCAP_examples/Fig7_summer.yaml           |   75 +
 .../NARCCAP_examples/Fig7_winter.yaml           |   75 +
 .../NARCCAP_examples/Fig8_and_Fig9.yaml         |   50 +
 .../dscale_prmo-eus_rcmed.yaml                  |   83 +
 .../dscale_prmo-wus_local.yaml                  |   82 +
 .../dscale_prmo-wus_rcmed.yaml                  |   83 +
 .../dscale_wus_prec_trmm_vs_nldas.yaml          |   82 +
 ...prec_subregion_annual_cycle_time_series.yaml |   90 ++
 RCMES/metrics_and_plots.py                      |  247 +++
 RCMES/run_RCMES.py                              |  283 ++++
 RCMES/statistical_downscaling/MPI_tas_JJA.yaml  |   29 +
 .../run_statistical_downscaling.py              |  231 +++
 RCMES/test/test.py                              |  179 +++
 README.md                                       |    3 +
 docs/source/conf.py                             |    6 +-
 docs/source/config/config_writer.rst            |    2 +-
 docs/source/index.rst                           |    8 +-
 docs/source/ocw-logo-variant-sm-01-01-new.png   |  Bin 0 -> 25481 bytes
 easy-ocw/conda-install.sh                       |   60 +
 easy-ocw/conda_environment.txt                  |   54 +
 easy-ocw/install-osx.sh                         |   50 +-
 easy-ocw/install-ubuntu.sh                      |  124 +-
 easy-ocw/ocw-conda-dependencies.txt             |    9 +-
 easy-ocw/ocw-pip-dependencies.txt               |    2 +
 examples/esgf_integration_example.py            |   41 +
 examples/esgf_integration_examply.py            |   40 -
 examples/knmi_to_cru31_full_bias.py             |   13 +-
 examples/model_ensemble_to_rcmed.py             |   20 +-
 examples/multi_model_evaluation.py              |   21 +-
 examples/multi_model_taylor_diagram.py          |   31 +-
 examples/simple_model_to_model_bias.py          |    4 +-
 .../simple_model_to_model_bias_DJF_and_JJA.py   |   64 -
 examples/subregions_portrait_diagram.py         |    7 +-
 examples/taylor_diagram_example.py              |   14 +-
 examples/time_series_with_regions.py            |    4 +
 ez_setup.py                                     |  341 +++++
 ocw-cli/cli_app.py                              | 1428 -----------------
 ocw-ui/backend/run_webservices.py               |    6 +-
 ocw-ui/frontend/app/img/globe.png               |  Bin 0 -> 25857 bytes
 .../app/img/ocw-logo-variant-sm-01-01.png       |  Bin 0 -> 5776 bytes
 ocw-ui/frontend/app/index.html                  |   25 +-
 ocw-ui/frontend/app/scripts/app.js              |    4 +
 .../scripts/controllers/observationselect.js    |   69 +-
 ocw-ui/frontend/app/styles/main.css             |    7 +-
 ocw-ui/frontend/app/views/demo.html             |   22 +
 .../frontend/app/views/selectobservation.html   |    9 +
 ocw-ui/frontend/app/views/selectrcmed.html      |    2 +-
 ocw-ui/frontend/package.json                    |   10 +-
 ocw-vm/Vagrantfile                              |    2 +-
 ocw-vm/init-ocw-vm.sh                           |   23 +-
 ocw/data_source/dap.py                          |   22 +-
 ocw/data_source/esgf.py                         |    6 +-
 ocw/data_source/local.py                        |  344 ++++-
 ocw/data_source/rcmed.py                        |    2 +
 ocw/dataset.py                                  |    9 +-
 ocw/dataset_processor.py                        |  375 +++--
 ocw/esgf/constants.py                           |   13 +-
 ocw/esgf/logon.py                               |   13 +-
 ocw/esgf/logon2.py                              |   43 -
 ocw/esgf/main.py                                |   17 +-
 ocw/evaluation.py                               |   60 +-
 ocw/tests/test_dap.py                           |   20 +-
 ocw/tests/test_dataset_processor.py             |   32 +-
 ocw/tests/test_local.py                         |  202 ++-
 ocw/tests/test_utils.py                         |    2 +-
 ocw/utils.py                                    |    6 +-
 ocw_config_runner/tests/test_config_parsing.py  |   46 +-
 ocw_config_runner/tests/test_config_writer.py   |    2 +-
 .../tests/test_evaluation_creation.py           |    4 +-
 setup.cfg                                       |   17 +
 setup.py                                        |   71 +-
 98 files changed, 6726 insertions(+), 2116 deletions(-)
----------------------------------------------------------------------



[3/3] climate git commit: Merge branch 'ESGF'

Posted by hu...@apache.org.
Merge branch 'ESGF'


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

Branch: refs/heads/master
Commit: 4388924ba3cf372eb4f1e02d996bd686b7397d33
Parents: d854840 783c0b7
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Sun May 8 00:42:52 2016 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Sun May 8 00:42:52 2016 -0700

----------------------------------------------------------------------
 RCMES/cli_app.py | 186 ++++++++++++++++++++++++++------------------------
 1 file changed, 96 insertions(+), 90 deletions(-)
----------------------------------------------------------------------



[2/3] climate git commit: all inputs are required for ESGF, otherwise it will exist.

Posted by hu...@apache.org.
all inputs are required for ESGF, otherwise it will exist.


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

Branch: refs/heads/master
Commit: 783c0b7a26a2d268207bdd885a6fcc38d30c2151
Parents: 95afddf
Author: Maziyar Boustani <bo...@jpl.nasa.gov>
Authored: Tue Apr 26 14:50:20 2016 -0700
Committer: Maziyar Boustani <bo...@jpl.nasa.gov>
Committed: Tue Apr 26 14:50:20 2016 -0700

----------------------------------------------------------------------
 RCMES/cli_app.py | 186 ++++++++++++++++++++++++++------------------------
 1 file changed, 96 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/783c0b7a/RCMES/cli_app.py
----------------------------------------------------------------------
diff --git a/RCMES/cli_app.py b/RCMES/cli_app.py
index 5ba0a04..2afea2e 100644
--- a/RCMES/cli_app.py
+++ b/RCMES/cli_app.py
@@ -156,40 +156,43 @@ def load_esgf_model_screen(header):
     esgf_username = screen.getstr()
     screen.addstr(9, 1, "Enter Password:")
     esgf_password = screen.getstr()
-    try:
-        solr_url = "http://esg-datanode.jpl.nasa.gov/esg-search/search?id={0}&variable={1}&format=application%2Fsolr%2Bjson".format(esgf_dataset_id, esgf_variable)
-        metadata_json = json.load(urllib2.urlopen(solr_url))
-        if metadata_json['response']['docs'][0]["product"][0] != "observations":
-            screen.addstr(11, 4, "Title: {0}".format(metadata_json['response']['docs'][0]['title']))
-            screen.addstr(12, 4, "Start Date: {0}".format(metadata_json['response']['docs'][0]['datetime_start']))
-            screen.addstr(13, 4, "End Date: {0}".format(metadata_json['response']['docs'][0]['datetime_stop']))
-            screen.addstr(15, 2, "Confirm:")
-            screen.addstr(16, 4, "0- No")
-            screen.addstr(17, 4, "1- Yes")
-            screen.addstr(18, 3, "Would you take this dataset:")
-            answer = screen.getstr()
-            if answer == "0":
-                note = "WARNING: ESGF model file cannot be added."
-            elif answer == "1":
-                try:
-                    screen.addstr(20, 4, "Downloading dataset.....")
-                    screen.refresh()
-                    datasets = esgf.load_dataset(esgf_dataset_id,
-                                                esgf_variable,
-                                                esgf_username,
-                                                esgf_password)
-                    netCDF_name = get_esgf_netCDF_file_name(esgf_dataset_id, esgf_variable)
-                    netCDF_path = "/tmp/{0}".format(netCDF_name)
-                    model_dataset = load_file(netCDF_path, esgf_variable)
-                    model_datasets.append(model_dataset)
-                    models_info.append({'directory': netCDF_path, 'variable_name': esgf_variable})
-                    note = "Dataset successfully downloaded."
-                except:
-                    note = "WARNING: Dataset has not been downloaded. Check your ESGF permission."
-        else:
-            note = "The selected dataset is Observation, please enter model dataset."
-    except:
-        note = "WARNING: Something went wrong in downloading model dataset from ESGF."
+    if esgf_dataset_id and esgf_variable and esgf_username and esgf_password:
+        try:
+            solr_url = "http://esg-datanode.jpl.nasa.gov/esg-search/search?id={0}&variable={1}&format=application%2Fsolr%2Bjson".format(esgf_dataset_id, esgf_variable)
+            metadata_json = json.load(urllib2.urlopen(solr_url))
+            if metadata_json['response']['docs'][0]["product"][0] != "observations":
+                screen.addstr(11, 4, "Title: {0}".format(metadata_json['response']['docs'][0]['title']))
+                screen.addstr(12, 4, "Start Date: {0}".format(metadata_json['response']['docs'][0]['datetime_start']))
+                screen.addstr(13, 4, "End Date: {0}".format(metadata_json['response']['docs'][0]['datetime_stop']))
+                screen.addstr(15, 2, "Confirm:")
+                screen.addstr(16, 4, "0- No")
+                screen.addstr(17, 4, "1- Yes")
+                screen.addstr(18, 3, "Would you take this dataset:")
+                answer = screen.getstr()
+                if answer == "0":
+                    note = "WARNING: ESGF model file cannot be added."
+                elif answer == "1":
+                    try:
+                        screen.addstr(20, 4, "Downloading dataset.....")
+                        screen.refresh()
+                        datasets = esgf.load_dataset(esgf_dataset_id,
+                                                    esgf_variable,
+                                                    esgf_username,
+                                                    esgf_password)
+                        netCDF_name = get_esgf_netCDF_file_name(esgf_dataset_id, esgf_variable)
+                        netCDF_path = "/tmp/{0}".format(netCDF_name)
+                        model_dataset = load_file(netCDF_path, esgf_variable)
+                        model_datasets.append(model_dataset)
+                        models_info.append({'directory': netCDF_path, 'variable_name': esgf_variable})
+                        note = "Dataset successfully downloaded."
+                    except:
+                        note = "WARNING: Dataset has not been downloaded. Check your ESGF permission."
+            else:
+                note = "The selected dataset is Observation, please enter model dataset."
+        except:
+            note = "WARNING: Something went wrong in downloading model dataset from ESGF."
+    else:
+        note = "WARNING: No information given and no ESGF dataset has been downloaded."
 
     return  note
 
@@ -377,62 +380,65 @@ def load_esgf_obs_screen(header):
     esgf_username = screen.getstr()
     screen.addstr(9, 1, "Enter Password:")
     esgf_password = screen.getstr()
-    try:
-        solr_url = "http://esg-datanode.jpl.nasa.gov/esg-search/search?id={0}&variable={1}&format=application%2Fsolr%2Bjson".format(esgf_dataset_id, esgf_variable)
-        metadata_json = json.load(urllib2.urlopen(solr_url))
-        all_variables = metadata_json['response']['docs'][0]['variable']
-        variable_index = all_variables.index(esgf_variable)
-        if metadata_json['response']['docs'][0]["product"][0] == "observations":
-            screen.addstr(11, 4, "Variable Long Name: {0}".format(metadata_json['response']['docs'][0]['variable_long_name'][variable_index]))
-            screen.addstr(12, 4, "Start Date: {0}".format(metadata_json['response']['docs'][0]['datetime_start']))
-            screen.addstr(13, 4, "End Stop: {0}".format(metadata_json['response']['docs'][0]['datetime_stop']))
-            screen.addstr(14, 4, "Time Frequency: {0}".format(metadata_json['response']['docs'][0]['time_frequency']))
-            screen.addstr(15, 4, "Variable Units: {0}".format(metadata_json['response']['docs'][0]['variable_units'][variable_index]))
-            screen.addstr(16, 4, "East Degrees: {0}".format(metadata_json['response']['docs'][0]['east_degrees']))
-            screen.addstr(17, 4, "North Degrees: {0}".format(metadata_json['response']['docs'][0]['north_degrees']))
-            screen.addstr(18, 4, "South Degrees: {0}".format(metadata_json['response']['docs'][0]['south_degrees']))
-            screen.addstr(19, 4, "West Degrees: {0}".format(metadata_json['response']['docs'][0]['west_degrees']))
-            screen.addstr(22, 2, "Confirm:")
-            screen.addstr(23, 4, "0- No")
-            screen.addstr(24, 4, "1- Yes")
-            screen.addstr(25, 3, "Would you take this dataset:")
-            answer = screen.getstr()
-            if answer == "0":
-                note = "WARNING: ESGF observation file cannot be added."
-            elif answer == "1":
-                try:
-                    screen.addstr(27, 4, "Downloading dataset.....")
-                    screen.refresh()
-                    datasets = esgf.load_dataset(esgf_dataset_id,
-                                                esgf_variable,
-                                                esgf_username,
-                                                esgf_password)
-                    netCDF_name = get_esgf_netCDF_file_name(esgf_dataset_id, esgf_variable)
-                    netCDF_path = "/tmp/{0}".format(netCDF_name)
-                    obs_dataset = load_file(netCDF_path, esgf_variable)
-                    observations_info.append({
-                     'database':"{0}".format(netCDF_path),
-                     'dataset_id':"esgf".format(esgf_variable),
-                     'parameter_id':"{0}".format(esgf_variable),
-                     'start_date': obs_dataset.time_range()[0].strftime("%Y-%m-%d"),
-                     'end_date':obs_dataset.time_range()[1].strftime("%Y-%m-%d"),
-                     #'bounding_box':obs['bounding_box'],
-                     'timestep':"monthly",
-                     'min_lat':obs_dataset.spatial_boundaries()[0],
-                     'max_lat':obs_dataset.spatial_boundaries()[1],
-                     'min_lon':obs_dataset.spatial_boundaries()[2],
-                     'max_lon':obs_dataset.spatial_boundaries()[3],
-                     'lat_res':obs_dataset.spatial_resolution()[0],
-                     'lon_res':obs_dataset.spatial_resolution()[1],
-                     'unit':"{0}".format(metadata_json['response']['docs'][0]['variable_units'][1])
-                     })
-                    note = "Dataset successfully downloaded."
-                except:
-                    note = "WARNING: Dataset has not been downloaded."
-        else:
-            note = "The selected dataset is not Observation, please enter observation dataset."
-    except:
-        note = "WARNING: Something went wrong in downloading observation dataset from ESGF."
+    if esgf_dataset_id and esgf_variable and esgf_username and esgf_password:
+        try:
+            solr_url = "http://esg-datanode.jpl.nasa.gov/esg-search/search?id={0}&variable={1}&format=application%2Fsolr%2Bjson".format(esgf_dataset_id, esgf_variable)
+            metadata_json = json.load(urllib2.urlopen(solr_url))
+            all_variables = metadata_json['response']['docs'][0]['variable']
+            variable_index = all_variables.index(esgf_variable)
+            if metadata_json['response']['docs'][0]["product"][0] == "observations":
+                screen.addstr(11, 4, "Variable Long Name: {0}".format(metadata_json['response']['docs'][0]['variable_long_name'][variable_index]))
+                screen.addstr(12, 4, "Start Date: {0}".format(metadata_json['response']['docs'][0]['datetime_start']))
+                screen.addstr(13, 4, "End Stop: {0}".format(metadata_json['response']['docs'][0]['datetime_stop']))
+                screen.addstr(14, 4, "Time Frequency: {0}".format(metadata_json['response']['docs'][0]['time_frequency']))
+                screen.addstr(15, 4, "Variable Units: {0}".format(metadata_json['response']['docs'][0]['variable_units'][variable_index]))
+                screen.addstr(16, 4, "East Degrees: {0}".format(metadata_json['response']['docs'][0]['east_degrees']))
+                screen.addstr(17, 4, "North Degrees: {0}".format(metadata_json['response']['docs'][0]['north_degrees']))
+                screen.addstr(18, 4, "South Degrees: {0}".format(metadata_json['response']['docs'][0]['south_degrees']))
+                screen.addstr(19, 4, "West Degrees: {0}".format(metadata_json['response']['docs'][0]['west_degrees']))
+                screen.addstr(22, 2, "Confirm:")
+                screen.addstr(23, 4, "0- No")
+                screen.addstr(24, 4, "1- Yes")
+                screen.addstr(25, 3, "Would you take this dataset:")
+                answer = screen.getstr()
+                if answer == "0":
+                    note = "WARNING: ESGF observation file cannot be added."
+                elif answer == "1":
+                    try:
+                        screen.addstr(27, 4, "Downloading dataset.....")
+                        screen.refresh()
+                        datasets = esgf.load_dataset(esgf_dataset_id,
+                                                    esgf_variable,
+                                                    esgf_username,
+                                                    esgf_password)
+                        netCDF_name = get_esgf_netCDF_file_name(esgf_dataset_id, esgf_variable)
+                        netCDF_path = "/tmp/{0}".format(netCDF_name)
+                        obs_dataset = load_file(netCDF_path, esgf_variable)
+                        observations_info.append({
+                         'database':"{0}".format(netCDF_path),
+                         'dataset_id':"esgf".format(esgf_variable),
+                         'parameter_id':"{0}".format(esgf_variable),
+                         'start_date': obs_dataset.time_range()[0].strftime("%Y-%m-%d"),
+                         'end_date':obs_dataset.time_range()[1].strftime("%Y-%m-%d"),
+                         #'bounding_box':obs['bounding_box'],
+                         'timestep':"monthly",
+                         'min_lat':obs_dataset.spatial_boundaries()[0],
+                         'max_lat':obs_dataset.spatial_boundaries()[1],
+                         'min_lon':obs_dataset.spatial_boundaries()[2],
+                         'max_lon':obs_dataset.spatial_boundaries()[3],
+                         'lat_res':obs_dataset.spatial_resolution()[0],
+                         'lon_res':obs_dataset.spatial_resolution()[1],
+                         'unit':"{0}".format(metadata_json['response']['docs'][0]['variable_units'][1])
+                         })
+                        note = "Dataset successfully downloaded."
+                    except:
+                        note = "WARNING: Dataset has not been downloaded."
+            else:
+                note = "The selected dataset is not Observation, please enter observation dataset."
+        except:
+            note = "WARNING: Something went wrong in downloading observation dataset from ESGF."
+    else:
+        note = "WARNING: No information given and no ESGF dataset has been downloaded."
 
     return  note