Commit a2d5ec86 authored by Oscar Corvi's avatar Oscar Corvi
Browse files

fix error in meaning_stress_factor.ipynb

parent 78e5f7d5
Pipeline #229788 passed with stage
in 18 seconds
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "prescribed-telescope",
"id": "antique-winter",
"metadata": {},
"source": [
"# **Location of the stress factor in potential evapo-transpiration models**"
......@@ -10,7 +10,7 @@
},
{
"cell_type": "markdown",
"id": "typical-catholic",
"id": "under-marathon",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -44,7 +44,7 @@
},
{
"cell_type": "markdown",
"id": "macro-action",
"id": "improving-functionality",
"metadata": {},
"source": [
"# Part II - Functions set up"
......@@ -52,7 +52,7 @@
},
{
"cell_type": "markdown",
"id": "elect-declaration",
"id": "ready-monkey",
"metadata": {},
"source": [
"## Importing relevant packages"
......@@ -61,7 +61,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "dental-movie",
"id": "prime-techno",
"metadata": {},
"outputs": [
{
......@@ -127,7 +127,7 @@
},
{
"cell_type": "markdown",
"id": "minus-validity",
"id": "similar-artwork",
"metadata": {},
"source": [
"## Path of the different files (pre-defined python functions, sympy equations, sympy variables)"
......@@ -136,7 +136,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "desperate-appraisal",
"id": "essential-explanation",
"metadata": {
"tags": [
"parameters"
......@@ -157,7 +157,7 @@
},
{
"cell_type": "markdown",
"id": "indian-springer",
"id": "indian-greek",
"metadata": {},
"source": [
"## Importing the sympy variables and equations defined in the theory.ipynb notebook"
......@@ -166,7 +166,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "differential-wiring",
"id": "affected-shark",
"metadata": {},
"outputs": [
{
......@@ -263,7 +263,7 @@
},
{
"cell_type": "markdown",
"id": "brief-insertion",
"id": "disabled-closure",
"metadata": {},
"source": [
"## Importing the performance assessment functions defined in the analysis_function.py file"
......@@ -272,7 +272,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "fifteen-board",
"id": "elect-scratch",
"metadata": {},
"outputs": [
{
......@@ -322,7 +322,7 @@
},
{
"cell_type": "markdown",
"id": "eligible-mountain",
"id": "refined-international",
"metadata": {},
"source": [
"## Data import, preprocess and shape for the computations"
......@@ -330,7 +330,7 @@
},
{
"cell_type": "markdown",
"id": "similar-color",
"id": "commercial-bidder",
"metadata": {},
"source": [
"### Get the different files where data are stored\n",
......@@ -341,7 +341,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "chicken-frame",
"id": "statutory-brief",
"metadata": {},
"outputs": [
{
......@@ -371,7 +371,7 @@
},
{
"cell_type": "markdown",
"id": "handled-remark",
"id": "missing-penguin",
"metadata": {},
"source": [
"### Define and test a function that process the fPAR data\n",
......@@ -381,12 +381,10 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "alternative-theology",
"id": "floating-coating",
"metadata": {},
"outputs": [],
"source": [
"dates_fPAR = '../../../data/fpar_howard_spring/dates_v5'\n",
"\n",
"def fPAR_data_process(fPAR_file,dates_fPAR):\n",
" \n",
" fparv5_dates = np.genfromtxt(dates_fPAR, dtype='str', delimiter=',')\n",
......@@ -422,7 +420,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "perfect-france",
"id": "strategic-hierarchy",
"metadata": {},
"outputs": [
{
......@@ -548,7 +546,7 @@
},
{
"cell_type": "markdown",
"id": "changing-registrar",
"id": "iraqi-regard",
"metadata": {},
"source": [
"### fPARSet function\n",
......@@ -558,7 +556,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "driven-repair",
"id": "equivalent-trout",
"metadata": {},
"outputs": [],
"source": [
......@@ -589,7 +587,7 @@
},
{
"cell_type": "markdown",
"id": "confused-korea",
"id": "lucky-bruce",
"metadata": {},
"source": [
"### DataChose function\n",
......@@ -610,7 +608,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "subjective-costume",
"id": "subsequent-mystery",
"metadata": {},
"outputs": [],
"source": [
......@@ -680,7 +678,7 @@
},
{
"cell_type": "markdown",
"id": "tender-adrian",
"id": "constitutional-malawi",
"metadata": {},
"source": [
"## Compile the different functions defined in the symbolic domain\n",
......@@ -689,7 +687,7 @@
},
{
"cell_type": "markdown",
"id": "powered-psychiatry",
"id": "million-grill",
"metadata": {},
"source": [
"### Water stress functions"
......@@ -698,7 +696,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "incorporated-scanner",
"id": "spiritual-delhi",
"metadata": {},
"outputs": [],
"source": [
......@@ -719,7 +717,7 @@
},
{
"cell_type": "markdown",
"id": "painful-player",
"id": "psychological-simulation",
"metadata": {},
"source": [
"### Soil water potential"
......@@ -728,7 +726,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "offshore-contamination",
"id": "subsequent-bulgaria",
"metadata": {},
"outputs": [],
"source": [
......@@ -744,7 +742,7 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "better-strength",
"id": "wireless-radical",
"metadata": {},
"outputs": [],
"source": [
......@@ -761,7 +759,7 @@
},
{
"cell_type": "markdown",
"id": "eleven-stage",
"id": "legendary-psychology",
"metadata": {},
"source": [
"### Penman-Monteith"
......@@ -770,7 +768,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "embedded-straight",
"id": "affecting-young",
"metadata": {},
"outputs": [],
"source": [
......@@ -789,7 +787,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "hollywood-wound",
"id": "formed-memorial",
"metadata": {},
"outputs": [],
"source": [
......@@ -817,7 +815,7 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "animal-immunology",
"id": "continuous-translation",
"metadata": {},
"outputs": [],
"source": [
......@@ -839,7 +837,7 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "average-glossary",
"id": "intimate-pickup",
"metadata": {},
"outputs": [],
"source": [
......@@ -861,7 +859,7 @@
{
"cell_type": "code",
"execution_count": 17,
"id": "fundamental-yorkshire",
"id": "becoming-language",
"metadata": {},
"outputs": [],
"source": [
......@@ -883,7 +881,7 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "divided-drama",
"id": "premium-inquiry",
"metadata": {},
"outputs": [],
"source": [
......@@ -911,7 +909,7 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "inner-intelligence",
"id": "interested-bowling",
"metadata": {},
"outputs": [],
"source": [
......@@ -945,7 +943,7 @@
{
"cell_type": "code",
"execution_count": 20,
"id": "inner-tennis",
"id": "reverse-pierce",
"metadata": {},
"outputs": [],
"source": [
......@@ -968,7 +966,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "willing-flash",
"id": "rational-current",
"metadata": {},
"outputs": [],
"source": [
......@@ -986,7 +984,7 @@
},
{
"cell_type": "markdown",
"id": "controversial-barcelona",
"id": "thermal-ownership",
"metadata": {},
"source": [
"### Assign the different compiled functions to variables functions (create the functions in python)"
......@@ -995,7 +993,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "weekly-programmer",
"id": "received-letter",
"metadata": {},
"outputs": [],
"source": [
......@@ -1021,7 +1019,7 @@
{
"cell_type": "code",
"execution_count": 23,
"id": "turned-pixel",
"id": "behavioral-executive",
"metadata": {},
"outputs": [],
"source": [
......@@ -1050,7 +1048,7 @@
},
{
"cell_type": "markdown",
"id": "identical-depth",
"id": "frank-exhibit",
"metadata": {},
"source": [
"## Functions to run the different models\n",
......@@ -1059,7 +1057,7 @@
},
{
"cell_type": "markdown",
"id": "proved-secret",
"id": "industrial-lawrence",
"metadata": {},
"source": [
"### Varying surface resistance model"
......@@ -1068,7 +1066,7 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "connected-dress",
"id": "musical-ebony",
"metadata": {},
"outputs": [],
"source": [
......@@ -1123,7 +1121,7 @@
},
{
"cell_type": "markdown",
"id": "built-honduras",
"id": "distant-zoning",
"metadata": {},
"source": [
"### Constant surface conductance model"
......@@ -1132,7 +1130,7 @@
{
"cell_type": "code",
"execution_count": 25,
"id": "possible-drove",
"id": "north-health",
"metadata": {},
"outputs": [],
"source": [
......@@ -1189,7 +1187,7 @@
{
"cell_type": "code",
"execution_count": 26,
"id": "tamil-sapphire",
"id": "whole-weather",
"metadata": {},
"outputs": [],
"source": [
......@@ -1245,7 +1243,7 @@
},
{
"cell_type": "markdown",
"id": "baking-string",
"id": "sixth-rouge",
"metadata": {},
"source": [
"### Benchmark Penman-Monteith model"
......@@ -1254,7 +1252,7 @@
{
"cell_type": "code",
"execution_count": 27,
"id": "varied-philip",
"id": "greek-edmonton",
"metadata": {},
"outputs": [],
"source": [
......@@ -1305,7 +1303,7 @@
{
"cell_type": "code",
"execution_count": 28,
"id": "genuine-vehicle",
"id": "greenhouse-camcorder",
"metadata": {},
"outputs": [],
"source": [
......@@ -1355,7 +1353,7 @@
},
{
"cell_type": "markdown",
"id": "composed-america",
"id": "changed-display",
"metadata": {},
"source": [
"### Modified version of the PM equation\n",
......@@ -1371,7 +1369,7 @@
{
"cell_type": "code",
"execution_count": 29,
"id": "better-leeds",
"id": "difficult-standing",
"metadata": {},
"outputs": [],
"source": [
......@@ -1427,7 +1425,7 @@
{
"cell_type": "code",
"execution_count": 30,
"id": "adjustable-granny",
"id": "general-courtesy",
"metadata": {},
"outputs": [],
"source": [
......@@ -1483,7 +1481,7 @@
},
{
"cell_type": "markdown",
"id": "trying-attempt",
"id": "equal-desert",
"metadata": {},
"source": [
"### Priestley and Taylor model"
......@@ -1492,7 +1490,7 @@
{
"cell_type": "code",
"execution_count": 31,
"id": "independent-sword",
"id": "configured-edward",
"metadata": {},
"outputs": [],
"source": [
......@@ -1538,7 +1536,7 @@
},
{
"cell_type": "markdown",
"id": "acute-drive",
"id": "prostate-performer",
"metadata": {},
"source": [
"### Inverse modelling\n",
......@@ -1548,7 +1546,7 @@
{
"cell_type": "code",
"execution_count": 32,
"id": "worst-boulder",
"id": "occasional-tenant",
"metadata": {},
"outputs": [],
"source": [
......@@ -1593,7 +1591,7 @@
},
{
"cell_type": "markdown",
"id": "light-sculpture",
"id": "rocky-differential",
"metadata": {},
"source": [
"## Calibration algorithm"
......@@ -1602,7 +1600,7 @@
{
"cell_type": "code",
"execution_count": 33,
"id": "opponent-brisbane",
"id": "twelve-birth",
"metadata": {},
"outputs": [],
"source": [
......@@ -1624,7 +1622,7 @@
{
"cell_type": "code",
"execution_count": 34,
"id": "changing-medicine",
"id": "facial-stanley",
"metadata": {
"jupyter": {
"source_hidden": true
......@@ -1759,7 +1757,7 @@
},
{
"cell_type": "markdown",
"id": "sunset-resistance",
"id": "listed-squad",
"metadata": {},
"source": [
"Use the global optimizer from the `scipy.optimize` package. Minimize the squared residual :\n",
......@@ -1771,7 +1769,7 @@
{
"cell_type": "code",
"execution_count": 35,
"id": "spectacular-possession",
"id": "violent-establishment",
"metadata": {},
"outputs": [],
"source": [
......@@ -1787,7 +1785,7 @@
},
{
"cell_type": "markdown",
"id": "hundred-hostel",
"id": "studied-constitutional",
"metadata": {},
"source": [
"# Part III - Experiments"
......@@ -1795,7 +1793,7 @@
},
{
"cell_type": "markdown",
"id": "accurate-finding",
"id": "continental-smooth",
"metadata": {},
"source": [
"## Reconstructing the artificial stress factor\n",
......@@ -1815,7 +1813,7 @@
},
{
"cell_type": "markdown",
"id": "forward-sixth",
"id": "current-improvement",
"metadata": {},
"source": [
"#### Use the data from Howard Spring, year 2016"
......@@ -1824,7 +1822,7 @@
{
"cell_type": "code",
"execution_count": 36,
"id": "impaired-diabetes",
"id": "informative-glance",
"metadata": {},
"outputs": [],
"source": [
......@@ -1839,7 +1837,7 @@
{
"cell_type": "code",
"execution_count": 37,
"id": "prostate-january",
"id": "connected-catalyst",
"metadata": {},
"outputs": [
{
......@@ -2252,7 +2250,7 @@
},
{
"cell_type": "markdown",
"id": "funky-federal",
"id": "prime-today",
"metadata": {},
"source": [
"#### Calibrate the constant surface conductance model"
......@@ -2261,7 +2259,7 @@
{
"cell_type": "code",
"execution_count": 38,
"id": "american-product",
"id": "stuffed-civilian",
"metadata": {},
"outputs": [
{
......@@ -2282,7 +2280,7 @@
},
{
"cell_type": "markdown",
"id": "organizational-genetics",
"id": "bizarre-notification",
"metadata": {},
"source": [
"#### Run the classic model and compute the \"natural\" stress factor"
......@@ -2291,7 +2289,7 @@
{
"cell_type": "code",
"execution_count": 39,
"id": "spread-season",
"id": "noticed-second",
"metadata": {},
"outputs": [],
"source": [
......@@ -2302,7 +2300,7 @@
},
{
"cell_type": "markdown",
"id": "strategic-friendship",
"id": "willing-denmark",
"metadata": {},
"source": [
"#### Run the constant $g_s$ model and compute the \"artificial stress factor "
......@@ -2311,7 +2309,7 @@
{
"cell_type": "code",
"execution_count": 40,
"id": "experimental-afghanistan",
"id": "polar-nicaragua",
"metadata": {},
"outputs": [],
"source": [
......@@ -2322,7 +2320,7 @@
},
{
"cell_type": "markdown",
"id": "little-decrease",
"id": "continuous-queensland",
"metadata": {},
"source": [
"#### Plot the results"
......@@ -2331,7 +2329,7 @@
{
"cell_type": "code",
"execution_count": 41,
"id": "blond-copper",
"id": "honey-bones",
"metadata": {},
"outputs": [
{
......@@ -2368,7 +2366,7 @@
{
"cell_type": "code",
"execution_count": 42,
"id": "weekly-hours",
"id": "related-checklist",