Skip to content

Commit

Permalink
Merge pull request #125 from PCMDI/CMORIssue628-durack1-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
durack1 authored Aug 16, 2022
2 parents bb8b903 + 3011a3a commit 57f0dc2
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Tables/input4MIPs_A3hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"atmos",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_A3hr"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_A3hrPt.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"atmos",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_A3hrPt"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Afx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"atmos land",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Afx"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Ayr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"atmos atmosChem",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Ayr"
},
"variable_entry":{
Expand Down
3 changes: 2 additions & 1 deletion Tables/input4MIPs_CV.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"UofMD":"University of Maryland (UofMD), College Park, MD 20742, USA",
"VUA":"Vrije Universiteit Amsterdam, De Boelelaan 1105, 1081 HV Amsterdam, Netherlands"
},
"license":"<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0; https://creativecommons.org/licenses/by/4.0/) License. Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.",
"license":"<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0; https://creativecommons.org/licenses/by/4.0/). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.",
"mip_era":[
"CMIP1",
"CMIP2",
Expand Down Expand Up @@ -1015,6 +1015,7 @@
"grid_label":"gn",
"institution":"Program for Climate Model Diagnosis and Intercomparison, Lawrence Livermore National Laboratory, Livermore, CA 94550, USA",
"institution_id":"PCMDI",
"license":"AMIP boundary condition data produced by PCMDI is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0; https://creativecommons.org/licenses/by/4.0). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law",
"mip_era":"CMIP6",
"nominal_resolution":"1x1 degree",
"product":"observations",
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIday.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIday"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIfx"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIyr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce land",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIyr"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIyrAnt.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIyrAnt"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIyrC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIyrC"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_LIyrGre.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"landIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_LIyrGre"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Lday.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"land",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Lday"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Lyr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"land",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Lyr"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Oday.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Oday"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Ofx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Ofx"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Omon.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Omon"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_OmonC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_OmonC"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_Oyr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_Oyr"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_OyrC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"ocean",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_OyrC"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_SI3hrPt.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"seaIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_SI3hrPt"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_SIday.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"seaIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_SIday"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_SImon.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"missing_value":"1e20",
"product":"input4MIPs",
"realm":"seaIce",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_SImon"
},
"variable_entry":{
Expand Down
2 changes: 1 addition & 1 deletion Tables/input4MIPs_grids.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mip_era":"CMIP6",
"missing_value":"1e20",
"product":"input4MIPs",
"table_date":"14 June 2022",
"table_date":"16 August 2022",
"table_id":"Table input4MIPs_grids"
},
"axis_entry":{
Expand Down
2 changes: 1 addition & 1 deletion input4MIPs_license.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"license1":"<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0; https://creativecommons.org/licenses/by/4.0/) License. Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law."
"license":"<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0; https://creativecommons.org/licenses/by/4.0/). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law."
}
1 change: 1 addition & 0 deletions input4MIPs_source_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@
"grid_label":"gn",
"institution":"Program for Climate Model Diagnosis and Intercomparison, Lawrence Livermore National Laboratory, Livermore, CA 94550, USA",
"institution_id":"PCMDI",
"license":"AMIP boundary condition data produced by PCMDI is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0; https://creativecommons.org/licenses/by/4.0). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law",
"mip_era":"CMIP6",
"nominal_resolution":"1x1 degree",
"product":"observations",
Expand Down
58 changes: 36 additions & 22 deletions src/writeJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,26 @@
PJD 24 Jul 2020 - Add new tables for ISMIP6 https://github.com/PCMDI/input4MIPs-cmor-tables/issues/107
PJD 24 Jul 2020 - Updated call to readJsonCreateDict(tableSource, rawGit) - added argument
PJD 8 Sep 2020 - Register source_id MRI-JRA55-do-1-5-0 https://github.com/PCMDI/input4MIPs-cmor-tables/issues/109
"""
# 2022
"""
PJD 26 Jan 2022 - Update home path
PJD 8 Mar 2022 - Register PCMDI-AMIP-1-2-0 https://github.com/PCMDI/input4MIPs-cmor-tables/issues/87
PJD 14 Jun 2022 - Register PCMDI-AMIP-1-1-8 https://github.com/PCMDI/input4MIPs-cmor-tables/issues/123
PJD 14 Jun 2022 - Updated default license from CC BY-SA-NC 4.0 to CC BY 4.0
PJD 15 Aug 2022 - Further PCMDI-AMIP-1-1-8 and license cleanup following https://github.com/PCMDI/cmor/issues/628
- TODO: Deal with lab cert issue https://raw.githubusercontent.com -> http://rawgit.com (see requests library)
@author: durack1
"""

# %% Import statements
from durolib import readJsonCreateDict
import copy
import gc, json, os, sys, time # shutil, subprocess, pdb
sys.path.append('~/git/durolib/durolib/')
sys.path.append('~/sync/git/durolib/durolib/')
from durolib import readJsonCreateDict

# %% Determine path
#homePath = os.path.join('/','/'.join(os.path.realpath(__file__).split('/')[0:-1]))
Expand All @@ -132,7 +136,7 @@
'grids',
'formula_terms',
'institution_id',
'license1',
'license',
'mip_era',
'nominal_resolution',
'product',
Expand Down Expand Up @@ -171,7 +175,7 @@
'frequency',
'grid_label',
'institution_id',
'license1',
'license',
'mip_era',
'nominal_resolution',
'product',
Expand Down Expand Up @@ -802,18 +806,18 @@
#institution_id['institution_id']['RSS'] = 'Remote Sensing Systems, Santa Rosa, CA 95401, USA'

# %% License
license1 = ('<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a'
' Creative Commons Attribution 4.0 International (CC BY 4.0;'
' https://creativecommons.org/licenses/by/4.0/) License.'
' Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse'
' for terms of use governing input4MIPs output, including citation requirements and'
' proper acknowledgment. Further information about this data, including some'
' limitations, can be found via the further_info_url (recorded as a global'
' attribute in this file). The data producers and data providers make no warranty,'
' either express or implied, including, but not limited to, warranties of'
' merchantability and fitness for a particular purpose. All liabilities arising'
' from the supply of the information (including any liability arising in negligence)'
' are excluded to the fullest extent permitted by law.')
license = ('<Your_Data_Identifier> data produced by <Your_Centre_Name> is licensed under a'
' Creative Commons Attribution 4.0 International License (CC BY 4.0;'
' https://creativecommons.org/licenses/by/4.0/).'
' Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse'
' for terms of use governing input4MIPs output, including citation requirements and'
' proper acknowledgment. Further information about this data, including some'
' limitations, can be found via the further_info_url (recorded as a global'
' attribute in this file). The data producers and data providers make no warranty,'
' either express or implied, including, but not limited to, warranties of'
' merchantability and fitness for a particular purpose. All liabilities arising'
' from the supply of the information (including any liability arising in negligence)'
' are excluded to the fullest extent permitted by law.')

# %% Mip era
mip_era = [
Expand Down Expand Up @@ -898,6 +902,19 @@
'and Intercomparison, Lawrence',
'Livermore National Laboratory,',
'Livermore, CA 94550, USA'])
source_id[key]['license'] = ' '.join(['AMIP boundary condition data produced by PCMDI is licensed under',
'a Creative Commons Attribution 4.0 International License',
'(CC BY 4.0; https://creativecommons.org/licenses/by/4.0). Consult',
'https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use',
'governing input4MIPs output, including citation requirements and',
'proper acknowledgment. Further information about this data,',
'including some limitations, can be found via the further_info_url',
'(recorded as a global attribute in this file). The data producers',
'and data providers make no warranty, either express or implied,',
'including, but not limited to, warranties of merchantability and',
'fitness for a particular purpose. All liabilities arising from the',
'supply of the information (including any liability arising in',
'negligence) are excluded to the fullest extent permitted by law'])
source_id[key]['nominal_resolution'] = '1x1 degree'
source_id[key]['mip_era'] = 'CMIP6'
source_id[key]['product'] = 'observations'
Expand All @@ -922,9 +939,6 @@
source_id[key]['source_version'] = '1.1.8'
source_id[key]['target_mip'] = 'CMIP'
source_id[key]['title'] = 'PCMDI-AMIP 1.1.8 dataset prepared for input4MIPs'
# Remove PCMDI-AMIP-1-2-0
key = "PCMDI-AMIP-1-2-0"
source_id.pop(key)

# %% Create CV master
CV = {}
Expand All @@ -935,7 +949,7 @@
# CV['CV']['further_info_url'] = ['[[:alpha:]]\\{1,\\}'] ; # Not matching format
CV['CV']['grid_label'] = grid_label
CV['CV']['institution_id'] = institution_id
CV['CV']['license'] = license1
CV['CV']['license'] = license
CV['CV']['mip_era'] = mip_era
CV['CV']['nominal_resolution'] = nominal_resolution
CV['CV']['product'] = product
Expand Down Expand Up @@ -968,9 +982,9 @@
dictToClean[key][value2[0]] = string
vars()[jsonName] = dictToClean
# Write file
if jsonName == 'license1':
outFile = ''.join(['input4MIPs_license.json'])
elif jsonName in tableTargets:
# if jsonName == 'license':
# outFile = ''.join(['input4MIPs_license.json'])
if jsonName in tableTargets:
outFile = ''.join(['Tables/input4MIPs_', jsonName, '.json'])
else:
outFile = ''.join(['input4MIPs_', jsonName, '.json'])
Expand Down

0 comments on commit 57f0dc2

Please sign in to comment.