Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate input4MIPs variables into tables #9

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 218 additions & 0 deletions src/exploration/input4MIPs_variable_grab.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "619811d9",
"metadata": {},
"source": [
"# Attempt to integrate input4MIPs unique variables\n",
"## Will require a version increment once complete e.g. \"6.3.0.0\" -> \"6.3.1.0\""
]
},
{
"cell_type": "markdown",
"id": "059424aa",
"metadata": {},
"source": [
"imports"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "76e9fb9c",
"metadata": {},
"outputs": [],
"source": [
"import copy\n",
"import json\n",
"import os\n",
"import sys\n",
"import time\n",
"sys.path.append(\"..\") # add mip-cmor-tables/src to sys path\n",
"import mtlib"
]
},
{
"cell_type": "markdown",
"id": "74421d64",
"metadata": {},
"source": [
"Get input4mips-cmor-tables entries"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "88a6373b",
"metadata": {},
"outputs": [],
"source": [
"# some code to read remote tables"
]
},
{
"cell_type": "markdown",
"id": "e3b4efe6",
"metadata": {},
"source": [
"Get mip-cmor-tables entries"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "708eb2b1",
"metadata": {},
"outputs": [],
"source": [
"# some code to read local tables"
]
},
{
"cell_type": "markdown",
"id": "37f47563",
"metadata": {},
"source": [
"Query input4MIPs tables and develop matches with mip-cmor-tables"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "419996cd",
"metadata": {},
"outputs": [],
"source": [
"# some code to match tables"
]
},
{
"cell_type": "markdown",
"id": "4155c05e",
"metadata": {},
"source": [
"For table matches, iterate through variables and ascertain unique variables (e.g. `siconcbcs`, `tosbcs`)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "d8a089c1",
"metadata": {},
"outputs": [],
"source": [
"# some code to match tables and insert unique variables"
]
},
{
"cell_type": "markdown",
"id": "ee899472",
"metadata": {},
"source": [
"Create yrC frequency (add to generic_CV.json:frequency dictionary)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "59b196e9",
"metadata": {},
"outputs": [],
"source": [
"# some code to add `yrC` -> `OPyrClim` to frequency dictionary"
]
},
{
"cell_type": "markdown",
"id": "295bf44d",
"metadata": {},
"source": [
"Create some code to create `OPyrClim` and `LIyrClim` tables"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "b87c54d6",
"metadata": {},
"outputs": [],
"source": [
"# some code to add `OPyrClim` and `LIyrClim to tables"
]
},
{
"cell_type": "markdown",
"id": "5cb81617",
"metadata": {},
"source": [
"Run input4MIPs-cmor-tables variable cleanups (e.g. `Afx: areacella, sftlf, sftof`, `Ofx: sftof`, `A3hr: prra`, `A3hrPt: huss, psl, tas, uas, vas, ts`, `Lyr: mrros`, `LIfx: areacellg`, `LIyrC: licalvf`, `LIday: licalvf`, `Oday: friver, ficeberg2d, tos`, `Oyr: so`, `Omon: tos` )"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "d6be86b7",
"metadata": {},
"outputs": [],
"source": [
"# some code to cleanup existing table vars"
]
},
{
"cell_type": "markdown",
"id": "25a09b3a",
"metadata": {},
"source": [
"Increment `\"data_specs_version\": \"6.3.0.0\" -> \"6.3.1.0\"` as this repo now serves two *MIPs (CMIP6Plus, and input4MIPs) [note to self, same situation will need to occur with obs4MIPs]"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "84118ba1",
"metadata": {},
"outputs": [],
"source": [
"# some code to iterate through tables and update \"data_specs_version\""
]
},
{
"cell_type": "markdown",
"id": "025f4d5d",
"metadata": {},
"source": [
"What else is missing, or what will I find once code above is written?"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "66b031c1",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading