stress_factor_shape.ipynb 1.89 MB
Newer Older
1
2
3
4
{
 "cells": [
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
5
   "id": "consecutive-compromise",
6
7
8
9
10
11
12
   "metadata": {},
   "source": [
    "# **Mathematical shape of the stress factor function**"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
13
   "id": "sufficient-kenya",
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Part I - Methodology \n",
    "\n",
    "## <u> Motivation </u> \n",
    "\n",
    "### Theoretical background\n",
    "\n",
    "Different mathematical shapes of the stress factor can be found in the litterature, from simplistic linear ones (Martens et al., 2017) to more exotic and complex shapes (Sellers et al., 2007). The present notebook does not aim at exploring all the different mathmatical shapes possible for the stress factor arising from the literature. We will limit our investigation to the three most commonly encountered shapes : \n",
    "1. Linear : \n",
    "\\begin{equation}\n",
    "F(\\theta) = \n",
    "\\begin{cases} \n",
    "0 & \\theta < \\theta_4\\\\\n",
    "\\frac{\\theta-\\theta_4}{\\theta_3 - \\theta_4} & \\theta_4 < \\theta < \\theta_3\\\\\n",
    "1 & \\theta  > \\theta_3\n",
    "\\end{cases}\n",
    "\\end{equation}\n",
    "\n",
    "2. Exponential concave :\n",
    "\\begin{equation}\n",
    "F(\\theta) = \n",
    "\\begin{cases} \n",
    "0 & \\theta < \\theta_4\\\\\n",
    "a.exp(b.\\theta) & \\theta_4 < \\theta < \\theta_3, b > 0\\\\\n",
    "1 & \\theta  > \\theta_3\n",
    "\\end{cases}\n",
    "\\end{equation}\n",
    "\n",
    "3. Exponential convexe :\n",
    "\\begin{equation}\n",
    "F(\\theta) = \n",
    "\\begin{cases} \n",
    "0 & \\theta < \\theta_4\\\\\n",
    "a.exp(b.\\theta) & \\theta_4 < \\theta < \\theta_3, b < 0\\\\\n",
    "1 & \\theta  > \\theta_3\n",
    "\\end{cases}\n",
    "\\end{equation}\n",
    "\n",
    "### Modelling experiements\n",
    "\n",
    "Different experiments are carried out to compare the different models and assess their behavior: \n",
    "1. All models are calibrated for a single year and their ability to reproduce an observed time serie is assessed\n",
    "2. Their prediction capability is evaluated by randomly taking one or several years of data from the Howard Springs dataset, calibrating the model for this specific year and predicting the evapo-transpiration time serie for the other years. \n",
    "3. The same procedure is repeated across different sites in Australia"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
67
   "id": "headed-theorem",
68
69
70
71
72
73
74
   "metadata": {},
   "source": [
    "# Part II - Functions set up"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
75
   "id": "distant-antarctica",
76
77
78
79
80
81
82
83
   "metadata": {},
   "source": [
    "## Importing relevant packages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
Oscar Corvi's avatar
Oscar Corvi committed
84
   "id": "adverse-croatia",
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING (aesara.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'\n",
      "WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.\n"
     ]
    }
   ],
   "source": [
    "# data manipulation and plotting\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib._layoutgrid import plot_children\n",
    "from collections import OrderedDict\n",
    "from IPython.display import display\n",
    "import os # to look into the other folders of the project\n",
    "import importlib.util # to open the .py files written somewhere else\n",
    "#sns.set_theme(style=\"whitegrid\")\n",
    "\n",
    "# Sympy and sympbolic mathematics\n",
    "from sympy import (asin, cos, diff, Eq, exp, init_printing, log, pi, sin, \n",
    "                   solve, sqrt, Symbol, symbols, tan, Abs)\n",
    "from sympy.physics.units import convert_to\n",
    "init_printing() \n",
    "from sympy.printing import StrPrinter\n",
    "from sympy import Piecewise\n",
    "StrPrinter._print_Quantity = lambda self, expr: str(expr.abbrev)    # displays short units (m instead of meter)\n",
    "from sympy.printing.aesaracode import aesara_function\n",
    "from sympy.physics.units import *    # Import all units and dimensions from sympy\n",
    "from sympy.physics.units.systems.si import dimsys_SI, SI\n",
    "\n",
    "# for ESSM, environmental science for symbolic math, see https://github.com/environmentalscience/essm\n",
    "from essm.variables._core import BaseVariable, Variable\n",
    "from essm.equations import Equation\n",
    "from essm.variables.units import derive_unit, SI, Quantity\n",
    "from essm.variables.utils import (extract_variables, generate_metadata_table, markdown, \n",
    "                                  replace_defaults, replace_variables, subs_eq)\n",
    "from essm.variables.units import (SI_BASE_DIMENSIONS, SI_EXTENDED_DIMENSIONS, SI_EXTENDED_UNITS,\n",
    "                                  derive_unit, derive_baseunit, derive_base_dimension)\n",
    "\n",
    "# For netCDF\n",
    "import netCDF4\n",
    "import numpy as np\n",
    "import xarray as xr\n",
    "import warnings\n",
    "from netCDF4 import Dataset\n",
    "\n",
    "# For regressions\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "# Deactivate unncessary warning messages related to a bug in Numpy\n",
    "warnings.simplefilter(action='ignore', category=FutureWarning)\n",
    "\n",
    "# for calibration\n",
    "from scipy import optimize\n",
    "\n",
    "from random import random"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
149
   "id": "early-excuse",
150
151
152
153
154
155
156
157
   "metadata": {},
   "source": [
    "## Path of the different files (pre-defined python functions, sympy equations, sympy variables)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
Oscar Corvi's avatar
Oscar Corvi committed
158
   "id": "right-degree",
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
   "metadata": {
    "tags": [
     "parameters"
    ]
   },
   "outputs": [],
   "source": [
    "path_variable = '../../theory/pyFile_storage/theory_variable.py'\n",
    "path_equation = '../../theory/pyFile_storage/theory_equation.py' \n",
    "path_analysis_functions = '../../theory/pyFile_storage/analysis_functions.py'\n",
    "path_data = '../../../data/eddycovdata/'\n",
    "dates_fPAR = '../../../data/fpar_howard_spring/dates_v5'\n",
    "\n",
    "timeSerie_oneSite_oneYear = 'timeSerie_oneSite_oneYear.png'\n",
    "inverseModelling = \"inverseModelling.png\"\n",
    "Influence_atmo_E_dry = \"Influence_atmo_E_dry.png\"\n",
    "Influence_atmo_E_wet = \"Influence_atmo_E_wet.png\"\n",
    "Influence_atmo_rel_dry = \"Influence_atmo_rel_dry.png\"\n",
    "Influence_atmo_rel_wet = \"Influence_atmo_rel_wet.png\"\n",
    "sensitivity_parameters = \"sensitivity_parameters.png\"\n",
    "statistical_assessment = \"statistical_assessment.png\"\n",
    "different_sites = \"different_sites.png\""
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
185
   "id": "centered-panama",
186
187
188
189
190
191
192
193
   "metadata": {},
   "source": [
    "## Importing the sympy variables and equations defined in the theory.ipynb notebook"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
Oscar Corvi's avatar
Oscar Corvi committed
194
   "id": "guided-weekend",
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "theta_sat\n",
      "theta_res\n",
      "alpha\n",
      "n\n",
      "m\n",
      "S_mvg\n",
      "theta\n",
      "h\n",
      "S\n",
      "theta_4\n",
      "theta_3\n",
      "theta_2\n",
      "theta_1\n",
      "L\n",
      "Mw\n",
      "Pv\n",
      "Pvs\n",
      "R\n",
      "T\n",
      "c1\n",
      "T0\n",
      "Delta\n",
      "E\n",
      "G\n",
      "H\n",
      "Rn\n",
      "LE\n",
      "gamma\n",
      "alpha_PT\n",
      "c_p\n",
      "w\n",
      "kappa\n",
      "z\n",
      "u_star\n",
      "VH\n",
      "d\n",
      "z_om\n",
      "z_oh\n",
      "r_a\n",
      "g_a\n",
      "r_s\n",
      "g_s\n",
      "c1_e\n",
      "c2_e\n",
      "e\n",
      "T_min\n",
      "T_max\n",
      "RH_max\n",
      "RH_min\n",
      "e_a\n",
      "e_s\n",
      "iv_T\n",
      "T_kv\n",
      "P\n",
      "rho_a\n",
      "VPD\n",
      "eq_m_n\n",
      "eq_MVG_neg_case\n",
      "eq_MVG\n",
      "eq_sat_degree\n",
      "eq_MVG_h\n",
      "eq_h_FC\n",
      "eq_theta_4_3\n",
      "eq_theta_2_1\n",
      "eq_water_stress_simple\n",
      "eq_Pvs_T\n",
      "eq_Delta\n",
      "eq_PT\n",
      "eq_PM\n",
      "eq_PM_VPD\n",
      "eq_PM_g\n",
      "eq_PM_inv\n"
     ]
    }
   ],
   "source": [
    "for code in [path_variable,path_equation]:\n",
    "    name_code = code[-20:-3]\n",
    "    spec = importlib.util.spec_from_file_location(name_code, code)\n",
    "    mod = importlib.util.module_from_spec(spec)\n",
    "    spec.loader.exec_module(mod)\n",
    "    names = getattr(mod, '__all__', [n for n in dir(mod) if not n.startswith('_')])\n",
    "    glob = globals()\n",
    "    for name in names:\n",
    "        print(name)\n",
    "        glob[name] = getattr(mod, name)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
291
   "id": "hidden-westminster",
292
293
294
295
296
297
298
299
   "metadata": {},
   "source": [
    "## Importing the performance assessment functions defined in the analysis_function.py file"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
Oscar Corvi's avatar
Oscar Corvi committed
300
   "id": "polish-invention",
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "AIC\n",
      "AME\n",
      "BIC\n",
      "CD\n",
      "CP\n",
      "IoA\n",
      "KGE\n",
      "MAE\n",
      "MARE\n",
      "ME\n",
      "MRE\n",
      "MSRE\n",
      "MdAPE\n",
      "NR4MS4E\n",
      "NRMSE\n",
      "NS\n",
      "NSC\n",
      "PDIFF\n",
      "PEP\n",
      "R4MS4E\n",
      "RAE\n",
      "RMSE\n",
      "RVE\n",
      "np\n",
      "nt\n"
     ]
    }
   ],
   "source": [
    "for code in [path_analysis_functions]:\n",
    "    name_code = code[-20:-3]\n",
    "    spec = importlib.util.spec_from_file_location(name_code, code)\n",
    "    mod = importlib.util.module_from_spec(spec)\n",
    "    spec.loader.exec_module(mod)\n",
    "    names = getattr(mod, '__all__', [n for n in dir(mod) if not n.startswith('_')])\n",
    "    glob = globals()\n",
    "    for name in names:\n",
    "        print(name)\n",
    "        glob[name] = getattr(mod, name)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
350
   "id": "level-contrast",
351
352
353
354
355
356
357
   "metadata": {},
   "source": [
    "## Data import, preprocess and shape for the computations"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
358
   "id": "powerful-arizona",
359
360
361
362
363
364
365
366
367
368
   "metadata": {},
   "source": [
    "### Get the different files where data are stored\n",
    "\n",
    "Eddy-covariance data from the OzFlux network are stored in **.nc** files (NetCDF4 files) which is roughly a panda data frame with meta-data (see https://www.unidata.ucar.edu/software/netcdf/ for more details about NetCDF4 file format). fPAR data are stored in **.txt** files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
Oscar Corvi's avatar
Oscar Corvi committed
369
   "id": "dated-performance",
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['../../../data/eddycovdata/fpar_adelaide_v5.txt', '../../../data/eddycovdata/fpar_daly_v5.txt', '../../../data/eddycovdata/fpar_dry_v5.txt', '../../../data/eddycovdata/fpar_howard_v5.txt', '../../../data/eddycovdata/fpar_sturt_v5.txt']\n",
      "['../../../data/eddycovdata/AdelaideRiver_L4.nc', '../../../data/eddycovdata/DalyUncleared_L4.nc', '../../../data/eddycovdata/DryRiver_L4.nc', '../../../data/eddycovdata/HowardSprings_L4.nc', '../../../data/eddycovdata/SturtPlains_L4.nc']\n"
     ]
    }
   ],
   "source": [
    "fPAR_files = []\n",
    "eddy_files = []\n",
    "\n",
    "for file in os.listdir(path_data):\n",
    "    if file.endswith(\".txt\"):\n",
    "        fPAR_files.append(os.path.join(path_data, file))\n",
    "    elif file.endswith(\".nc\"):\n",
    "        eddy_files.append(os.path.join(path_data, file))\n",
    "        \n",
    "fPAR_files.sort()\n",
    "print(fPAR_files)\n",
    "eddy_files.sort()\n",
    "print(eddy_files)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
399
   "id": "steady-thought",
400
401
402
403
404
405
406
407
408
   "metadata": {},
   "source": [
    "### Define and test a function that process the fPAR data\n",
    "In the **.txt** files, only one value per month is given for the fPAR. The following function takes one .txt file containing data about the fPAR coefficients, and the related dates, stored in the a seperate file. The fPAR data (date and coefficients) are cleaned (good string formatting), mapped together and averaged to output one value per month (the fPAR measurement period doesn't spans the measurement period of the eddy covariance data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
Oscar Corvi's avatar
Oscar Corvi committed
409
   "id": "electric-paraguay",
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
   "metadata": {},
   "outputs": [],
   "source": [
    "def fPAR_data_process(fPAR_file,dates_fPAR):\n",
    "    \n",
    "    fparv5_dates = np.genfromtxt(dates_fPAR, dtype='str', delimiter=',')\n",
    "    fparv5_dates = pd.to_datetime(fparv5_dates[:,1], format=\"%Y%m\")\n",
    "    dates_pd = pd.date_range(fparv5_dates[0], fparv5_dates[-1], freq='MS')\n",
    "\n",
    "    fparv5_howard = np.loadtxt(fPAR_file,delimiter=',', usecols=3 )\n",
    "    fparv5_howard[fparv5_howard == -999] = np.nan\n",
    "    fparv5_howard_pd = pd.Series(fparv5_howard, index = fparv5_dates)\n",
    "    fparv5_howard_pd = fparv5_howard_pd.resample('MS').max()\n",
    "\n",
    "    # convert fparv5_howard_pd to dataframe\n",
    "    fPAR_pd = pd.DataFrame(fparv5_howard_pd)\n",
    "    fPAR_pd = fPAR_pd.rename(columns={0:\"fPAR\"})\n",
    "    fPAR_pd.index = fPAR_pd.index.rename(\"time\")\n",
    "\n",
    "    # convert fPAR_pd to xarray to aggregate the data\n",
    "    fPAR_xr = fPAR_pd.to_xarray()\n",
    "    fPAR_agg = fPAR_xr.fPAR.groupby('time.month').max()\n",
    "\n",
    "    # convert back to dataframe\n",
    "    fPAR_pd = fPAR_agg.to_dataframe()\n",
    "    Month = np.arange(1,13)\n",
    "    Month_df = pd.DataFrame(Month)\n",
    "    Month_df.index = fPAR_pd.index\n",
    "    Month_df = Month_df.rename(columns={0:\"Month\"})\n",
    "\n",
    "    fPAR_mon = pd.concat([fPAR_pd,Month_df], axis = 1)\n",
    "    \n",
    "    return(fPAR_mon)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
Oscar Corvi's avatar
Oscar Corvi committed
448
   "id": "intended-merchant",
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
   "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>fPAR</th>\n",
       "      <th>Month</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.78</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.84</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.79</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.84</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.71</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.75</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.60</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.54</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.52</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0.67</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0.73</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.78</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       fPAR  Month\n",
       "month             \n",
       "1      0.78      1\n",
       "2      0.84      2\n",
       "3      0.79      3\n",
       "4      0.84      4\n",
       "5      0.71      5\n",
       "6      0.75      6\n",
       "7      0.60      7\n",
       "8      0.54      8\n",
       "9      0.52      9\n",
       "10     0.67     10\n",
       "11     0.73     11\n",
       "12     0.78     12"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fPAR_data_process(fPAR_files[3],dates_fPAR)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
574
   "id": "egyptian-prefix",
575
576
577
578
579
580
581
582
583
   "metadata": {},
   "source": [
    "### fPARSet function\n",
    "Map the fPAR time serie to the given eddy-covariance data. Takes two dataframes as input (one containing the fPAR data, the other containing the eddy-covariance data) and returns a data frame where the fPAR monthly values have been scaled to the time scale of the eddy covariance data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
Oscar Corvi's avatar
Oscar Corvi committed
584
   "id": "capable-melbourne",
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
   "metadata": {},
   "outputs": [],
   "source": [
    "def fPARSet(df_add, fPAR_pd):\n",
    "    \n",
    "    # construct the time serie of the fPAR coefficients\n",
    "    dummy_len = df_add[\"Fe\"].size\n",
    "    fPAR_val = np.zeros((dummy_len,))\n",
    "    \n",
    "    dummy_pd = df_add\n",
    "    dummy_pd.reset_index(inplace=True)\n",
    "    dummy_pd.index=dummy_pd.time\n",
    "    \n",
    "    month_pd = dummy_pd['time'].dt.month\n",
    "    \n",
    "    for i in range(dummy_len):\n",
    "        current_month = month_pd.iloc[i]\n",
    "        line_fPAR = fPAR_pd[fPAR_pd['Month'] == current_month]\n",
    "        fPAR_val[i] = line_fPAR['fPAR']\n",
    "    \n",
    "    # transform fPAR_val into dataframe to concatenate to df:\n",
    "    fPAR = pd.DataFrame(fPAR_val, index = df_add.index)\n",
    "    df_add = pd.concat([df_add,fPAR], axis = 1)\n",
    "    df_add = df_add.rename(columns = {0:\"fPAR\"})\n",
    "    \n",
    "    return(df_add)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
615
   "id": "successful-beach",
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
   "metadata": {},
   "source": [
    "### DataChose function\n",
    "\n",
    "Function taking the raw netcdf4 data file from the eddy covariance measurement and shape it such that it can be used for the computations. Only relevant variables are kept (latent heat flux, net radiation, ground heat flux, soil water content, wind speed, air temperature, VPD, bed shear stress). The desired data period is selected and is reshaped at the desired time scale (daily by default). Uses the fPARSet function defined above\n",
    "\n",
    "List of variable abbreviation : \n",
    "* `Rn` : Net radiation flux\n",
    "* `G` : Ground heat flux \n",
    "* `Sws` : soil moisture\n",
    "* `Ta` : Air temperature\n",
    "* `RH` : Relative humidity\n",
    "* `W` : Wind speed\n",
    "* `E` : measured evaporation\n",
    "* `VPD` : Vapour pressure deficit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
Oscar Corvi's avatar
Oscar Corvi committed
636
   "id": "median-boards",
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
   "metadata": {},
   "outputs": [],
   "source": [
    "def DataChose(ds_ref, period_sel, fPAR_given, Freq = \"D\", sel_period_flag = True):\n",
    "    \"\"\"Take subset of dataset if Flag == True, entire dataset else\n",
    "    \n",
    "    ds_ref: xarray object to be considered as the ref for selecting attributes\n",
    "    agg_flag: aggregate the data at daily time scale if true\n",
    "    Flag: select specific period if true (by default)\n",
    "    period: time period to be selected\n",
    "    ----------\n",
    "    Method : \n",
    "    - transform the xarray in panda dataframe for faster iteration\n",
    "    - keep only the necessary columns : Fe, Fn, Fg, Ws, Sws, Ta, ustar, RH\n",
    "    - transform / create new variables : Temperature in °C, T_min/T_max, RH_min/RH_max\n",
    "    - create the Data vector (numpy arrays)\n",
    "    - create back a xarray \n",
    "    - return an xarray\n",
    "    ----------\n",
    "    \n",
    "    Returns an xarray and a Data vector\n",
    "    \"\"\"\n",
    "    \n",
    "    if sel_period_flag:\n",
    "        df = ds_ref.sel(time = period_sel) \n",
    "        # nameXarray_output = period + \"_\" + nameXarray_output\n",
    "    else : \n",
    "        df = ds_ref\n",
    "        \n",
    "    # keep only the columns of interest\n",
    "    df = df[[\"Fe\",\"Fn\",\"Fg\",\"Ws\",\"Sws\",\"Ta\",\"ustar\",\"RH\", \"VPD\",\"ps\"]]\n",
    "    \n",
    "    # convert to dataframe\n",
    "    df = df.to_dataframe()\n",
    "    \n",
    "    # aggregate following the rule stated in freq\n",
    "    pd_Tmin = df.Ta.groupby([pd.Grouper(level = \"latitude\"), pd.Grouper(level = \"longitude\"), pd.Grouper(level = \"time\", freq = Freq)]).min()\n",
    "               \n",
    "    pd_Tmax = df.Ta.groupby([pd.Grouper(level = \"latitude\"), pd.Grouper(level = \"longitude\"), pd.Grouper(level = \"time\", freq = Freq)]).max()\n",
    "    \n",
    "    pd_RHmin = df.RH.groupby([pd.Grouper(level = \"latitude\"), pd.Grouper(level = \"longitude\"), pd.Grouper(level = \"time\", freq = Freq)]).min()\n",
    "    \n",
    "    pd_RHmax = df.RH.groupby([pd.Grouper(level = \"latitude\"), pd.Grouper(level = \"longitude\"), pd.Grouper(level = \"time\", freq = Freq)]).max()\n",
    "    \n",
    "    df = df.groupby([pd.Grouper(level = \"latitude\"), pd.Grouper(level = \"longitude\"), pd.Grouper(level = \"time\", freq = Freq)]).mean()\n",
    "    df = pd.DataFrame(df)\n",
    "    \n",
    "    pd_Tmin = pd.DataFrame(pd_Tmin, index = df.index)\n",
    "    pd_Tmin = pd_Tmin.rename(columns = {\"Ta\":\"Ta_min\"})\n",
    "    \n",
    "    pd_Tmax = pd.DataFrame(pd_Tmax, index = df.index)\n",
    "    pd_Tmax = pd_Tmax.rename(columns = {\"Ta\":\"Ta_max\"})\n",
    "    \n",
    "    pd_RHmin = pd.DataFrame(pd_RHmin, index = df.index)\n",
    "    pd_RHmin = pd_RHmin.rename(columns = {\"RH\":\"RH_min\"})\n",
    "    \n",
    "    pd_RHmax = pd.DataFrame(pd_RHmax, index = df.index)\n",
    "    pd_RHmax = pd_RHmax.rename(columns = {\"RH\":\"RH_max\"})\n",
    "    \n",
    "    df = pd.concat([df,pd_Tmin,pd_Tmax,pd_RHmin,pd_RHmax],axis = 1)\n",
    "    \n",
    "    # convert data to the good units : \n",
    "    df[\"Fe\"] = df[\"Fe\"]/2.45e6 # divide by latent heat of vaporization\n",
    "    df[\"Ta\"] = df[\"Ta\"]+273 # convert to kelvin\n",
    "    df[\"VPD\"] = df[\"VPD\"]*1000 # convert from kPa to Pa\n",
    "    \n",
    "    # construct the time serie of the fPAR coefficients\n",
    "    df = fPARSet(df,fPAR_given)\n",
    "    \n",
    "    # initialise array for the error\n",
    "    Error_obs = np.zeros((df.Fe.size,))\n",
    "    \n",
    "    for i in range(df.Fe.size):\n",
    "        size_window_left, size_window_right = min(i,7),min(df.Fe.size - i-1, 7)\n",
    "        #print(size_window_left, size_window_right)\n",
    "        sub_set = df.Fe[i-size_window_left : i+size_window_right].to_numpy()\n",
    "        mean_set = np.mean(sub_set)\n",
    "        sdt_set = np.std(sub_set)\n",
    "        error_obs = 2*sdt_set\n",
    "        Error_obs[i] = error_obs\n",
    "    \n",
    "    ErrorObs = pd.DataFrame(Error_obs, index = df.index)\n",
    "    \n",
    "    df = pd.concat([df,ErrorObs], axis = 1)\n",
    "    df = df.rename(columns = {0:\"error\"})\n",
    "\n",
    "        \n",
    "    return(df)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
729
   "id": "utility-astronomy",
730
731
732
733
734
735
736
737
   "metadata": {},
   "source": [
    "## Compile the different functions defined in the symbolic domain\n",
    "All functions defined with sympy and ESSM are defined in the symbolic domain. In order to be efficiently evaluated, they need to be vectorized to allow computations with numpu arrays. We use the *aesara* printing compiler from the sympy package. Note that this printer replace the older one (*theano*) which is deprecated. A comparison of the performances between the two packages can be found in the aesara repository."
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
738
   "id": "cathedral-pilot",
739
740
741
742
743
744
745
746
   "metadata": {},
   "source": [
    "### Water stress functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
Oscar Corvi's avatar
Oscar Corvi committed
747
   "id": "split-message",
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
   "metadata": {},
   "outputs": [],
   "source": [
    "def rising_slope_compiled():\n",
    "    \"\"\"Compile the slope of the function between theta 4 and theta 3\"\"\"\n",
    "    \n",
    "    rising_slope = aesara_function([theta,theta_3, theta_4], [eq_theta_4_3.rhs], dims = {theta:1, theta_3:1, theta_4:1})\n",
    "    \n",
    "    return(rising_slope)\n",
    "\n",
    "def desc_slope_compiled():\n",
    "    \"\"\"Compile the slope of the function between theta 2 and theta 1\"\"\"\n",
    "    \n",
    "    desc_slope = aesara_function([theta,theta_1, theta_2], [eq_theta_2_1.rhs], dims = {theta:1, theta_1:1, theta_2:1})\n",
    "    \n",
    "    return(desc_slope)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
768
   "id": "circular-midnight",
769
770
771
772
773
774
775
776
   "metadata": {},
   "source": [
    "### Soil water potential"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
Oscar Corvi's avatar
Oscar Corvi committed
777
   "id": "vital-physiology",
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
   "metadata": {},
   "outputs": [],
   "source": [
    "def relative_saturation_compiled(ThetaRes, ThetaSat):\n",
    "    \"\"\"Compile the relative saturation function of a soil\"\"\"\n",
    "    Dict_value = {theta_res : ThetaRes, theta_sat : ThetaSat}\n",
    "    \n",
    "    S_mvg_func = aesara_function([theta], [eq_sat_degree.rhs.subs(Dict_value)], dims = {theta:1})\n",
    "    \n",
    "    return(S_mvg_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
Oscar Corvi's avatar
Oscar Corvi committed
793
   "id": "resident-centre",
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
   "metadata": {},
   "outputs": [],
   "source": [
    "def Psi_compiled(alphaVal, nVal):\n",
    "    \"\"\"Compile the soil water retention function as function of theta\"\"\"\n",
    "    mVal = 1-1/nVal\n",
    "    \n",
    "    Dict_value = {alpha : alphaVal, n : nVal, m : mVal}\n",
    "    \n",
    "    Psi_function = aesara_function([S_mvg], [eq_MVG_h.rhs.subs(Dict_value)], dims = {S_mvg:1})\n",
    "    \n",
    "    return(Psi_function)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
810
   "id": "previous-hobby",
811
812
813
814
815
816
817
818
   "metadata": {},
   "source": [
    "### Penman-Monteith"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
Oscar Corvi's avatar
Oscar Corvi committed
819
   "id": "single-execution",
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
   "metadata": {},
   "outputs": [],
   "source": [
    "def Delta_compiled():\n",
    "    \"\"\"Compile the Delta function\"\"\"\n",
    "    \n",
    "    # creating the dictionnary with all default values from the above defined constants\n",
    "    var_dict = Variable.__defaults__.copy()\n",
    "    \n",
    "    # computing delta values out of temperature values (slope of the water pressure curve)\n",
    "    Delta_func = aesara_function([T],[eq_Delta.rhs.subs(var_dict)], dims = {T:1})\n",
    "    \n",
    "    return(Delta_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
Oscar Corvi's avatar
Oscar Corvi committed
838
   "id": "special-celebration",
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
   "metadata": {},
   "outputs": [],
   "source": [
    "def VH_func_compiled(z_val):\n",
    "    \"\"\"Compute the vegetation height function\n",
    "    --------------------------------------------------------\n",
    "    z : height of the measurements (m)\n",
    "    kappa : Von Karman constant\n",
    "    \n",
    "    w : wind velocity (m/s)\n",
    "    u_star : shear stress velocity (m/s)\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    Return a function with w and u_star as degrees of freedom\n",
    "    \"\"\"\n",
    "    # get the constant values\n",
    "    Dict_value = {z:z_val,kappa:kappa.definition.default}\n",
    "    \n",
    "    # compile the function\n",
    "    VH_func = aesara_function([w,u_star],[VH.definition.expr.subs(Dict_value)], dims = {w:1, u_star:1})\n",
    "    \n",
    "    return(VH_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
Oscar Corvi's avatar
Oscar Corvi committed
866
   "id": "shaped-object",
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
   "metadata": {},
   "outputs": [],
   "source": [
    "def d_func_compiled():\n",
    "    \"\"\"Compile the zero plane displacement height function\n",
    "    --------------------------------------------------------\n",
    "    VH : Vegetation height\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    return a function with VH as degree of freedom\n",
    "    \"\"\"\n",
    "    \n",
    "    # compile the function \n",
    "    d_func = aesara_function([VH], [d.definition.expr], dims = {VH:1})\n",
    "    \n",
    "    return(d_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
Oscar Corvi's avatar
Oscar Corvi committed
888
   "id": "decreased-wilson",
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
   "metadata": {},
   "outputs": [],
   "source": [
    "def zom_func_compiled():\n",
    "    \"\"\"Compile the characteristic momentum height exchange\n",
    "    --------------------------------------------------------\n",
    "    VH : Vegetation height\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    return a function with VH as degree of freedom\n",
    "    \"\"\"\n",
    "    \n",
    "    # compile the function \n",
    "    zom_func = aesara_function([VH], [z_om.definition.expr], dims = {VH:1})\n",
    "    \n",
    "    return(zom_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
Oscar Corvi's avatar
Oscar Corvi committed
910
   "id": "opponent-heritage",
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
   "metadata": {},
   "outputs": [],
   "source": [
    "def zoh_func_compiled():\n",
    "    \"\"\"Compile the characteristic heat height exchange\n",
    "    --------------------------------------------------------\n",
    "    VH : Vegetation height\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    return a function with VH as degree of freedom\n",
    "    \"\"\"\n",
    "    \n",
    "    # compile the function \n",
    "    zoh_func = aesara_function([z_om], [z_oh.definition.expr], dims = {z_om:1})\n",
    "    \n",
    "    return(zoh_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
Oscar Corvi's avatar
Oscar Corvi committed
932
   "id": "undefined-mailing",
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
   "metadata": {},
   "outputs": [],
   "source": [
    "def ra_func_compiled(z_val):\n",
    "    \"\"\"Substitutes the different terms of the r_a expression\n",
    "    --------------------------------------------------------\n",
    "    z : height of the measurement (m)\n",
    "    \n",
    "    d : zero plane displacement height (m)\n",
    "    zoh_val : characteristic height of the heat transfert\n",
    "    zom_val : characteristic height of the momentum transfert\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    returns the compiled expression of r_a evaluable according to the wind speed\n",
    "    \"\"\"\n",
    "    # evaluate the values in the expression\n",
    "    Dict_value = {z:z_val,kappa:kappa.definition.default}\n",
    "    \n",
    "    # compile the function\n",
    "    ra_func = aesara_function([z_om,z_oh,d,w], [r_a.definition.expr.subs(Dict_value)], dims = {z_om:1,z_oh:1,d:1,w:1})\n",
    "    \n",
    "    return(ra_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
Oscar Corvi's avatar
Oscar Corvi committed
960
   "id": "diverse-bulgarian",
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
   "metadata": {},
   "outputs": [],
   "source": [
    "def ea_func_compiled():\n",
    "    \"\"\" Compute the actual water vapour deficit with RH and T (min/max) left as degree of freedom\n",
    "    --------------------------------------------------------\n",
    "    c1 : internal variable \n",
    "    c2 : internal variable \n",
    "    \n",
    "    T_min : time serie of daily min temperature\n",
    "    T_max : time serie of daily max temperature \n",
    "    RH_min : time serie of daily min relative humidity \n",
    "    RH_max : time serie of daily max relative humidity\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    retunrs the compiled expression of the e_a function with four degrees of freedom \n",
    "    \"\"\"\n",
    "    \n",
    "    # get the constants\n",
    "    Dict_value = {c1_e:c1_e.definition.default, c2_e:c2_e.definition.default}\n",
    "    \n",
    "    #compile the function\n",
    "    ea_func = aesara_function([T_min,T_max,RH_min,RH_max],[e_a.definition.expr.subs(Dict_value)], dims={T_min:1, T_max:1, RH_min:1, RH_max:1})\n",
    "    \n",
    "    return(ea_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
Oscar Corvi's avatar
Oscar Corvi committed
991
   "id": "deadly-spice",
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
   "metadata": {},
   "outputs": [],
   "source": [
    "def es_func_compiled():\n",
    "    \"\"\"Compute the saturation water vapour deficit with T (min / max) left as degree of freedom \n",
    "    --------------------------------------------------------\n",
    "    c1 : internal variable \n",
    "    c2 : internal variable \n",
    "    \n",
    "    T_min : time serie of daily min temperature\n",
    "    T_max : time serie of daily max temperature \n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    retunrs the compiled expression of the e_s function with four degrees of freedom \n",
    "    \"\"\"\n",
    "    \n",
    "    # get the constants\n",
    "    Dict_value = {c1_e:c1_e.definition.default, c2_e:c2_e.definition.default}\n",
    "    \n",
    "    #compile the function\n",
    "    ea_func = aesara_function([T_min,T_max],[e_s.definition.expr.subs(Dict_value)], dims={T_min:1, T_max:1})\n",
    "    \n",
    "    return(ea_func)    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
Oscar Corvi's avatar
Oscar Corvi committed
1020
   "id": "pressed-familiar",
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
   "metadata": {},
   "outputs": [],
   "source": [
    "def PM_compiled():\n",
    "    \"\"\" Compute the compiled version of the PM VPD equation\n",
    "    --------------------------------------------------------\n",
    "    c_p : specific heat of the air\n",
    "    rho_a : mean air density\n",
    "    gamma : psychrometric constant\n",
    "    L : Latent heat flux\n",
    "    \n",
    "    r_s : Surface resistance -> given (can also be modeled)\n",
    "    G : ground heat flux -> comes from the data\n",
    "    Rn : net radiation flux -> comes from the data \n",
    "    Delta : slope of the saturation curve -> computed above\n",
    "    r_a : aerodynamic resistance -> computed above\n",
    "    --------------------------------------------------------\n",
    "    \n",
    "    returns the evaporation flux (in mm/time) with Delta, G, Rn, e_a, e_s, r_a as degrees of freedom\n",
    "    \"\"\"\n",
    "    \n",
    "    # get the constant values\n",
    "    Dict_value = {c_p:c_p.definition.default, rho_a:rho_a.definition.default, L:L.definition.default, gamma:gamma.definition.default}\n",
    "    \n",
    "    # compile the function\n",
    "    PM_func = aesara_function([G,Rn,Delta,VPD,g_a, g_s], [eq_PM_g.rhs.subs(Dict_value)], dims = {G:1,Rn:1,Delta:1,VPD:1,g_a:1, g_s:1})\n",
    "    \n",
    "    return(PM_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
Oscar Corvi's avatar
Oscar Corvi committed
1054
   "id": "civilian-toner",
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
   "metadata": {},
   "outputs": [],
   "source": [
    "def PT_compiled():\n",
    "    \"\"\"Compute the Priestley-Taylor equation,\n",
    "    need 4 input : temperature, net radiations, ground heat flux and alpha PT parameter\n",
    "    Each must be given as np.array\n",
    "    Return the compiled function\n",
    "    \"\"\"\n",
    "    \n",
    "    # creating the dictionnary with all default values from the above defined constants\n",
    "    var_dict = Variable.__defaults__.copy()\n",
    "    \n",
    "    # Computing the values of evaporation using the Priestley-Taylor model\n",
    "    PT_func = aesara_function([Delta,Rn,G, alpha_PT],[eq_PT.rhs.subs(var_dict)],dims = {Delta:1,Rn:1,G:1, alpha_PT:1})\n",
    "\n",
    "    return(PT_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
Oscar Corvi's avatar
Oscar Corvi committed
1077
   "id": "absent-arthritis",
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
   "metadata": {},
   "outputs": [],
   "source": [
    "def rs_PM_inv():\n",
    "    \"Derive the time serie of the surface resistance out of the observed latent heat fluxes --> inverse modelling of the PM equation\"\n",
    "    \n",
    "    #get the constant values \n",
    "    Dict_value = {c_p:c_p.definition.default, rho_a:rho_a.definition.default, L:L.definition.default, gamma:gamma.definition.default}\n",
    "    \n",
    "    # compile the function\n",
    "    Inv_PM = aesara_function([E,G,Rn,Delta,VPD,r_a], [eq_PM_inv.rhs.subs(Dict_value)], dims = {E:1,G:1,Rn:1,Delta:1,VPD:1,r_a:1})\n",
    "    \n",
    "    return(Inv_PM)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1095
   "id": "breathing-manual",
1096
1097
1098
1099
1100
1101
1102
1103
   "metadata": {},
   "source": [
    "### Assign the different compiled functions to variables functions (create the functions in python)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
Oscar Corvi's avatar
Oscar Corvi committed
1104
   "id": "robust-maker",
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
   "metadata": {},
   "outputs": [],
   "source": [
    "# Water_stress properties: \n",
    "rising_slope = rising_slope_compiled() # takes theta, theta_3, theta_4 in this order as input\n",
    "desc_slope = desc_slope_compiled() # takes theta, theta_1, theta_2 in this order as input\n",
    "\n",
    "# properties : \n",
    "delta_func = Delta_compiled() # takes Ta as input\n",
    "z_val = 23 # change the values of the aerodynamic constants here !!!\n",
    "VH_func = VH_func_compiled(z_val)\n",
    "d_func = d_func_compiled()\n",
    "zom_func = zom_func_compiled()\n",
    "zoh_func = zoh_func_compiled()\n",
    "ra_func = ra_func_compiled(z_val)\n",
    "eSat_func = es_func_compiled()\n",
    "ea_func = ea_func_compiled()\n",
    "\n",
    "# models\n",
    "PM_func = PM_compiled()\n",
    "PT_func = PT_compiled()\n",
    "Inv_PM_func = rs_PM_inv()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
Oscar Corvi's avatar
Oscar Corvi committed
1132
   "id": "respected-sessions",
1133
1134
1135
   "metadata": {},
   "outputs": [],
   "source": [
1136
    "def stress_factor_func(psi_vec,Psi_3,Psi_4,a):\n",
1137
1138
1139
1140
1141
1142
    "    \n",
    "    Length = psi_vec.size\n",
    "    \n",
    "    Stress_func = np.zeros((Length,))\n",
    "    Psi_3 = np.array([Psi_3])\n",
    "    Psi_4 = np.array([Psi_4])\n",
1143
    "    \n",
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
    "    for j in range(Length):\n",
    "        try:\n",
    "            Psi_val = psi_vec[j]\n",
    "        except Exception as error:\n",
    "            print(psi_vec,error)\n",
    "        # have to convert float to arrays in order to run the compiled functions\n",
    "        Psi_val = np.array([Psi_val])\n",
    "        if (Psi_val < Psi_4):\n",
    "            Stress_func[j] = 0\n",
    "        elif (Psi_val >= Psi_4) & (Psi_val < Psi_3):\n",
1154
1155
1156
1157
1158
    "            linear = (Psi_val-Psi_4)/(Psi_3-Psi_4)\n",
    "            if a == 0:\n",
    "                Stress_func[j] = linear\n",
    "            else:\n",
    "                Stress_func[j] = (1-np.exp(a*linear))/(1-np.exp(a))\n",
1159
1160
1161
1162
1163
1164
1165
    "        else:\n",
    "            Stress_func[j] = 1\n",
    "    return(Stress_func)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1166
   "id": "dense-prairie",
1167
1168
1169
1170
1171
1172
1173
1174
   "metadata": {},
   "source": [
    "## Functions to run the different models\n",
    "Once the functions has been defined in sympy, compiled with aesara and assign to a useful python function, it is now time to link it with the data to carry out the final computations ! All the following functions take a dataframe as input, and the related parameters ($\\theta_3$ and $\\theta_4$ for the stress function) and return a numpy array and a dictionnary containing the values of the model run and some miscellaneous information."
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1175
   "id": "valuable-isaac",
1176
1177
1178
1179
1180
1181
1182
1183
   "metadata": {},
   "source": [
    "### Varying surface resistance model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
Oscar Corvi's avatar
Oscar Corvi committed
1184
   "id": "electric-kitty",
1185
1186
1187
   "metadata": {},
   "outputs": [],
   "source": [
1188
    "def PM_run_var(data, Psi_3_val, Psi_4_val,shape, gs_val = 1/70, compute_VPD = False):\n",
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
    "    \"\"\"run varying SR Penman Monteith model but with VPD data instead of Ea and Es\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    Psi_3_val: vector of the same size as the vectors in data, full of the value Psi_3\n",
    "    Psi_4_val: vector of the same size as the vectors in data, full of the value Psi_4\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "\n",
    "    # Stress factor:\n",
1223
    "    FF_vec = stress_factor_func(Sws_val,Psi_3_val,Psi_4_val, shape)\n",
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "    Ga_T = 1/Ra_T\n",
    "\n",
    "    # surface resistance:\n",
    "    Gs_T = gs_val*FF_vec+0.0001\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PM_var = fPAR_val*PM_func(Fg_val,Fn_val,D_T,VPD_val,Ga_T, Gs_T) # R_s varying with theta\n",
    "    \n",
    "    Dic_var = {\"ga\":Ga_T, \"gs\":Gs_T, \"D_T\":D_T}\n",
    "    \n",
    "    return(PM_var)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1247
   "id": "featured-trial",
1248
1249
1250
1251
1252
1253
1254
1255
   "metadata": {},
   "source": [
    "### Constant surface conductance model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
Oscar Corvi's avatar
Oscar Corvi committed
1256
   "id": "systematic-calibration",
1257
1258
1259
   "metadata": {},
   "outputs": [],
   "source": [
1260
    "def PM_run_cst(data, Psi_3_val, Psi_4_val,shape, gs_val = 1/70, compute_VPD = False):\n",
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
    "    \"\"\"run constant SR Penman Monteith mode but with VPD data instead of Ea and Es\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    T1_val: vector of the same size as the vectors in data, full of the value T1\n",
    "    T3_val: vector of the same size as the vectors in data, full of the value T3\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "\n",
    "    # Stress factor:\n",
1295
    "    FF_vec = stress_factor_func(Sws_val,Psi_3_val,Psi_4_val,shape)\n",
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
    "    \n",
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "    Ga_T = 1/Ra_T\n",
    "\n",
    "    # surface resistance:\n",
    "    Gs_C = gs_val*np.ones((Ta_val.size,)) # -> for constant resistance model -> Rs is constant and Ea = S(theta)*E_PM\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PM_cst = fPAR_val*FF_vec*PM_func(Fg_val,Fn_val,D_T,VPD_val,Ga_T, Gs_C) # R_s constant but stress factor in front of the PM evaluation\n",
    "    \n",
    "    Dic_var = {\"ga\":Ga_T, \"gs\":Gs_C, \"D_T\":D_T}\n",
    "    \n",
    "    return(PM_cst)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1320
   "id": "together-repository",
1321
1322
1323
1324
1325
1326
1327
1328
   "metadata": {},
   "source": [
    "### Benchmark Penman-Monteith model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
Oscar Corvi's avatar
Oscar Corvi committed
1329
   "id": "worse-launch",
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
   "metadata": {},
   "outputs": [],
   "source": [
    "def PM_run_classic(data, gs_val = 1/70, compute_VPD = False):\n",
    "    \"\"\"run classic PM model (only Rs as calibration parameter)\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    Rs_val: value of the SR\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "            \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "    Ga_T = 1/Ra_T\n",
    "\n",
    "    # surface resistance:\n",
    "    Gs_C = gs_val*np.ones((Ta_val.size,)) # -> for constant resistance model -> Rs is constant and Ea = S(theta)*E_PM\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PM_cst = fPAR_val*PM_func(Fg_val,Fn_val,D_T,VPD_val,Ga_T, Gs_C) # R_s constant but stress factor in front of the PM evaluation\n",
    "    \n",
    "    Dic_var = {\"ga\":Ga_T, \"gs\":Gs_C, \"D_T\":D_T}\n",
    "    \n",
    "    return(PM_cst)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1388
   "id": "closing-rally",
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
   "metadata": {},
   "source": [
    "### Modified version of the PM equation\n",
    "\n",
    "2 Sided PM evapotranspiration model from *Schymanski and Or, 2017* : \n",
    "\\begin{equation}\n",
    "E = \\frac{1}{\\lambda}\\frac{\\Delta (R_n - G) + c_p \\rho_a g_a a_{sh} VPD }{\\Delta + \\gamma \\left( 1+ \\frac{g_a}{g_s} \\right) \\frac{a_{sh}}{a_s}}\n",
    "\\end{equation}\n",
    "\n",
    "with $a_{sh}$ and $a_s$ the fraction of projected area exchanging sensible heat flux with the air and fractio of one sided-leaf area covered by stomatas respectively. In the case of amphistomateous leaves, $a_s = 2$ and $a_s = 1$ for hypostomateous leaves. For the Howard Spring site, we consider $a_s = 2$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
Oscar Corvi's avatar
Oscar Corvi committed
1404
   "id": "rational-improvement",
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
   "metadata": {},
   "outputs": [],
   "source": [
    "def PM_run_2var(data, Psi_3_val, Psi_4_val, gs_val = 1/70, compute_VPD = False):\n",
    "    \"\"\"run varying SR Penman Monteith model but with VPD data instead of Ea and Es\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    Psi_3_val: vector of the same size as the vectors in data, full of the value Psi_3\n",
    "    Psi_4_val: vector of the same size as the vectors in data, full of the value Psi_4\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "\n",
    "    # Stress factor:\n",
    "    FF_vec = stress_factor_func(Sws_val,Psi_3_val,Psi_4_val)\n",
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "    Ga_T = 2/Ra_T # multiply by 2 to account for the 2 sided exchange of latent heat flux\n",
    "\n",
    "    # surface resistance:\n",
    "    Gs_T = gs_val*FF_vec+0.0001\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PM_var = fPAR_val*PM_func(Fg_val,Fn_val,D_T,VPD_val,Ga_T, Gs_T) # R_s varying with theta\n",
    "    \n",
    "    Dic_var = {\"ga\":Ga_T, \"gs\":Gs_T, \"D_T\":D_T}\n",
    "    \n",
    "    return(PM_var)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
Oscar Corvi's avatar
Oscar Corvi committed
1468
   "id": "owned-degree",
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
   "metadata": {},
   "outputs": [],
   "source": [
    "def PM_run_2cst(data, Psi_3_val, Psi_4_val, gs_val = 1/70, compute_VPD = False):\n",
    "    \"\"\"run constant SR Penman Monteith mode but with VPD data instead of Ea and Es\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    T1_val: vector of the same size as the vectors in data, full of the value T1\n",
    "    T3_val: vector of the same size as the vectors in data, full of the value T3\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "\n",
    "    # Stress factor:\n",
    "    FF_vec = stress_factor_func(Sws_val,Psi_3_val,Psi_4_val)\n",
    "    \n",
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "    Ga_T = 2/Ra_T # multiply by 2 to account for the 2 sided exchange of latent heat flux\n",
    "\n",
    "    # surface resistance:\n",
    "    Gs_C = gs_val*np.ones((Ta_val.size,)) # -> for constant resistance model -> Rs is constant and Ea = S(theta)*E_PM\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PM_cst = fPAR_val*FF_vec*PM_func(Fg_val,Fn_val,D_T,VPD_val,Ga_T, Gs_C) # R_s constant but stress factor in front of the PM evaluation\n",
    "    \n",
    "    Dic_var = {\"ga\":Ga_T, \"gs\":Gs_C, \"D_T\":D_T}\n",
    "    \n",
    "    return(PM_cst)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1532
   "id": "helpful-painting",
1533
1534
1535
1536
1537
1538
1539
   "metadata": {},
   "source": [
    "### Priestley and Taylor model"
   ]
  },
  {
   "cell_type": "code",
1540
   "execution_count": 71,
Oscar Corvi's avatar
Oscar Corvi committed
1541
   "id": "applicable-dominant",
1542
1543
1544
   "metadata": {},
   "outputs": [],
   "source": [
1545
    "def PT_run(data,Psi_3_val, Psi_4_val, shape, alpha_val = 1.26, compute_VPD = False):\n",
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
    "    \"\"\"run classic PM model (only Rs as calibration parameter)\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    Rs_val: value of the SR\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    #Fe_val = data[\"Fe\"].to_numpy()\n",
    "    #Ws_val = data[\"Ws\"].to_numpy()\n",
    "    #Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    fPAR_val = data[\"fPAR\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "\n",
    "    # Stress factor:\n",
1578
    "    FF_vec = stress_factor_func(Sws_val,Psi_3_val,Psi_4_val, shape)\n",
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
    "    \n",
    "    # surface resistance:\n",
    "    Alpha_vec = alpha_val*np.ones((Ta_val.size,))\n",
    "\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    PT_mod = fPAR_val*FF_vec*PT_func(D_T,Fn_val,Fg_val,Alpha_vec)\n",
    "    \n",
    "    Dic_var = {\"D_T\":D_T}\n",
    "    \n",
    "    return(PT_mod)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1596
   "id": "sticky-necessity",
1597
1598
1599
1600
1601
1602
1603
1604
1605
   "metadata": {},
   "source": [
    "### Inverse modelling\n",
    "Compute the original $g_s$ time serie out of the data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
Oscar Corvi's avatar
Oscar Corvi committed
1606
   "id": "compressed-calgary",
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
   "metadata": {},
   "outputs": [],
   "source": [
    "def inv_PM_run(data, compute_VPD = False):\n",
    "    \"\"\"inverse modelling of the PM equation to derive time varying surface resistance\n",
    "    -----------------------------------\n",
    "    data: list containing the data /!\\ the data should be in a specific order : Data = [Ta, Fn, Fg, Sws, Fe, Ws, Ustar, Ta_min, Ta_max, RH_min, RH_max]\n",
    "    Rs_val: value of the SR\n",
    "    -----------------------------------\n",
    "    \"\"\"\n",
    "    \n",
    "    # unpack the variables\n",
    "    Ta_val = data[\"Ta\"].to_numpy()\n",
    "    Fn_val = data[\"Fn\"].to_numpy()\n",
    "    Fg_val = data[\"Fg\"].to_numpy()\n",
    "    Sws_val = data[\"Sws\"].to_numpy()\n",
    "    Fe_val = data[\"Fe\"].to_numpy()\n",
    "    Ws_val = data[\"Ws\"].to_numpy()\n",
    "    Ustar_val = data[\"ustar\"].to_numpy()\n",
    "    VPD_val = data[\"VPD\"].to_numpy()\n",
    "    \n",
    "    if compute_VPD:\n",
    "        T_min_val = data[\"Ta_min\"]\n",
    "        T_max_val = data[\"Ta_max\"]\n",
    "        \n",
    "        RH_min_val = data[\"RH_min\"]\n",
    "        RH_max_val = data[\"RH_max\"]\n",
    "        \n",
    "        VPD_val = eSat_func(T_min_val,T_max_val) - ea_func(T_min_val,T_max_val,RH_min_val,RH_max_val)\n",
    "        \n",
    "    # --------------------------\n",
    "    # derive the two Penman models\n",
    "    # --------------------------\n",
    "    \n",
    "    # aerodynamic resistance:\n",
    "    VH_T = VH_func(Ws_val,Ustar_val)\n",
    "    displ_T = d_func(VH_T)\n",
    "    ZOM_T = zom_func(VH_T)\n",
    "    ZOH_T = zoh_func(ZOM_T)\n",
    "    Ra_T = ra_func(ZOM_T, ZOH_T, displ_T, Ws_val)\n",
    "\n",
    "    # thermodynamic parameters\n",
    "    D_T = delta_func(Ta_val)\n",
    "\n",
    "    # compile the Ea values :\n",
    "    Gs_val = 1/Inv_PM_func(Fe_val,Fg_val,Fn_val,D_T,VPD_val,Ra_T) # R_s constant but stress factor in front of the PM evaluation\n",
    "    \n",
    "    \n",
    "    return(Gs_val)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1660
   "id": "intensive-return",
1661
1662
1663
1664
1665
1666
   "metadata": {},
   "source": [
    "## Calibration algorithm"
   ]
  },
  {
1667
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1668
   "id": "alternative-intranet",
1669
1670
   "metadata": {},
   "source": [
1671
1672
1673
1674
    "Use the global optimizer from the `scipy.optimize` package. Minimize the squared residual :\n",
    "\\begin{equation}\n",
    "\\Theta_{opt} = \\underset{\\theta_3, \\theta_4, g_s}{min} \\left( E_p(\\textbf{X}, \\theta_3, \\theta_4, g_s) - E_{obs})^2\\right)\n",
    "\\end{equation}"
1675
1676
1677
1678
   ]
  },
  {
   "cell_type": "code",
1679
   "execution_count": 33,
Oscar Corvi's avatar
Oscar Corvi committed
1680
   "id": "still-metadata",
1681
   "metadata": {},
1682
1683
   "outputs": [],
   "source": [
1684
    "# def calibration(Data,model_run,bounds_shape, bounds = [(0.1,1),(0.001,0.1)], compute_VPD = False, linear = False):\n",
1685
    "    \n",
1686
1687
    "#     if not linear:\n",
    "#         bounds.append(bounds_shape)\n",
1688
    "        \n",
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
    "#         if compute_VPD:\n",
    "#             def residual(Coeff):\n",
    "#                 return((model_run(Data, Coeff[0], Coeff[1],Coeff[2], compute_VPD = True)-Data[\"Fe\"])**2).sum()\n",
    "#         else:\n",
    "#             def residual(Coeff):\n",
    "#                 return((model_run(Data, Coeff[0], Coeff[1],Coeff[2])-Data[\"Fe\"])**2).sum()\n",
    "#     else : \n",
    "#         if compute_VPD:\n",
    "#             def residual(Coeff):\n",
    "#                 return((model_run(Data, Coeff[0], Coeff[1],0, compute_VPD = True)-Data[\"Fe\"])**2).sum()\n",
    "#         else:\n",
    "#             def residual(Coeff):\n",
    "#                 return((model_run(Data, Coeff[0], Coeff[1],0)-Data[\"Fe\"])**2).sum()\n",
    "            \n",
    "#     coeff_opti = optimize.shgo(residual, bounds).x\n",
    "#     return(coeff_opti)"
1705
1706
1707
1708
   ]
  },
  {
   "cell_type": "code",
1709
   "execution_count": 34,
Oscar Corvi's avatar
Oscar Corvi committed
1710
   "id": "floppy-rates",
1711
1712
1713
   "metadata": {},
   "outputs": [],
   "source": [
1714
1715
    "def calibration(Data,model_run, bounds = [(0.1,1),(0.001,0.1),(-50,50)], compute_VPD = False):\n",
    "      \n",
1716
1717
    "    if compute_VPD:\n",
    "        def residual(Coeff):\n",
1718
    "            return((model_run(Data, Coeff[0], Coeff[1],Coeff[2], compute_VPD = True)-Data[\"Fe\"])**2).sum()\n",
1719
1720
    "    else:\n",
    "        def residual(Coeff):\n",
1721
1722
    "            return((model_run(Data, Coeff[0], Coeff[1],Coeff[2])-Data[\"Fe\"])**2).sum()\n",
    "            \n",
1723
1724
1725
1726
1727
1728
    "    coeff_opti = optimize.shgo(residual, bounds).x\n",
    "    return(coeff_opti)"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1729
   "id": "sophisticated-canada",
1730
1731
1732
1733
1734
1735
1736
   "metadata": {},
   "source": [
    "# Part III - Experiments"
   ]
  },
  {
   "cell_type": "markdown",
Oscar Corvi's avatar
Oscar Corvi committed
1737
   "id": "straight-springfield",
1738
1739
1740
1741
1742
1743
1744
1745
   "metadata": {},
   "source": [
    "## One site, one year\n",
    "Data from Howard Springs for the sole year 2016"
   ]
  },
  {
   "cell_type": "code",
1746
   "execution_count": 35,
Oscar Corvi's avatar
Oscar Corvi committed
1747
   "id": "enclosed-client",
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
       "Dimensions:                (latitude: 1, longitude: 1, time: 315551)\n",
       "Coordinates:\n",
       "  * time                   (time) datetime64[ns] 2002-01-01T00:30:00 ... 2019...\n",
       "  * latitude               (latitude) float64 -12.5\n",
       "  * longitude              (longitude) float64 131.2\n",
       "Data variables: (12/143)\n",
       "    Ah                     (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    Ah_QCFlag              (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    Ah_HMP_23m             (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    Ah_HMP_23m_QCFlag      (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    Ah_HMP_2m              (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    Ah_HMP_2m_QCFlag       (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    ...                     ...\n",
       "    Ws_SONIC_Av_QCFlag     (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    ps                     (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    ps_QCFlag              (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    ustar                  (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    ustar_QCFlag           (time, latitude, longitude) float64 dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;\n",
       "    crs                    float64 -2.147e+09\n",
       "Attributes: (12/50)\n",
       "    BulkDensity:              1500\n",
       "    FgDepth:                  0.08\n",
       "    OrganicContent:           0.01\n",
       "    PythonVersion:            2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, ...\n",
       "    QC_version:               PyFluxPro V1.0.1\n",
       "    SwsDefault:               0.10\n",
       "    ...                       ...\n",
       "    title:                    Flux tower data set from the Howard Springs sit...\n",
       "    tower_height:             23m\n",
       "    vegetation:               Woody savanna\n",
       "    xl_datemode:              0\n",
       "    xl_filename:              E:/My Dropbox/Dropbox/Data_flux_data/Site data ...\n",
2137
       "    xl_moddatetime:           2020-01-21 11:59:06</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-db8e72e8-1a85-4afd-b59b-b5659ae716fc' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-db8e72e8-1a85-4afd-b59b-b5659ae716fc' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>latitude</span>: 1</li><li><span class='xr-has-index'>longitude</span>: 1</li><li><span class='xr-has-index'>time</span>: 315551</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-735bfdcc-d898-40ae-a85e-717456dcae99' class='xr-section-summary-in' type='checkbox'  checked><label for='section-735bfdcc-d898-40ae-a85e-717456dcae99' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2002-01-01T00:30:00 ... 2019-12-...</div><input id='attrs-e909b7a9-7c2f-479b-bb55-83517622b04a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e909b7a9-7c2f-479b-bb55-83517622b04a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d0b8dc36-860b-4692-8f23-a2018c91a183' class='xr-var-data-in' type='checkbox'><label for='data-d0b8dc36-860b-4692-8f23-a2018c91a183' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>time</dd><dt><span>standard_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2002-01-01T00:30:00.000000000&#x27;, &#x27;2002-01-01T01:00:00.000000000&#x27;,\n",
2138
2139
       "       &#x27;2002-01-01T01:30:00.000000000&#x27;, ..., &#x27;2019-12-31T22:30:00.000000000&#x27;,\n",
       "       &#x27;2019-12-31T23:00:00.000000000&#x27;, &#x27;2019-12-31T23:30:00.000000000&#x27;],\n",
2140
       "      dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>latitude</span></div><div class='xr-var-dims'>(latitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-12.5</div><input id='attrs-9022e8e3-06a4-425d-ab87-210967d6ee99' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9022e8e3-06a4-425d-ab87-210967d6ee99' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-aaa7138d-ff66-4f6c-afdb-28e8eaa1e488' class='xr-var-data-in' type='checkbox'><label for='data-aaa7138d-ff66-4f6c-afdb-28e8eaa1e488' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>latitude</dd><dt><span>standard_name :</span></dt><dd>latitude</dd><dt><span>units :</span></dt><dd>degrees north</dd></dl></div><div class='xr-var-data'><pre>array([-12.4952])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>longitude</span></div><div class='xr-var-dims'>(longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>131.2</div><input id='attrs-9828723a-5509-41a3-9e5b-d1115f61a91e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9828723a-5509-41a3-9e5b-d1115f61a91e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c2f44b3e-ad0c-444e-9e0a-b97da2b977fd' class='xr-var-data-in' type='checkbox'><label for='data-c2f44b3e-ad0c-444e-9e0a-b97da2b977fd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>longitude</dd><dt><span>standard_name :</span></dt><dd>longitude</dd><dt><span>units :</span></dt><dd>degrees east</dd></dl></div><div class='xr-var-data'><pre>array([131.15005])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-0897fbc6-a86a-4aa3-9bdc-3ddefe5be0cb' class='xr-section-summary-in' type='checkbox'  ><label for='section-0897fbc6-a86a-4aa3-9bdc-3ddefe5be0cb' class='xr-section-summary' >Data variables: <span>(143)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>Ah</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-b50521a1-e554-44e0-a79b-4e3cb2b2992e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-b50521a1-e554-44e0-a79b-4e3cb2b2992e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-cf1cb414-1cfd-4271-8aeb-70d72bb79512' class='xr-var-data-in' type='checkbox'><label for='data-cf1cb414-1cfd-4271-8aeb-70d72bb79512' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>85</dd><dt><span>coverage_L4 :</span></dt><dd>100</dd><dt><span>description_L4 :</span></dt><dd>Gap filled using aws, access, era5, </dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>23m</dd><dt><span>instrument :</span></dt><dd>HMP45C</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd></dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>g/m3</dd><dt><span>valid_range :</span></dt><dd>1,35</dd></dl></div><div class='xr-var-data'><table>\n",
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 4 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2198
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_QCFlag</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-14fc0145-1a54-4350-b220-b94aa799fdc7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-14fc0145-1a54-4350-b220-b94aa799fdc7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d93f7f28-75ab-4a5e-a2de-5384848a2cb1' class='xr-var-data-in' type='checkbox'><label for='data-d93f7f28-75ab-4a5e-a2de-5384848a2cb1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>AhQC flag</dd><dt><span>units :</span></dt><dd>none</dd></dl></div><div class='xr-var-data'><table>\n",
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 5 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2256
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_HMP_23m</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-48625366-2a03-49d1-9842-17550e29421f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-48625366-2a03-49d1-9842-17550e29421f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e80d11c5-746a-4d68-8fc5-f8cc61f4c0d2' class='xr-var-data-in' type='checkbox'><label for='data-e80d11c5-746a-4d68-8fc5-f8cc61f4c0d2' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>73</dd><dt><span>coverage_L4 :</span></dt><dd>73</dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>23m</dd><dt><span>instrument :</span></dt><dd>HMP45C</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd></dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>g/m3</dd><dt><span>valid_range :</span></dt><dd>5,30</dd></dl></div><div class='xr-var-data'><table>\n",
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 4 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2314
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_HMP_23m_QCFlag</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-0721c284-6c24-473a-b098-796bcdc64daa' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-0721c284-6c24-473a-b098-796bcdc64daa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ccfa0360-4c8e-497d-9f2a-d9030fdce828' class='xr-var-data-in' type='checkbox'><label for='data-ccfa0360-4c8e-497d-9f2a-d9030fdce828' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Ah_HMP_23mQC flag</dd><dt><span>units :</span></dt><dd>none</dd></dl></div><div class='xr-var-data'><table>\n",
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 5 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2372
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_HMP_2m</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-5ce38ae6-c50b-493f-8598-d6c403c3a2f1' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-5ce38ae6-c50b-493f-8598-d6c403c3a2f1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ac9960ae-e08c-4192-94e9-2f5c9bf45dfd' class='xr-var-data-in' type='checkbox'><label for='data-ac9960ae-e08c-4192-94e9-2f5c9bf45dfd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>66</dd><dt><span>coverage_L4 :</span></dt><dd>66</dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>2m</dd><dt><span>instrument :</span></dt><dd>HMP45C</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd></dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>g/m3</dd><dt><span>valid_range :</span></dt><dd>2,30</dd></dl></div><div class='xr-var-data'><table>\n",
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 4 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2430
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_HMP_2m_QCFlag</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-2f9719a6-5645-44d3-95e6-35a9c40b978a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-2f9719a6-5645-44d3-95e6-35a9c40b978a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-dde90926-c413-4960-848a-4e36d7bf2fc7' class='xr-var-data-in' type='checkbox'><label for='data-dde90926-c413-4960-848a-4e36d7bf2fc7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Ah_HMP_2mQC flag</dd><dt><span>units :</span></dt><dd>none</dd></dl></div><div class='xr-var-data'><table>\n",
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 5 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2488
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_IRGA_Av</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-9ac86f51-33b3-4ab0-96b2-973c5591d348' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9ac86f51-33b3-4ab0-96b2-973c5591d348' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ff39f65c-1702-4eff-96a7-8efa53e4806b' class='xr-var-data-in' type='checkbox'><label for='data-ff39f65c-1702-4eff-96a7-8efa53e4806b' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>76</dd><dt><span>coverage_L4 :</span></dt><dd>76</dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>23m</dd><dt><span>instrument :</span></dt><dd>Li-7500</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd></dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>g/m3</dd><dt><span>valid_range :</span></dt><dd>2,35</dd></dl></div><div class='xr-var-data'><table>\n",
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 4 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2546
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_IRGA_Av_QCFlag</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-9ceace67-bf97-4872-a0fc-7899afd2f06d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9ceace67-bf97-4872-a0fc-7899afd2f06d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8f5d830a-2c39-452f-87cc-693ea0f34125' class='xr-var-data-in' type='checkbox'><label for='data-8f5d830a-2c39-452f-87cc-693ea0f34125' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Ah_IRGA_AvQC flag</dd><dt><span>units :</span></dt><dd>none</dd></dl></div><div class='xr-var-data'><table>\n",
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 5 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2604
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_IRGA_Sd</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-09a3e34b-0137-4f0b-9443-a0ea8770194b' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-09a3e34b-0137-4f0b-9443-a0ea8770194b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-613190a7-216f-4456-b44d-1d659e13574e' class='xr-var-data-in' type='checkbox'><label for='data-613190a7-216f-4456-b44d-1d659e13574e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>84</dd><dt><span>coverage_L4 :</span></dt><dd>84</dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>not defined</dd><dt><span>instrument :</span></dt><dd>not defined</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd>not defined</dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>g/m3</dd><dt><span>valid_range :</span></dt><dd>0,20</dd></dl></div><div class='xr-var-data'><table>\n",
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 4 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2662
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_IRGA_Sd_QCFlag</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-64e7799c-0654-45e3-9984-3766003212c1' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-64e7799c-0654-45e3-9984-3766003212c1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0a3f67db-21ec-419f-83bc-ec5da93f9696' class='xr-var-data-in' type='checkbox'><label for='data-0a3f67db-21ec-419f-83bc-ec5da93f9696' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Ah_IRGA_SdQC flag</dd><dt><span>units :</span></dt><dd>none</dd></dl></div><div class='xr-var-data'><table>\n",
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
       "<tr>\n",
       "<td>\n",
       "<table>\n",
       "  <thead>\n",
       "    <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr><th> Bytes </th><td> 2.41 MiB </td> <td> 2.41 MiB </td></tr>\n",
       "    <tr><th> Shape </th><td> (315551, 1, 1) </td> <td> (315551, 1, 1) </td></tr>\n",
       "    <tr><th> Count </th><td> 5 Tasks </td><td> 1 Chunks </td></tr>\n",
       "    <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</td>\n",
       "<td>\n",
       "<svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Horizontal lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Vertical lines -->\n",
       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "  <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
       "\n",
       "  <!-- Colored Rectangle -->\n",
       "  <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
       "\n",
       "  <!-- Text -->\n",
       "  <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
       "  <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">1</text>\n",
       "  <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">315551</text>\n",
       "</svg>\n",
       "</td>\n",
       "</tr>\n",
2720
       "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Ah_IRGA_Vr</span></div><div class='xr-var-dims'>(time, latitude, longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(315551, 1, 1), meta=np.ndarray&gt;</div><input id='attrs-d7528b3d-76c9-4a55-944e-f37e07504569' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d7528b3d-76c9-4a55-944e-f37e07504569' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8353346a-79f3-4456-9b32-cd5b88e84eb9' class='xr-var-data-in' type='checkbox'><label for='data-8353346a-79f3-4456-9b32-cd5b88e84eb9' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>coverage_L3 :</span></dt><dd>82</dd><dt><span>coverage_L4 :</span></dt><dd>82</dd><dt><span>group_name :</span></dt><dd></dd><dt><span>height :</span></dt><dd>23m</dd><dt><span>instrument :</span></dt><dd>Li-7500</dd><dt><span>long_name :</span></dt><dd>Absolute humidity</dd><dt><span>serial_number :</span></dt><dd></dd><dt><span>standard_name :</span></dt><dd>not defined</dd><dt><span>units :</span></dt><dd>(g/m3)2</dd><dt><span>valid_range :</span></dt><dd>0,400</dd></dl></div><div class='xr-var-data'><table>\n",
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757