In [1]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os for dirname, _, filenames in os.walk('/kaggle/input'): #/input for filename in filenames: print(os.path.join(dirname, filename)) continueos.listdir('/kaggle/input/') # You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All" # You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current sessionprint(os.listdir("../input"))
In [4]:
import os 
inputFolder = '../input/' 
for root, directories, filenames in os.walk(inputFolder): 
    for filename in filenames: print(os.path.join(root,filename))
../input/rivers/The-River-Sieve-catchment-and-the-location-of-the-different-gauges.png
../input/rivers/Schematic-representation-of-the-proposed-methodology-1-Subdivision-of-the-three.png
../input/rivers/Figure Surface watergroundwater interactions.jpg
../input/rivers/capodacqua-in-val-canneto.jpg
../input/rivers/The-Petrignano-dAssisi-plain-Grey-areas-alluvial-deposits-White-areas-lacustrine-and.png
../input/rivers/ChiascioBastiaUmbra.JPG
In [2]:
from urllib import request
from itertools import product
import pickle
#import tslearn
import scipy.stats as ss

%matplotlib inline
import matplotlib.pyplot as plt
from IPython.display import HTML
import seaborn as sns

!pip install pastas

In [4]:
from IPython.display import Image, display
%config InlineBackend.figure_format = 'retina';
from IPython.core.display import display, HTML
display(HTML("<style>.container {width:70% !important;}</style>"))
imC= Image(url="http://vanoproy.be/css/ChiascioBastiaUmbra.JPG",width=500 ) # filename="/kaggle/input/rivers/ChiascioBastiaUmbra.JPG",
imGWI= Image(url="http://vanoproy.be/python/figs/Figure Surface watergroundwater interactions.jpg", width=600)
#imPUA= Image(filename="/kaggle/input/unconfined/pumped-unconfined-aquifer.jpg", width=600)

Petrignano Aquifer

Published studies on this topic:

  1. On the variables to be considered in assessing the impact of climatechange to alluvial aquifers: a case study in central Italy. (2013), E. Romano, S. Camici, L. Brocca, T. Moramarco, F. Pica, E. Preziosi
  2. The Sustainable Pumping Rate Concept: Lessons from a Case Study in Central Italy. (2009) Emanuele Romano, Elisabetta Preziosi, Italian National Research Council.

The-Petrignano-dAssisi-plain-Grey-areas-alluvial-deposits

In [5]:
petrignano=pd.read_csv(r"http://vanoproy.be/css/Aquifer_Petrignano.csv", sep=",", engine='python', encoding="UTF-8")# "
petrignano#.head(10) 
Out[5]:
Date Rainfall_Bastia_Umbra Depth_to_Groundwater_P24 Depth_to_Groundwater_P25 Temperature_Bastia_Umbra Temperature_Petrignano Volume_C10_Petrignano Hydrometry_Fiume_Chiascio_Petrignano
0 14/03/2006 NaN -22.48 -22.18 NaN NaN NaN NaN
1 15/03/2006 NaN -22.38 -22.14 NaN NaN NaN NaN
2 16/03/2006 NaN -22.25 -22.04 NaN NaN NaN NaN
3 17/03/2006 NaN -22.38 -22.04 NaN NaN NaN NaN
4 18/03/2006 NaN -22.60 -22.04 NaN NaN NaN NaN
... ... ... ... ... ... ... ... ...
5218 26/06/2020 0.0 -25.68 -25.07 25.7 24.5 -29930.688 2.5
5219 27/06/2020 0.0 -25.80 -25.11 26.2 25.0 -31332.960 2.4
5220 28/06/2020 0.0 -25.80 -25.19 26.9 25.7 -32120.928 2.4
5221 29/06/2020 0.0 -25.78 -25.18 26.9 26.0 -30602.880 2.4
5222 30/06/2020 0.0 -25.91 -25.25 27.3 26.5 -31878.144 2.4

5223 rows × 8 columns

In [6]:
petrignano["Date"] = pd.to_datetime( petrignano.Date, format='%d/%m/%Y' ) # euro dates
petrignano= petrignano.set_index("Date", inplace=False)
In [8]:
petrignano.head(6) 
Out[8]:
Rainfall_Bastia_Umbra Depth_to_Groundwater_P24 Depth_to_Groundwater_P25 Temperature_Bastia_Umbra Temperature_Petrignano Volume_C10_Petrignano Hydrometry_Fiume_Chiascio_Petrignano
Date
2006-03-14 NaN -22.48 -22.18 NaN NaN NaN NaN
2006-03-15 NaN -22.38 -22.14 NaN NaN NaN NaN
2006-03-16 NaN -22.25 -22.04 NaN NaN NaN NaN
2006-03-17 NaN -22.38 -22.04 NaN NaN NaN NaN
2006-03-18 NaN -22.60 -22.04 NaN NaN NaN NaN
2006-03-19 NaN -22.35 -21.95 NaN NaN NaN NaN
In [ ]:
petrignano.info()
In [9]:
dfp =petrignano.rename(columns={'Rainfall_Bastia_Umbra':'Rain_Bastia','Depth_to_Groundwater_P24':'Depth_to_P24','Depth_to_Groundwater_P25':'Depth_to_P25', 
                   'Temperature_Bastia_Umbra':'Temp_Bastia', 'Temperature_Petrignano':'Temp_Petrig',"Volume_C10_Petrignano":"Volume_C10",
                   "Hydrometry_Fiume_Chiascio_Petrignano": "Hydrometry"})
dfp 
Out[9]:
Rain_Bastia Depth_to_P24 Depth_to_P25 Temp_Bastia Temp_Petrig Volume_C10 Hydrometry
Date
2006-03-14 NaN -22.48 -22.18 NaN NaN NaN NaN
2006-03-15 NaN -22.38 -22.14 NaN NaN NaN NaN
2006-03-16 NaN -22.25 -22.04 NaN NaN NaN NaN
2006-03-17 NaN -22.38 -22.04 NaN NaN NaN NaN
2006-03-18 NaN -22.60 -22.04 NaN NaN NaN NaN
... ... ... ... ... ... ... ...
2020-06-26 0.0 -25.68 -25.07 25.7 24.5 -29930.688 2.5
2020-06-27 0.0 -25.80 -25.11 26.2 25.0 -31332.960 2.4
2020-06-28 0.0 -25.80 -25.19 26.9 25.7 -32120.928 2.4
2020-06-29 0.0 -25.78 -25.18 26.9 26.0 -30602.880 2.4
2020-06-30 0.0 -25.91 -25.25 27.3 26.5 -31878.144 2.4

5223 rows × 7 columns

In [10]:
sns.set_style("whitegrid", {'grid.linestyle': '--'})
fig, ax = plt.subplots(4,1,  figsize=(21, 9), sharex=True) #, squeeze=False  

sns.lineplot(x="Date", y= petrignano["Rainfall_Bastia_Umbra"],data=petrignano, ax=ax[0])
sns.lineplot(x="Date", y= petrignano["Depth_to_Groundwater_P24"], data=petrignano, ax=ax[1]) # ax=ax
sns.lineplot(x="Date", y= petrignano["Depth_to_Groundwater_P25"], data=petrignano, ax=ax[2]) # ax=ax 
sns.lineplot(x="Date", y= petrignano["Hydrometry_Fiume_Chiascio_Petrignano"], data=petrignano, ax=ax[3]) # ax=ax 
plt.xticks(rotation=90); plt.grid(b=True,) #axe.setxaxis(rotation=90)
plt.xlim(pd.to_datetime( "2010-01-01" ),pd.to_datetime("2020-02-01" ) ); 
In [80]:
sns.set_style("whitegrid", {'grid.linestyle': '--'})
fig, ax = plt.subplots(4,1,  figsize=(21, 9), sharex=True) #, squeeze=False  

sns.lineplot(x="Date", y= petrignano["Rainfall_Bastia_Umbra"],data=petrignano, ax=ax[0])
sns.lineplot(x="Date", y= petrignano["Depth_to_Groundwater_P25"], data=petrignano, ax=ax[1]) # ax=ax
sns.lineplot(x="Date", y= petrignano["Temperature_Petrignano"], data=petrignano, ax=ax[2]) # ax=ax 
sns.lineplot(x="Date", y= petrignano["Hydrometry_Fiume_Chiascio_Petrignano"], data=petrignano, ax=ax[3]) # ax=ax 

plt.xticks(rotation=90); plt.grid(b=True,) #axe.setxaxis(rotation=90)
plt.xlim(pd.to_datetime( "2012-01-01" ),pd.to_datetime("2015-02-01" ) ); 
In [81]:
sns.set_style("whitegrid", {'grid.linestyle': '--'})
fig, ax = plt.subplots(4,1, figsize=(21, 9), sharex=True) #, squeeze=False  

sns.lineplot(x="Date", y= petrignano["Rainfall_Bastia_Umbra"],data=petrignano, ax=ax[0])
sns.lineplot(x="Date", y= petrignano["Depth_to_Groundwater_P24"], data=petrignano, ax=ax[1]); plt.ylim(-30,-25) # ax=ax
sns.lineplot(x="Date", y= petrignano["Temperature_Petrignano"], data=petrignano, ax=ax[2]); plt.ylim(0,4)# ax=ax 
sns.lineplot(x="Date", y= petrignano["Hydrometry_Fiume_Chiascio_Petrignano"], data=petrignano, ax=ax[3]);plt.ylim(0,4) # ax=ax 

plt.xticks(rotation=90); plt.grid(b=True,) #axe.setxaxis(rotation=90)
plt.xlim(pd.to_datetime( "2018-11-01" ),pd.to_datetime("2019-04-01" ) ); 
In [12]:
sns.set_style("whitegrid", {'grid.linestyle': '--'})
fig, ax = plt.subplots(2,1,  figsize=(21, 9), sharex=True) #, squeeze=False  

sns.lineplot(x="Date", y= dfp["Depth_to_P24"],data=dfp, ax=ax[0])
sns.lineplot(x="Date", y= dfp["Depth_to_P25"],data=dfp, ax=ax[0],color="forestgreen") # ax=ax
sns.lineplot(x="Date", y= dfp["Volume_C10"], data=dfp, ax=ax[1] ,color="olivedrab") # ax=ax 

plt.xticks(rotation=90); plt.grid(b=True,) #
plt.xlim(pd.to_datetime( "2006-09-19" ),pd.to_datetime("2007-09-01" ) );