Created
October 11, 2020 04:31
-
-
Save andersy005/a583252aa1f8869ee603c238a2ecdd52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "/glade/work/abanihi/softwares/miniconda3/envs/intake-dev/lib/python3.8/site-packages/fastprogress/fastprogress.py:102: UserWarning: Couldn't import ipywidgets properly, progress bar will use console behavior\n", | |
| " warn(\"Couldn't import ipywidgets properly, progress bar will use console behavior\")\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "import intake\n", | |
| "import ast" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 2, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<p><strong>whp_test_collect_sim catalog with 2 dataset(s) from 4 asset(s)</strong>:</p> <div>\n", | |
| "<style scoped>\n", | |
| " .dataframe tbody tr th:only-of-type {\n", | |
| " vertical-align: middle;\n", | |
| " }\n", | |
| "\n", | |
| " .dataframe tbody tr th {\n", | |
| " vertical-align: top;\n", | |
| " }\n", | |
| "\n", | |
| " .dataframe thead th {\n", | |
| " text-align: right;\n", | |
| " }\n", | |
| "</style>\n", | |
| "<table border=\"1\" class=\"dataframe\">\n", | |
| " <thead>\n", | |
| " <tr style=\"text-align: right;\">\n", | |
| " <th></th>\n", | |
| " <th>unique</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>path</th>\n", | |
| " <td>4</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>time</th>\n", | |
| " <td>2</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>year</th>\n", | |
| " <td>1</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>month</th>\n", | |
| " <td>1</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>day</th>\n", | |
| " <td>1</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>hour</th>\n", | |
| " <td>2</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>file_type</th>\n", | |
| " <td>2</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>variable</th>\n", | |
| " <td>4</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>" | |
| ], | |
| "text/plain": [ | |
| "<IPython.core.display.HTML object>" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "col = intake.open_esm_datastore(\"whp_test_collect_sim.json\", \n", | |
| " csv_kwargs={'converters': {'variable': ast.literal_eval}})\n", | |
| "col" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 3, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<div>\n", | |
| "<style scoped>\n", | |
| " .dataframe tbody tr th:only-of-type {\n", | |
| " vertical-align: middle;\n", | |
| " }\n", | |
| "\n", | |
| " .dataframe tbody tr th {\n", | |
| " vertical-align: top;\n", | |
| " }\n", | |
| "\n", | |
| " .dataframe thead th {\n", | |
| " text-align: right;\n", | |
| " }\n", | |
| "</style>\n", | |
| "<table border=\"1\" class=\"dataframe\">\n", | |
| " <thead>\n", | |
| " <tr style=\"text-align: right;\">\n", | |
| " <th></th>\n", | |
| " <th>path</th>\n", | |
| " <th>time</th>\n", | |
| " <th>year</th>\n", | |
| " <th>month</th>\n", | |
| " <th>day</th>\n", | |
| " <th>hour</th>\n", | |
| " <th>file_type</th>\n", | |
| " <th>variable</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>/glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/...</td>\n", | |
| " <td>2011-08-26T01:00</td>\n", | |
| " <td>2011</td>\n", | |
| " <td>8</td>\n", | |
| " <td>26</td>\n", | |
| " <td>1</td>\n", | |
| " <td>CHRTOUT</td>\n", | |
| " <td>(streamflow, nudge)</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>/glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/...</td>\n", | |
| " <td>2011-08-26T01:00</td>\n", | |
| " <td>2011</td>\n", | |
| " <td>8</td>\n", | |
| " <td>26</td>\n", | |
| " <td>1</td>\n", | |
| " <td>GWOUT</td>\n", | |
| " <td>(inflow, outflow)</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>/glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/...</td>\n", | |
| " <td>2011-08-26T02:00</td>\n", | |
| " <td>2011</td>\n", | |
| " <td>8</td>\n", | |
| " <td>26</td>\n", | |
| " <td>2</td>\n", | |
| " <td>CHRTOUT</td>\n", | |
| " <td>(streamflow, nudge)</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>/glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/...</td>\n", | |
| " <td>2011-08-26T02:00</td>\n", | |
| " <td>2011</td>\n", | |
| " <td>8</td>\n", | |
| " <td>26</td>\n", | |
| " <td>2</td>\n", | |
| " <td>GWOUT</td>\n", | |
| " <td>(inflow, outflow)</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>" | |
| ], | |
| "text/plain": [ | |
| " path time year \\\n", | |
| "0 /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/... 2011-08-26T01:00 2011 \n", | |
| "1 /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/... 2011-08-26T01:00 2011 \n", | |
| "2 /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/... 2011-08-26T02:00 2011 \n", | |
| "3 /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/... 2011-08-26T02:00 2011 \n", | |
| "\n", | |
| " month day hour file_type variable \n", | |
| "0 8 26 1 CHRTOUT (streamflow, nudge) \n", | |
| "1 8 26 1 GWOUT (inflow, outflow) \n", | |
| "2 8 26 2 CHRTOUT (streamflow, nudge) \n", | |
| "3 8 26 2 GWOUT (inflow, outflow) " | |
| ] | |
| }, | |
| "execution_count": 3, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "col.df.head()" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 4, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'variable': {'count': 4,\n", | |
| " 'values': ['inflow', 'nudge', 'outflow', 'streamflow']}}" | |
| ] | |
| }, | |
| "execution_count": 4, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "col.unique(['variable'])" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 5, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "['inflow', 'nudge', 'outflow', 'streamflow']" | |
| ] | |
| }, | |
| "execution_count": 5, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "variables = col.unique(['variable'])['variable']['values']\n", | |
| "variables" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "(dict_keys(['2011.8.26.CHRTOUT', '2011.8.26.GWOUT']),\n", | |
| " 'year.month.day.file_type')" | |
| ] | |
| }, | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "col.keys(), col.key_template" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 7, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "def preprocess(ds):\n", | |
| " \"\"\"Preprocess dataset\"\"\"\n", | |
| " vars_to_set_to_coords = list(set(ds.data_vars).difference(set(variables)))\n", | |
| " return ds.set_coords(vars_to_set_to_coords)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 8, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "\n", | |
| "--> The keys in the returned dictionary of datasets are constructed as follows:\n", | |
| "\t'year.month.day.file_type'\n", | |
| "█\r" | |
| ] | |
| }, | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'2011.8.26.GWOUT': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, reference_time: 1, time: 2)\n", | |
| " Coordinates:\n", | |
| " * time (time) datetime64[ns] 2011-08-26T01:00:00 2011-08-26T02:0...\n", | |
| " * reference_time (reference_time) datetime64[ns] 2011-08-26\n", | |
| " * feature_id (feature_id) int32 6212272 6212276 ... 6228424 6228442\n", | |
| " depth (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Data variables:\n", | |
| " inflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " outflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " intake_esm_varname: ('inflow', 'outflow')\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: gw_id\n", | |
| " featureType: timeSeries\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " model_output_type: groundwater_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.GWOUT,\n", | |
| " '2011.8.26.CHRTOUT': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, reference_time: 1, time: 2)\n", | |
| " Coordinates:\n", | |
| " * time (time) datetime64[ns] 2011-08-26T01:00:00 2011-08-26T02:0...\n", | |
| " * reference_time (reference_time) datetime64[ns] 2011-08-26\n", | |
| " crs |S1 ...\n", | |
| " * feature_id (feature_id) int32 6226932 6226946 ... 6226970 6226924\n", | |
| " latitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " longitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " order (feature_id) int32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " elevation (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " q_lateral (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " velocity (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Head (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Data variables:\n", | |
| " streamflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " nudge (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " dev: dev_ prefix indicates development/internal me...\n", | |
| " intake_esm_varname: ('streamflow', 'nudge')\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " dev_NOAH_TIMESTEP: 3600\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: feature_id\n", | |
| " featureType: timeSeries\n", | |
| " proj4: +proj=lcc +units=m +a=6370000.0 +b=6370000.0 ...\n", | |
| " cdm_datatype: Station\n", | |
| " dev_channel_only: 0\n", | |
| " stream_order_output: 1\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " dev_channelBucket_only: 0\n", | |
| " dev_OVRTSWCRT: 1\n", | |
| " model_output_type: channel_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.CHRTOUT}" | |
| ] | |
| }, | |
| "execution_count": 8, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "dsets = col.to_dataset_dict(preprocess=preprocess)\n", | |
| "dsets" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 9, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "\n", | |
| "--> The keys in the returned dictionary of datasets are constructed as follows:\n", | |
| "\t'year.month.day.file_type'\n", | |
| "█\n", | |
| "--> The keys in the returned dictionary of datasets are constructed as follows:\n", | |
| "\t'year.month.day.file_type'\n", | |
| "█\n", | |
| "--> The keys in the returned dictionary of datasets are constructed as follows:\n", | |
| "\t'year.month.day.file_type'\n", | |
| "█\n", | |
| "--> The keys in the returned dictionary of datasets are constructed as follows:\n", | |
| "\t'year.month.day.file_type'\n", | |
| "█\r" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "# Collect datasets for all variables in a single dictionary. Since we are not grouping by `variable`, We modify the keys to include the variable\n", | |
| "dsets = {}\n", | |
| "for variable in variables:\n", | |
| " v_dsets = col.search(variable=variable).to_dataset_dict(preprocess=preprocess)\n", | |
| " keys = list(v_dsets.keys())\n", | |
| " for key in keys:\n", | |
| " # Modify keys\n", | |
| " new_key = f'{key}{col.sep}{variable}'\n", | |
| " v_dsets[new_key] = v_dsets.pop(key)\n", | |
| " \n", | |
| " dsets = {**dsets, **v_dsets}" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 10, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "dict_keys(['2011.8.26.GWOUT.inflow', '2011.8.26.CHRTOUT.nudge', '2011.8.26.GWOUT.outflow', '2011.8.26.CHRTOUT.streamflow'])" | |
| ] | |
| }, | |
| "execution_count": 10, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "dsets.keys()" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 11, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'2011.8.26.GWOUT.inflow': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, time: 2)\n", | |
| " Coordinates:\n", | |
| " * feature_id (feature_id) int32 6212272 6212276 6212914 ... 6228424 6228442\n", | |
| " depth (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Dimensions without coordinates: time\n", | |
| " Data variables:\n", | |
| " inflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " intake_esm_varname: ['inflow']\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: gw_id\n", | |
| " featureType: timeSeries\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " model_output_type: groundwater_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.GWOUT,\n", | |
| " '2011.8.26.CHRTOUT.nudge': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, time: 2)\n", | |
| " Coordinates:\n", | |
| " crs |S1 ...\n", | |
| " * feature_id (feature_id) int32 6226932 6226946 6228408 ... 6226970 6226924\n", | |
| " latitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " longitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " order (feature_id) int32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " elevation (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " q_lateral (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " velocity (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Head (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Dimensions without coordinates: time\n", | |
| " Data variables:\n", | |
| " nudge (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " dev: dev_ prefix indicates development/internal me...\n", | |
| " intake_esm_varname: ['nudge']\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " dev_NOAH_TIMESTEP: 3600\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: feature_id\n", | |
| " featureType: timeSeries\n", | |
| " proj4: +proj=lcc +units=m +a=6370000.0 +b=6370000.0 ...\n", | |
| " cdm_datatype: Station\n", | |
| " dev_channel_only: 0\n", | |
| " stream_order_output: 1\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " dev_channelBucket_only: 0\n", | |
| " dev_OVRTSWCRT: 1\n", | |
| " model_output_type: channel_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.CHRTOUT,\n", | |
| " '2011.8.26.GWOUT.outflow': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, time: 2)\n", | |
| " Coordinates:\n", | |
| " * feature_id (feature_id) int32 6212272 6212276 6212914 ... 6228424 6228442\n", | |
| " depth (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Dimensions without coordinates: time\n", | |
| " Data variables:\n", | |
| " outflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " intake_esm_varname: ['outflow']\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: gw_id\n", | |
| " featureType: timeSeries\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " model_output_type: groundwater_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.GWOUT,\n", | |
| " '2011.8.26.CHRTOUT.streamflow': <xarray.Dataset>\n", | |
| " Dimensions: (feature_id: 185, time: 2)\n", | |
| " Coordinates:\n", | |
| " crs |S1 ...\n", | |
| " * feature_id (feature_id) int32 6226932 6226946 6228408 ... 6226970 6226924\n", | |
| " latitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " longitude (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " order (feature_id) int32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " elevation (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " q_lateral (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " velocity (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Head (feature_id) float32 dask.array<chunksize=(185,), meta=np.ndarray>\n", | |
| " Dimensions without coordinates: time\n", | |
| " Data variables:\n", | |
| " streamflow (time, feature_id) float32 dask.array<chunksize=(1, 185), meta=np.ndarray>\n", | |
| " Attributes:\n", | |
| " dev: dev_ prefix indicates development/internal me...\n", | |
| " intake_esm_varname: ['streamflow']\n", | |
| " code_version: v5.1.0-beta2\n", | |
| " dev_NOAH_TIMESTEP: 3600\n", | |
| " model_initialization_time: 2011-08-26_00:00:00\n", | |
| " station_dimension: feature_id\n", | |
| " featureType: timeSeries\n", | |
| " proj4: +proj=lcc +units=m +a=6370000.0 +b=6370000.0 ...\n", | |
| " cdm_datatype: Station\n", | |
| " dev_channel_only: 0\n", | |
| " stream_order_output: 1\n", | |
| " model_configuration: default\n", | |
| " model_total_valid_times: 2\n", | |
| " dev_channelBucket_only: 0\n", | |
| " dev_OVRTSWCRT: 1\n", | |
| " model_output_type: channel_rt\n", | |
| " Conventions: CF-1.6\n", | |
| " intake_esm_dataset_key: 2011.8.26.CHRTOUT}" | |
| ] | |
| }, | |
| "execution_count": 11, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "dsets" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3", | |
| "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.8.5" | |
| }, | |
| "widgets": { | |
| "application/vnd.jupyter.widget-state+json": { | |
| "state": { | |
| "0e9ad845c34c4056a294cfa463955ecc": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": { | |
| "min_width": "500px" | |
| } | |
| }, | |
| "1733cd4646c44ff89fc7946ca77a9997": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "1b6e51a74a644abf919c9d73a1a2ac2e": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "IntTextModel", | |
| "state": { | |
| "description": "Maximum", | |
| "layout": "IPY_MODEL_4fadcdec7f454800824547c29e112c40", | |
| "step": 1, | |
| "style": "IPY_MODEL_a172f487cf36424abdb62cfcf58812d4" | |
| } | |
| }, | |
| "1c3dd66acee04eecaa61a147e8f1ab9f": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "ButtonStyleModel", | |
| "state": {} | |
| }, | |
| "2ec60a0994144da0a06ae3e45532c623": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HTMLModel", | |
| "state": { | |
| "layout": "IPY_MODEL_6e2835d3a26b42b38975a358f747e0bc", | |
| "style": "IPY_MODEL_66b2307c17c348ec972f1ca00b863319", | |
| "value": "<p><b>Dashboard: </b><a href=\"https://jupyterhub.ucar.edu/dav-cont/user/abanihi/proxy/41631/status\" target=\"_blank\">https://jupyterhub.ucar.edu/dav-cont/user/abanihi/proxy/41631/status</a></p>\n" | |
| } | |
| }, | |
| "3d08a38e8cad445dac5ae78b93e07621": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "AccordionModel", | |
| "state": { | |
| "_titles": { | |
| "0": "Manual Scaling", | |
| "1": "Adaptive Scaling" | |
| }, | |
| "children": [ | |
| "IPY_MODEL_593f3c413f09457fbc30a2476427f949", | |
| "IPY_MODEL_fd8cafa641e1438183783f68d314b695" | |
| ], | |
| "layout": "IPY_MODEL_0e9ad845c34c4056a294cfa463955ecc" | |
| } | |
| }, | |
| "40b56a83252a46f1a1093296a766294f": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "4318615b587e40308ec24114210dc6aa": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "4e426350c6f949f191094e630a65c1bd": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": { | |
| "min_width": "150px" | |
| } | |
| }, | |
| "4fadcdec7f454800824547c29e112c40": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": { | |
| "width": "150px" | |
| } | |
| }, | |
| "52eeb52fad0c4c3c9771c3cfc86adc2c": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "ButtonModel", | |
| "state": { | |
| "description": "Adapt", | |
| "layout": "IPY_MODEL_4fadcdec7f454800824547c29e112c40", | |
| "style": "IPY_MODEL_1c3dd66acee04eecaa61a147e8f1ab9f" | |
| } | |
| }, | |
| "593f3c413f09457fbc30a2476427f949": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HBoxModel", | |
| "state": { | |
| "children": [ | |
| "IPY_MODEL_72350187b1c14fed90ea616c02323251", | |
| "IPY_MODEL_bcf5473418a54a7489289185929256cf" | |
| ], | |
| "layout": "IPY_MODEL_4318615b587e40308ec24114210dc6aa" | |
| } | |
| }, | |
| "66b2307c17c348ec972f1ca00b863319": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "696407486fc8416896464b65c11b648e": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "6e2835d3a26b42b38975a358f747e0bc": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "6ee0dfc92228453786c7c24611b4d846": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HBoxModel", | |
| "state": { | |
| "children": [ | |
| "IPY_MODEL_c6a484e01b8c4dca8e0daae5d1e0e5ce", | |
| "IPY_MODEL_3d08a38e8cad445dac5ae78b93e07621" | |
| ], | |
| "layout": "IPY_MODEL_ac1e298f752b4edab65d0bbb1fca68d4" | |
| } | |
| }, | |
| "72350187b1c14fed90ea616c02323251": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "IntTextModel", | |
| "state": { | |
| "description": "Workers", | |
| "layout": "IPY_MODEL_4fadcdec7f454800824547c29e112c40", | |
| "step": 1, | |
| "style": "IPY_MODEL_c2b1ddabfcd3409baf4f83972fdecbc8", | |
| "value": 2 | |
| } | |
| }, | |
| "8105683eb4df45b0a19599600bc30881": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "a172f487cf36424abdb62cfcf58812d4": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "ac1e298f752b4edab65d0bbb1fca68d4": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "bcf5473418a54a7489289185929256cf": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "ButtonModel", | |
| "state": { | |
| "description": "Scale", | |
| "layout": "IPY_MODEL_4fadcdec7f454800824547c29e112c40", | |
| "style": "IPY_MODEL_e6f861ae789f4204bfd7217c3ab52fd7" | |
| } | |
| }, | |
| "c2b1ddabfcd3409baf4f83972fdecbc8": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "DescriptionStyleModel", | |
| "state": { | |
| "description_width": "" | |
| } | |
| }, | |
| "c6a484e01b8c4dca8e0daae5d1e0e5ce": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HTMLModel", | |
| "state": { | |
| "layout": "IPY_MODEL_4e426350c6f949f191094e630a65c1bd", | |
| "style": "IPY_MODEL_696407486fc8416896464b65c11b648e", | |
| "value": "\n<div>\n <style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n </style>\n <table style=\"text-align: right;\">\n <tr> <th>Workers</th> <td>0 / 2</td></tr>\n <tr> <th>Cores</th> <td>0</td></tr>\n <tr> <th>Memory</th> <td>0 B</td></tr>\n </table>\n</div>\n" | |
| } | |
| }, | |
| "c88c2bcfa8cb498ba5f56d5bc1a1412f": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HTMLModel", | |
| "state": { | |
| "layout": "IPY_MODEL_e2ad151bc3b64fd69916c67e1558ea0d", | |
| "style": "IPY_MODEL_8105683eb4df45b0a19599600bc30881", | |
| "value": "<h2>SLURMCluster</h2>" | |
| } | |
| }, | |
| "ddaf509fbed344518d8e6e20df04ab69": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "IntTextModel", | |
| "state": { | |
| "description": "Minimum", | |
| "layout": "IPY_MODEL_4fadcdec7f454800824547c29e112c40", | |
| "step": 1, | |
| "style": "IPY_MODEL_1733cd4646c44ff89fc7946ca77a9997" | |
| } | |
| }, | |
| "ddf98339780e41c297718c2a2079bb39": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "e2ad151bc3b64fd69916c67e1558ea0d": { | |
| "model_module": "@jupyter-widgets/base", | |
| "model_module_version": "1.2.0", | |
| "model_name": "LayoutModel", | |
| "state": {} | |
| }, | |
| "e6f861ae789f4204bfd7217c3ab52fd7": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "ButtonStyleModel", | |
| "state": {} | |
| }, | |
| "faefaec45a704362be26c7a0a458ecf2": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "VBoxModel", | |
| "state": { | |
| "children": [ | |
| "IPY_MODEL_c88c2bcfa8cb498ba5f56d5bc1a1412f", | |
| "IPY_MODEL_6ee0dfc92228453786c7c24611b4d846", | |
| "IPY_MODEL_2ec60a0994144da0a06ae3e45532c623" | |
| ], | |
| "layout": "IPY_MODEL_40b56a83252a46f1a1093296a766294f" | |
| } | |
| }, | |
| "fd8cafa641e1438183783f68d314b695": { | |
| "model_module": "@jupyter-widgets/controls", | |
| "model_module_version": "1.5.0", | |
| "model_name": "HBoxModel", | |
| "state": { | |
| "children": [ | |
| "IPY_MODEL_ddaf509fbed344518d8e6e20df04ab69", | |
| "IPY_MODEL_1b6e51a74a644abf919c9d73a1a2ac2e", | |
| "IPY_MODEL_52eeb52fad0c4c3c9771c3cfc86adc2c" | |
| ], | |
| "layout": "IPY_MODEL_ddf98339780e41c297718c2a2079bb39" | |
| } | |
| } | |
| }, | |
| "version_major": 2, | |
| "version_minor": 0 | |
| } | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 4 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "esmcat_version": "0.1.0", | |
| "id": "whp_test_collect_sim", | |
| "description": "Catalog for simulation collection data in wrf_hydro_py", | |
| "catalog_file": "whp_test_collect_sim_assets.csv", | |
| "attributes": [ | |
| { | |
| "column_name": "time", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "year", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "month", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "day", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "hour", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "file_type", | |
| "vocabulary": "" | |
| }, | |
| { | |
| "column_name": "variable", | |
| "vocabulary": "" | |
| } | |
| ], | |
| "assets": { | |
| "column_name": "path", | |
| "format": "netcdf" | |
| }, | |
| "aggregation_control": { | |
| "variable_column_name": "variable", | |
| "groupby_attrs": [ | |
| "year", | |
| "month", | |
| "day", | |
| "file_type" | |
| ], | |
| "aggregations": [ | |
| { | |
| "type": "union", | |
| "attribute_name": "variable" | |
| }, | |
| { | |
| "type": "join_existing", | |
| "attribute_name": "time", | |
| "options": { | |
| "dim": "time", | |
| "coords": "minimal", | |
| "compat": "override" | |
| } | |
| } | |
| ] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path | time | year | month | day | hour | file_type | variable | |
|---|---|---|---|---|---|---|---|---|
| /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/wrfhydropy/tests/data/collection_data/simulation/201108260100.CHRTOUT_DOMAIN1 | 2011-08-26T01:00 | 2011 | 8 | 26 | 1 | CHRTOUT | ['streamflow', 'nudge'] | |
| /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/wrfhydropy/tests/data/collection_data/simulation/201108260100.GWOUT_DOMAIN1 | 2011-08-26T01:00 | 2011 | 8 | 26 | 1 | GWOUT | ['inflow', 'outflow'] | |
| /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/wrfhydropy/tests/data/collection_data/simulation/201108260200.CHRTOUT_DOMAIN1 | 2011-08-26T02:00 | 2011 | 8 | 26 | 2 | CHRTOUT | ['streamflow', 'nudge'] | |
| /glade/u/home/jamesmcc/WRF_Hydro/wrf_hydro_py/wrfhydropy/tests/data/collection_data/simulation/201108260200.GWOUT_DOMAIN1 | 2011-08-26T02:00 | 2011 | 8 | 26 | 2 | GWOUT | ['inflow', 'outflow'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment