Skip to content

Commit 4738a8f

Browse files
committed
add some error message
1 parent 9a25572 commit 4738a8f

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

templates_notebooks/template_hquiver.ipynb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 43,
58+
"execution_count": 46,
5959
"metadata": {
6060
"slideshow": {
6161
"slide_type": ""
@@ -113,7 +113,7 @@
113113
"day = None\n",
114114
"record = None \n",
115115
"box = None\n",
116-
"depth = 100\n",
116+
"depth = 'bottom'\n",
117117
"do_data_r2g = False # set to False if u,v data are already in geo-coordinates\n",
118118
"\n",
119119
"#___Define Reference Data, Year, Mon ...______________________________________________\n",
@@ -170,7 +170,7 @@
170170
"mesh_opt = dict({'color':'k', 'linewidth':0.10})\n",
171171
"do_enum = False # do enumeration of panels\n",
172172
"do_reffig = True # plot reference fig when doing anomalies \n",
173-
"do_clim = True # plot climatolgy values when doing absoluts\n",
173+
"do_clim = False # plot climatolgy values when doing absoluts\n",
174174
"ax_title = None\n",
175175
"cb_label = None\n",
176176
"save_dpi = 150\n",
@@ -1860,7 +1860,7 @@
18601860
},
18611861
{
18621862
"cell_type": "code",
1863-
"execution_count": 44,
1863+
"execution_count": 47,
18641864
"metadata": {
18651865
"slideshow": {
18661866
"slide_type": ""
@@ -1872,14 +1872,12 @@
18721872
"name": "stdout",
18731873
"output_type": "stream",
18741874
"text": [
1875-
" --> elasped time to load clim: 0.27 min.\n",
1876-
" --> clim uses 0.15 Gb:\n",
1877-
"100\n",
1875+
"bottom\n",
18781876
"0 /albedo/work/user/pscholz/results/dart_linfs_pc0_ctrl_1/1/ dart test\n",
1879-
" --> elasped time to load data: 0.16 min.\n",
1880-
" --> data uses 0.15 Gb:\n",
1877+
" --> elasped time to load data: 0.97 min.\n",
1878+
" --> data uses 0.18 Gb:\n",
18811879
"\n",
1882-
" --> total elasped time to process data: 25.58 sec.\n"
1880+
" --> total elasped time to process data: 58.34 sec.\n"
18831881
]
18841882
}
18851883
],
@@ -1898,9 +1896,8 @@
18981896
" elif vname=='vec+unod+vnod' and which_clim.lower()=='glorys12_v1': clim_vnameu, clim_vnamev, onelem = 'uo', 'vo', False\n",
18991897
" else: raise ValueError('this variable is not supported for climatology') \n",
19001898
" # clim = xr.open_Dataset(clim_path).rename({clim_vnameu:'u', clim_vnamev:'v', })\n",
1901-
" clim, depth = tpv.load_climatology_uv(mesh, clim_path, clim_vnameu, clim_vnamev, onelem=onelem, depth=depth, mon=mon)\n",
1899+
" clim, depth = tpv.load_climatology_uv(mesh, clim_path, clim_vnameu, clim_vnamev, onelem=onelem, depth=depth, mon=mon, descript=which_clim)\n",
19021900
" clim = clim.rename({clim_vnameu:'u', clim_vnamev:'v'})\n",
1903-
" clim.attrs['descript'] = which_clim\n",
19041901
" print(' --> elasped time to load clim: {:3.2f} min.'.format( (clock.time()-ts)/60 )) \n",
19051902
" print(' --> clim uses {:3.2f} Gb:'.format(clim.nbytes/(1024**3)))\n",
19061903
" data_list.append(clim) \n",

tripyview/sub_climatology.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ def load_climatology_uv(mesh, datapath, vnameu, vnamev, mon=None, depth=None, de
447447
#___________________________________________________________________________
448448
# do vertical interpolation
449449
if (depth) is not None:
450+
if isinstance(depth, str):raise ValueError(' depth=\'bottom\' is not supported for the climatology')
451+
450452
#_______________________________________________________________________
451453
# select depth level indices that are needed to interpolate the values
452454
# in depth list,array

0 commit comments

Comments
 (0)