Skip to content

Commit

Permalink
grid and license
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex committed Nov 4, 2024
1 parent 02a6303 commit dabd704
Show file tree
Hide file tree
Showing 56 changed files with 520 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified data_descriptors/.DS_Store
Binary file not shown.
65 changes: 65 additions & 0 deletions data_descriptors/CLD2vIV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import glob
import json
from collections import OrderedDict
import os
import subprocess





remote_url = subprocess.check_output(["git", "remote", "get-url", "origin"], text=True).strip()
user_repo = remote_url.split("github.com")[-1].replace(":", "/").replace(".git", "").strip("/")
pages_url = f"https://{user_repo.split('/')[0]}.github.io/{user_repo.split('/')[1]}"

# print(remote_url)
# print(user_repo)
# print(pages_url)
# https://github.com/WCRP-CMIP/WCRP-UNIVERSE.git
# WCRP-CMIP/WCRP-UNIVERSE
# https://WCRP-CMIP.github.io/WCRP-UNIVERSE


folders = glob.glob('*/')


for folder in folders:
print(folder)
files = glob.glob(folder + '*.json')
for file in files:
with open(file, 'r') as f:

js = json.load(f)

if '@type' not in js:
continue
js['id'] = file.split('/')[-1]
js['type'] = js['@type'].replace('-', '_')
js['@context'] = f'{pages_url}/data_descriptors/{folder}_context'
del js['@type'], js['@id']

js = OrderedDict(sorted(js.items()))


json.dump(js, open(file,'w') , indent=4)
# print(file)


# context new file
location = f"{pages_url}/data_descriptors/{folder}"
context = {

"@context": {
"@base": location,
"@vocab": location,
"id": "@id",
"type": "@type"
},
"@embed": "@always"
}

json.dump(context, open(f"{folder}_context.json", 'w'), indent=4)


os.system('rm -f ' + folder + '*.jsonld')

Binary file added data_descriptors/grid_label/.DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/_context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": {
"@base": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/",
"@vocab": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/",
"id": "@id",
"type": "@type"
},
"@embed": "@always"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "global mean data",
"id": "gm.json",
"name": "gm",
"region": "greenland",
"short name": "Greenland",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "data reported on a model's native grid",
"id": "gn.json",
"name": "gn",
"region": "greenland",
"short name": "Grid Native Greenland",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "data reported on a native grid in the region of Antarctica",
"id": "gna.json",
"name": "gna",
"region": "antarctica",
"short name": "Grid Native Antarctica Greenland",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gng.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "data reported on a native grid in the region of Greenland",
"id": "gng.json",
"name": "gng",
"region": "greenland",
"short name": "Grid Native Greenland",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gnz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "zonal mean data reported on a model's native latitude grid",
"id": "gnz.json",
"name": "gnz",
"region": "greenland",
"short name": "Grid Native Greenland Zonal Mean",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on the data provider's preferred target grid",
"id": "gr.json",
"name": "gr",
"region": "greenland",
"short name": "Regridded Greenland",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr1.json",
"name": "gr1",
"region": "greenland",
"short name": "Regridded Greenland Alternate 1",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr1a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr1a.json",
"name": "gr1a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr1g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr1g.json",
"name": "gr1g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr1z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid",
"id": "gr1z.json",
"name": "gr1z",
"region": "greenland",
"short name": "Regridded Greenland Zonal Mean Alternate z",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr2.json",
"name": "gr2",
"region": "greenland",
"short name": "Regridded Greenland Alternate 2",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr2a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr2a.json",
"name": "gr2a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr2g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr2g.json",
"name": "gr2g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr2z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid",
"id": "gr2z.json",
"name": "gr2z",
"region": "greenland",
"short name": "Regridded Greenland Zonal Mean Alternate z",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr3.json",
"name": "gr3",
"region": "greenland",
"short name": "Regridded Greenland Alternate 3",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr3a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr3a.json",
"name": "gr3a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr3g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr3g.json",
"name": "gr3g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr3z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid",
"id": "gr3z.json",
"name": "gr3z",
"region": "greenland",
"short name": "Regridded Greenland Zonal Mean Alternate z",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr4.json",
"name": "gr4",
"region": "greenland",
"short name": "Regridded Greenland Alternate 4",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr4a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr4a.json",
"name": "gr4a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr4g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr4g.json",
"name": "gr4g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr4z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid",
"id": "gr4z.json",
"name": "gr4z",
"region": "greenland",
"short name": "Regridded Greenland Zonal Mean Alternate z",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr5.json",
"name": "gr5",
"region": "greenland",
"short name": "Regridded Greenland Alternate 5",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr5a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr5a.json",
"name": "gr5a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr5g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr5g.json",
"name": "gr5g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr5z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid",
"id": "gr5z.json",
"name": "gr5z",
"region": "greenland",
"short name": "Regridded Greenland Zonal Mean Alternate z",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid",
"id": "gr6.json",
"name": "gr6",
"region": "greenland",
"short name": "Regridded Greenland Alternate 6",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr6a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid",
"id": "gr6a.json",
"name": "gr6a",
"region": "antarctica",
"short name": "Regridded Antarctica Greenland Alternate a",
"type": "grid_label"
}
9 changes: 9 additions & 0 deletions data_descriptors/grid_label/gr6g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context",
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid",
"id": "gr6g.json",
"name": "gr6g",
"region": "greenland",
"short name": "Regridded Greenland Alternate g",
"type": "grid_label"
}
Loading

0 comments on commit dabd704

Please sign in to comment.