Skip to content

Commit

Permalink
add CV identifier json header
Browse files Browse the repository at this point in the history
  • Loading branch information
durack1 committed Jun 17, 2024
1 parent 903ec2b commit c9759ab
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 111 deletions.
10 changes: 6 additions & 4 deletions input4MIPs_DRS.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"directory_path_example":"input4MIPs/CMIP6Plus/CMIP/PCMDI/PCMDI-AMIP-1-1-9/ocean/mon/tos/gn/v20230512/",
"directory_path_template":"<activity_id><mip_era>/<target_mip>/<institution_id>/<source_id>/<realm>/<frequency>/<variable_id>/<grid_label>/<version>",
"filename_example":"tos_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-9_gn_187001-202212.nc",
"filename_template":"<variable_id><activity_id><dataset_category><target_mip><source_id><grid_label>[_<time_range>].nc"
"DRS":{
"directory_path_example":"input4MIPs/CMIP6Plus/CMIP/PCMDI/PCMDI-AMIP-1-1-9/ocean/mon/tos/gn/v20230512/",
"directory_path_template":"<activity_id><mip_era>/<target_mip>/<institution_id>/<source_id>/<realm>/<frequency>/<variable_id>/<grid_label>/<version>",
"filename_example":"tos_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-9_gn_187001-202212.nc",
"filename_template":"<variable_id><activity_id><dataset_category><target_mip><source_id><grid_label>[_<time_range>].nc"
}
}
8 changes: 5 additions & 3 deletions input4MIPs_activity_id.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"input4MIPs":{
"URL":"https://pcmdi.llnl.gov/mips/input4MIPs/",
"long_name":"input forcing datasets for Model Intercomparison Projects"
"activity_id":{
"input4MIPs":{
"URL":"https://pcmdi.llnl.gov/mips/input4MIPs/",
"long_name":"input forcing datasets for Model Intercomparison Projects"
}
}
}
28 changes: 15 additions & 13 deletions input4MIPs_dataset_category.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[
"GHGConcentrations",
"SSTsAndSeaIce",
"aerosolProperties",
"atmosphericState",
"emissions",
"landState",
"ozone",
"radiation",
"solar",
"surfaceAir",
"surfaceFluxes"
]
{
"dataset_category":[
"GHGConcentrations",
"SSTsAndSeaIce",
"aerosolProperties",
"atmosphericState",
"emissions",
"landState",
"ozone",
"radiation",
"solar",
"surfaceAir",
"surfaceFluxes"
]
}
20 changes: 11 additions & 9 deletions input4MIPs_license.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"license":"<your_data_identifier> data produced by <Your Institution; see MIP_institution_id.json> is licensed under a <Creative Commons; select and insert a license_id; see below> License (<insert the matching license_url; see below>). Consult https://pcmdi.llnl.gov/CMIP6Plus/TermsOfUse for terms of use governing CMIP6Plus and input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, can be found at <URL_maintained_data_provider>. 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_options":{
"CC BY 4.0":{
"license_id":"Creative Commons Attribution 4.0 International",
"license_url":"https://creativecommons.org/licenses/by/4.0/"
},
"CC0 1.0":{
"license_id":"Creative Commons CC0 1.0 Universal Public Domain Dedication",
"license_url":"https://creativecommons.org/publicdomain/zero/1.0/"
"license":{
"license":"<your_data_identifier> data produced by <Your Institution; see MIP_institution_id.json> is licensed under a <Creative Commons; select and insert a license_id; see below> License (<insert the matching license_url; see below>). Consult https://pcmdi.llnl.gov/CMIP6Plus/TermsOfUse for terms of use governing CMIP6Plus and input4MIPs output, including citation requirements and proper acknowledgment. Further information about this data, can be found at <URL_maintained_data_provider>. 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_options":{
"CC BY 4.0":{
"license_id":"Creative Commons Attribution 4.0 International",
"license_url":"https://creativecommons.org/licenses/by/4.0/"
},
"CC0 1.0":{
"license_id":"Creative Commons CC0 1.0 Universal Public Domain Dedication",
"license_url":"https://creativecommons.org/publicdomain/zero/1.0/"
}
}
}
}
12 changes: 7 additions & 5 deletions input4MIPs_mip_era.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[
"CMIP5",
"CMIP6",
"CMIP6Plus"
]
{
"mip_era":[
"CMIP5",
"CMIP6",
"CMIP6Plus"
]
}
12 changes: 7 additions & 5 deletions input4MIPs_product.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[
"derived",
"observations",
"reanalysis"
]
{
"product":[
"derived",
"observations",
"reanalysis"
]
}
52 changes: 27 additions & 25 deletions input4MIPs_required_global_attributes.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
[
"Conventions",
"activity_id",
"contact",
"creation_date",
"dataset_category",
"frequency",
"further_info_url",
"grid_label",
"institution",
"institution_id",
"license",
"mip_era",
"nominal_resolution",
"realm",
"region",
"source",
"source_id",
"source_version",
"table_id",
"target_mip",
"title",
"tracking_id",
"variable_id"
]
{
"required_global_attributes":[
"Conventions",
"activity_id",
"contact",
"creation_date",
"dataset_category",
"frequency",
"further_info_url",
"grid_label",
"institution",
"institution_id",
"license",
"mip_era",
"nominal_resolution",
"realm",
"region",
"source",
"source_id",
"source_version",
"table_id",
"target_mip",
"title",
"tracking_id",
"variable_id"
]
}
68 changes: 35 additions & 33 deletions input4MIPs_target_mip.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
{
"CMIP6":{
"AerChemMIP":"Aerosols and Chemistry Model Intercomparison Project",
"C4MIP":"Coupled Climate Carbon Cycle Model Intercomparison Project",
"CDRMIP":"Carbon Dioxide Removal Model Intercomparison Project",
"CFMIP":"Cloud Feedback Model Intercomparison Project",
"CMIP":"CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"CORDEX":"Coordinated Regional Climate Downscaling Experiment",
"DAMIP":"Detection and Attribution Model Intercomparison Project",
"DCPP":"Decadal Climate Prediction Project",
"DynVarMIP":"Dynamics and Variability Model Intercomparison Project",
"FAFMIP":"Flux-Anomaly-Forced Model Intercomparison Project",
"GMMIP":"Global Monsoons Model Intercomparison Project",
"GeoMIP":"Geoengineering Model Intercomparison Project",
"HighResMIP":"High-Resolution Model Intercomparison Project",
"ISMIP6":"Ice Sheet Model Intercomparison Project for CMIP6",
"LS3MIP":"Land Surface, Snow and Soil Moisture",
"LUMIP":"Land-Use Model Intercomparison Project",
"OMIP":"Ocean Model Intercomparison Project",
"PAMIP":"Polar Amplification Model Intercomparison Project",
"PMIP":"Palaeoclimate Modelling Intercomparison Project",
"RFMIP":"Radiative Forcing Model Intercomparison Project",
"SIMIP":"Sea Ice Model Intercomparison Project",
"ScenarioMIP":"Scenario Model Intercomparison Project",
"VIACSAB":"Vulnerability, Impacts, Adaptation and Climate Services Advisory Board",
"VolMIP":"Volcanic Forcings Model Intercomparison Project"
},
"CMIP6Plus":{
"CMIP":{
"URL":"https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf",
"long_name":"CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments"
"target_mip":{
"CMIP6":{
"AerChemMIP":"Aerosols and Chemistry Model Intercomparison Project",
"C4MIP":"Coupled Climate Carbon Cycle Model Intercomparison Project",
"CDRMIP":"Carbon Dioxide Removal Model Intercomparison Project",
"CFMIP":"Cloud Feedback Model Intercomparison Project",
"CMIP":"CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"CORDEX":"Coordinated Regional Climate Downscaling Experiment",
"DAMIP":"Detection and Attribution Model Intercomparison Project",
"DCPP":"Decadal Climate Prediction Project",
"DynVarMIP":"Dynamics and Variability Model Intercomparison Project",
"FAFMIP":"Flux-Anomaly-Forced Model Intercomparison Project",
"GMMIP":"Global Monsoons Model Intercomparison Project",
"GeoMIP":"Geoengineering Model Intercomparison Project",
"HighResMIP":"High-Resolution Model Intercomparison Project",
"ISMIP6":"Ice Sheet Model Intercomparison Project for CMIP6",
"LS3MIP":"Land Surface, Snow and Soil Moisture",
"LUMIP":"Land-Use Model Intercomparison Project",
"OMIP":"Ocean Model Intercomparison Project",
"PAMIP":"Polar Amplification Model Intercomparison Project",
"PMIP":"Palaeoclimate Modelling Intercomparison Project",
"RFMIP":"Radiative Forcing Model Intercomparison Project",
"SIMIP":"Sea Ice Model Intercomparison Project",
"ScenarioMIP":"Scenario Model Intercomparison Project",
"VIACSAB":"Vulnerability, Impacts, Adaptation and Climate Services Advisory Board",
"VolMIP":"Volcanic Forcings Model Intercomparison Project"
},
"LESFMIP":{
"URL":"https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full",
"long_name":"The Large Ensemble Single Forcing Model Intercomparison Project"
"CMIP6Plus":{
"CMIP":{
"URL":"https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf",
"long_name":"CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments"
},
"LESFMIP":{
"URL":"https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full",
"long_name":"The Large Ensemble Single Forcing Model Intercomparison Project"
}
}
}
}
8 changes: 5 additions & 3 deletions input4MIPs_tracking_id.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[
"hdl:21.14100/.*"
]
{
"tracking_id":[
"hdl:21.14100/.*"
]
}
39 changes: 28 additions & 11 deletions src/getInput4MIPsESGF.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"PJD 21 Nov 2023 - Updated to write out composite entries\n",
"PJD 29 Nov 2023 - Added CMIP6Plus example\n",
"PJD 29 Nov 2023 - Deployed prototype CVs - built from ESGF index and CMIP6Plus example\n",
"PJD 29 Nov 2023 - Deployed prototype source_id html https://pcmdi.github.io/input4MIPs_CVs/docs/input4MIPs_source_id.html"
"PJD 29 Nov 2023 - Deployed prototype source_id html https://pcmdi.github.io/input4MIPs_CVs/docs/input4MIPs_source_id.html\n",
"PJD 17 Jun 2024 - Updating to start source_id registration"
]
},
{
Expand Down Expand Up @@ -64,11 +65,21 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "727c54fa-d454-4adc-953d-1c93a0abf392",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 15 µs, sys: 2 µs, total: 17 µs\n",
"Wall time: 27.2 µs\n"
]
}
],
"source": [
"%%time\n",
"import json\n",
"import numpy as np\n",
"import os\n",
Expand Down Expand Up @@ -112,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "25d88e25-1c25-4800-93a2-d8838ee05d8c",
"metadata": {
"scrolled": true
Expand Down Expand Up @@ -156,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "7d4c32c8-07a6-433a-b755-73d55bc97e3e",
"metadata": {},
"outputs": [
Expand All @@ -180,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "9b721c24-d533-4fdd-b687-561a3a7d0fe7",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -213,7 +224,7 @@
" 'IAMC-REMIND-MAGPIE-ssp585-1-0'}"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -291,7 +302,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"id": "84724d0f-29bf-42b2-91ae-b54fa7e1ca0a",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -333,6 +344,8 @@
" fH.close()\n",
" #pdb.set_trace()\n",
"print(\"All done\")\n",
"# cleanup\n",
"os.remove(oF) # cleanup\n",
"# Write all out\n",
"oF = \"comp.json\"\n",
"if os.path.exists(oF):\n",
Expand Down Expand Up @@ -401,7 +414,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 10,
"id": "58d314e7-cfc4-4512-b13a-ca24d0e93de8",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -553,10 +566,14 @@
" oF = \"\".join([\"../input4MIPs_\", key, \".json\"])\n",
" print(oF)\n",
" #pdb.set_trace()\n",
" # add dict identifier\n",
" tmp = {}\n",
" tmp[key] = keyDict[key]\n",
" # write to file\n",
" if os.path.exists(oF):\n",
" os.remove(oF)\n",
" fH = open(oF, \"w\")\n",
" json.dump(keyDict[key], fH, ensure_ascii=True, sort_keys=True, indent=4, separators=(\",\", \":\"),)\n",
" json.dump(tmp, fH, ensure_ascii=True, sort_keys=True, indent=4, separators=(\",\", \":\"),)\n",
" fH.close()"
]
},
Expand Down Expand Up @@ -585,7 +602,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c9759ab

Please sign in to comment.