Skip to content

Commit aeacb08

Browse files
authored
Merge pull request #151 from coecms/cordexupdate
cordex now get vocabularies from json file not from ESGF query
2 parents 5504b11 + f30c179 commit aeacb08

17 files changed

+1198
-66
lines changed

clef/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from .esdoc import citation, write_cite
3434
import clef.cordex as cordex_
3535

36+
3637
def clef_catch():
3738
debug_logger = logging.getLogger('clef_debug')
3839
debug_logger.setLevel(logging.CRITICAL)

clef/code.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,6 @@ def and_filter(df, cols, fixed, **kwargs):
292292
useful = set(['version', 'source_id', 'model', 'path','dataset_id', 'domain',
293293
'cmor_table','table_id', 'ensemble', 'member_id', 'driving_experiment',
294294
'model_id', 'frequency', 'driving_model', 'rcm_version']) - set(fixed)
295-
#useful = set(['version', 'source_id', 'model', 'path','dataset_id',
296-
# 'cmor_table','table_id', 'ensemble', 'member_id', 'driving_model_id',
297-
# 'driving_model_ensemble_member', 'model_id', 'frequency',
298-
# 'cordex_domain', 'driving_experiment_name', 'rcm_version_id']) - set(fixed)
299295
fields = ['comb'] + [f for f in useful if f in [c for c in df.columns.values]]
300296
# define the aggregation dictionary
301297
agg_dict = {k: set for k in fields}
@@ -425,9 +421,8 @@ def ids_df(dids):
425421
'time_frequency', 'realm', 'cmor_table', 'ensemble', 'version']
426422
elif project == 'cordex':
427423
facets_list = ['project', 'product', 'domain', 'institute', 'driving_model',
428-
'driving_experiment', 'ensemble', 'model_id', 'rcm_version', 'frequency', 'variable', 'version']
429-
#facets_list = ['project', 'product', 'cordex_domain', 'institute_id', 'driving_model_id',
430-
# 'driving_experiment_name', 'driving_model_ensemble_member', 'model_id', 'rcm_version_id', 'frequency', 'variable', 'version']
424+
'driving_experiment', 'ensemble', 'model_id', 'rcm_version', 'frequency',
425+
'variable', 'version']
431426
else:
432427
print(f'Warning: project {project} not available')
433428
return results

clef/cordex.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
from clef.esgf import esgf_query
2019
import functools
2120
import click
2221

22+
from clef.esgf import esgf_query
23+
from clef.helpers import load_vocabularies
2324

2425
def tidy_facet_count(v):
2526
return v[::2]
@@ -60,7 +61,8 @@ def get_esgf_facets(project):
6061
"controlled_vocab": True,
6162
},
6263
"version": {"short": ['-vrs'], "help": "Data publication version", "controlled_vocab": True},
63-
"cf_standard_name": {"short": ['-cf'], "help": "CF-Conventions name of the variable"},
64+
"cf_standard_name": {"short": ['-cf'], "help": "CF-Conventions name of the variable",
65+
"controlled_vocab": True},
6466
"experiment_family": {"short": ['-ef'], 'one': True, "controlled_vocab": True,
6567
"help": "Experiment family: All, Historical, RCP"},
6668
"institute": { "short": ['-inst'],
@@ -74,8 +76,8 @@ class CordexCommand(click.Command):
7476
def __init__(self, *args, **kwargs):
7577
super().__init__(*args, **kwargs)
7678

77-
facets = get_esgf_facets(project="CORDEX,CORDEX-Adjust,CORDEX-ESD,CORDEXReklies")
78-
facets['driving_experiment'] = facets['experiment']
79+
#facets = get_esgf_facets(project="CORDEX,CORDEX-Adjust,CORDEX-ESD,CORDEXReklies")
80+
facets = load_vocabularies('CORDEX')
7981
facets['rcm_name'].append('CCAM-1391M')
8082
for k, v in cli_facets.items():
8183
opt = click.Option(

clef/data/CMIP6_activity_id.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"VolMIP":"Volcanic Forcings Model Intercomparison Project"
2727
},
2828
"version_metadata":{
29-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
30-
"CV_collection_version":"6.2.55.10",
29+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
30+
"CV_collection_version":"6.2.56.2",
3131
"activity_id_CV_modified":"Mon Mar 5 16:39:09 2018 -0800",
3232
"activity_id_CV_note":"Update activity_id to include CDRMIP and PAMIP",
3333
"author":"Paul J. Durack <[email protected]>",
3434
"institution_id":"PCMDI",
35-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
35+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
3636
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
3737
}
3838
}

clef/data/CMIP6_experiment_id.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9456,13 +9456,13 @@
94569456
}
94579457
},
94589458
"version_metadata":{
9459-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
9460-
"CV_collection_version":"6.2.55.10",
9459+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
9460+
"CV_collection_version":"6.2.56.2",
94619461
"author":"Paul J. Durack <[email protected]>",
94629462
"experiment_id_CV_modified":"Tue Dec 15 12:25:59 2020 -0800",
94639463
"experiment_id_CV_note":"Revise experiment_id historical parent experiments",
94649464
"institution_id":"PCMDI",
9465-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
9465+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
94669466
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
94679467
}
94689468
}

clef/data/CMIP6_frequency.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"1hr":"sampled hourly",
44
"1hrCM":"monthly-mean diurnal cycle resolving each day into 1-hour means",
55
"1hrPt":"sampled hourly, at specified time point within an hour",
6-
"3hr":"sampled every 3 hours",
6+
"3hr":"3 hourly mean samples",
77
"3hrPt":"sampled 3 hourly, at specified time point within the time period",
8-
"6hr":"sampled every 6 hours",
8+
"6hr":"6 hourly mean samples",
99
"6hrPt":"sampled 6 hourly, at specified time point within the time period",
1010
"day":"daily mean samples",
1111
"dec":"decadal mean samples",
@@ -18,13 +18,13 @@
1818
"yrPt":"sampled yearly, at specified time point within the time period"
1919
},
2020
"version_metadata":{
21-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
22-
"CV_collection_version":"6.2.55.10",
21+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
22+
"CV_collection_version":"6.2.56.2",
2323
"author":"Paul J. Durack <[email protected]>",
24-
"frequency_CV_modified":"Fri Oct 27 14:03:00 2017 -0700",
25-
"frequency_CV_note":"Issue414 durack1 revise frequency 1hrCM definition (#418)",
24+
"frequency_CV_modified":"Mon May 24 13:48:15 2021 00100",
25+
"frequency_CV_note":"Update description of 3hr and 6hr frequencies",
2626
"institution_id":"PCMDI",
27-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
27+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
2828
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
2929
}
3030
}

clef/data/CMIP6_grid_label.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
"grz":"regridded zonal mean data reported on the data provider's preferred latitude target grid"
4848
},
4949
"version_metadata":{
50-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
51-
"CV_collection_version":"6.2.55.10",
50+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
51+
"CV_collection_version":"6.2.56.2",
5252
"author":"Paul J. Durack <[email protected]>",
5353
"grid_label_CV_modified":"Fri Sep 8 18:12:00 2017 -0700",
5454
"grid_label_CV_note":"Issue395 durack1 augment grid_label with description (#401)",
5555
"institution_id":"PCMDI",
56-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
56+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
5757
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
5858
}
5959
}

clef/data/CMIP6_institution_id.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
"UofT":"Department of Physics, University of Toronto, 60 St George Street, Toronto, ON M5S1A7, Canada"
5656
},
5757
"version_metadata":{
58-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
59-
"CV_collection_version":"6.2.55.10",
58+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
59+
"CV_collection_version":"6.2.56.2",
6060
"author":"Paul J. Durack <[email protected]>",
6161
"institution_id":"PCMDI",
6262
"institution_id_CV_modified":"Mon Nov 16 11:16:39 2020 -0800",
6363
"institution_id_CV_note":"Register institution_id LLNL; Py3 cleanup",
64-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
64+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
6565
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
6666
}
6767
}

clef/data/CMIP6_nominal_resolution.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"5000 km"
1818
],
1919
"version_metadata":{
20-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
21-
"CV_collection_version":"6.2.55.10",
20+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
21+
"CV_collection_version":"6.2.56.2",
2222
"author":"Paul J. Durack <[email protected]>",
2323
"institution_id":"PCMDI",
2424
"nominal_resolution_CV_modified":"Tues Nov 15 16:04:00 2016 -0700",
2525
"nominal_resolution_CV_note":"Issue141 durack1 update grid_resolution to nominal_resolution (#143)",
26-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
26+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
2727
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"
2828
}
2929
}

clef/data/CMIP6_realm.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"seaIce":"Sea Ice"
1111
},
1212
"version_metadata":{
13-
"CV_collection_modified":"Tue Mar 9 11:08:57 2021 -0800",
14-
"CV_collection_version":"6.2.55.10",
13+
"CV_collection_modified":"Mon Jun 21 11:28:21 2021 -0700",
14+
"CV_collection_version":"6.2.56.2",
1515
"author":"Paul J. Durack <[email protected]>",
1616
"institution_id":"PCMDI",
17-
"previous_commit":"beb5c86f29724e40b3c8fc9755f321cf236230bd",
17+
"previous_commit":"66344226746627e0b6c12db974666126c343ce27",
1818
"realm_CV_modified":"Tues Apr 18 12:03:00 2017 -0700",
1919
"realm_CV_note":"Issue285 durack1 update realm format (#290)",
2020
"specs_doc":"v6.2.7 (10th September 2018; https://goo.gl/v1drZl)"

0 commit comments

Comments
 (0)