-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7424f6
commit 589dbf9
Showing
6 changed files
with
255 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8159acc0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from shapely.geometry import Point\n", | ||
"import random\n", | ||
"\n", | ||
"x1, y1, x2, y2 = Doñana.get('Asc').gdf.total_bounds\n", | ||
"\n", | ||
"random_point = lambda x1, y1, x2, y2 : Point(random.uniform(x1, x2), random.uniform(y1, y2))\n", | ||
"\n", | ||
"# Definición de la base de datos (pandas.DataFrame):\n", | ||
"columns, values = [i for i in 'ABCDE'], [np.random.random(60) for i in range(5)]\n", | ||
"df_table = {i:j for i,j in zip(columns, values)}\n", | ||
"df = pd.DataFrame(df_table, index=pd.date_range(start='2015', end='2020', freq='M'))\n", | ||
"df = df.melt(var_name='Nombre', value_name='Valores', ignore_index=False)\n", | ||
"df.index.name = 'Fechas'\n", | ||
"df.reset_index(inplace=True)\n", | ||
"\n", | ||
"# Definición de un archivo espacial\n", | ||
"table = {'Nombre':[i for i in 'ABCDE'],\n", | ||
" 'geometry':[random_point(x1, y1, x2, y2) for i in range(5)]}\n", | ||
"gdf = gpd.GeoDataFrame(table, crs=25830)\n", | ||
"\n", | ||
"gps = dinsar.DataBase(df, name='gps', units='cm', color='black')\n", | ||
"gps.append_geometry(gdf)\n", | ||
"Doñana.append(gps)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0604ed54", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import dinsar\n", | ||
"\n", | ||
"# Para centrar las gráficas salientes en un notebook de Jupyter.\n", | ||
"from IPython.core.display import HTML\n", | ||
"HTML(\"\"\"<style>.output_png {display: table-cell; text-align: center; vertical-align: middle;}</style>\"\"\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "37fef053", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
" # Cojo los cinco primeros PS del Dataset 'Ascending' (dessde fuera del modelo ) y calculo su deformación promedio\n", | ||
"ps = Asc.ps[0:5] \n", | ||
"Asc.subset(ps).plot(plot_average=True)\n", | ||
"\n", | ||
"# Cojo el primer piezómetro de la base de datos de piezometría y ploteo su serie temporal\n", | ||
"piezo = bbdd.piezos[0]\n", | ||
"bbdd.plot(piezo)\n", | ||
"\n", | ||
"# A través del método 'take' accedo al array con su serie tempral: --> bbdd.take(piezo)\n", | ||
"\n", | ||
"# Selecciono la estación de Almonte y ploteo su serie temporal según su desviación acumulada\n", | ||
"# Puedo ver qué estaciones hay en la base de datos así: --> precipi.estaciones\n", | ||
"precipi.plot('Almonte', values='dsv')\n", | ||
"\n", | ||
"precipi.estaciones" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |