Skip to content

Commit

Permalink
ending Creating a Model tutorital
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelonGonzalez committed Mar 1, 2022
1 parent 88eac1a commit 96c46c0
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 174 deletions.
192 changes: 50 additions & 142 deletions examples/Creating a dinsar model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 1,
"id": "c05a8e53",
"metadata": {},
"outputs": [],
Expand All @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 2,
"id": "b208c1e9",
"metadata": {
"scrolled": true
Expand All @@ -70,7 +70,7 @@
"- Prime Meridian: Greenwich"
]
},
"execution_count": 20,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -88,21 +88,24 @@
"\n",
"Once the Model of the zone has been created, the next operation to be performed is the definition of the **parts** that will compose it. There are four possible types of parts, each one of them being a different object, and being intensively explained in its documentation. Example: see `Dataset?`.\n",
"\n",
" . Dataset\n",
" . Piezometria\n",
" . Precipitacion\n",
" . DataBase\n",
"- `Dataset`\n",
"\n",
"- `Piezometria`\n",
"\n",
"- `Precipitacion`\n",
"\n",
"- `DataBase`\n",
"\n",
"While the `Dataset` class hosts a DInSAR dataset, the rest of the classes represent databases, which may have associated spatial information. Among the latter, `Piezometria` and `Precipitacion` are specially designed to host piezometric and pluviometric databases, respectively, with data of any other nature being introduced through the `DataBase` class.\n",
"\n",
"As many parts as desired can be defined and added to the model, requiring in the instantialization of each of them the path to the file location, as well as the name with which they will be referred to, the color with which their content will be displayed or other options (see **kwargs of each function).\n",
"As many parts as desired can be defined and added to the model, requiring in the instantialization of each of them the path to the file location, as well as the name with which they will be referred to, the color with which their content will be displayed or other options (see \\*\\*kwargs of each function).\n",
"\n",
"### DInSAR datasets definition: "
]
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 3,
"id": "15e320f1",
"metadata": {},
"outputs": [],
Expand All @@ -126,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 4,
"id": "ed2e17e0",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -180,7 +183,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 5,
"id": "bd92e051",
"metadata": {},
"outputs": [
Expand All @@ -190,7 +193,7 @@
"[None, None, None, None]"
]
},
"execution_count": 26,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -206,28 +209,9 @@
"id": "d93bd9c2",
"metadata": {},
"source": [
"The creation of this **example model** can also be done **quickly** in the following way, which will be used in the rest of the tutorials, as well as in the code examples:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "462d0581",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Geometría añadida correctamente.\n",
"Geometría añadida correctamente.\n"
]
}
],
"source": [
"Doñana = dinsar.example.get_model()"
"The creation of this **example model** can also be done **quickly** in the following way, which will be used in the rest of the tutorials, as well as in the code examples:\n",
"\n",
"> `Doñana = dinsar.example.get_model()`"
]
},
{
Expand All @@ -240,132 +224,56 @@
"For the rest of the databases (`Piezometria`, `Precipitacion` and `DataBase`) it is indifferent to do it one way or another. Example:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "7b0f4f51",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Asc != Doñana.get('Asc')"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "89bf498c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"piezo == Doñana.get('Piezo_bbdd')"
]
},
{
"cell_type": "markdown",
"id": "6a666bb5",
"metadata": {},
"source": [
"## Acceder a otras cosa del modelo"
"## 4. Accesing model information"
]
},
{
"cell_type": "markdown",
"id": "70be874f",
"metadata": {},
"source": [
"## Funcionalidades varias:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "12e4fe0b",
"metadata": {},
"outputs": [],
"source": [
"Doñana.study(2).plot() # Plotear las series temporales del agregado 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f1aa16cd",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"Doñana.study(2).mapa() # Representar espacialmente el agregado 2 y sus PS."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "61066afc",
"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)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "54306d5f",
"id": "a482f089",
"metadata": {},
"outputs": [],
"source": [
"# 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",
"The following methods allow acces to **model features**:\n",
"\n",
"# A través del método 'take' accedo al array con su serie tempral: --> bbdd.take(piezo)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "53466412",
"metadata": {},
"outputs": [],
"source": [
"# 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')"
"- `agregados` Returns a list with the model aggregates.\n",
"\n",
"- `datasets` Returns a list with the model DInSAR datasets.\n",
"\n",
"- `piezo_bds` Returns a list with the model piezometry databases.\n",
"\n",
"- `precipi_bds` Returns a list with the model rainfall databases.\n",
"\n",
"- `other_bds` Returns a list with the model databases of other nature.\n",
"\n",
"It is also possible to print all model information through `info` method."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f289bbb",
"execution_count": 6,
"id": "e70031cd",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
". \u001b[1mA-DInSAR datasets\u001b[0m: Asc, Desc\n",
". \u001b[1mBd Piezometría\u001b[0m: Piezo_bbdd\n",
". \u001b[1mBd Precipitación\u001b[0m: P\n",
". \u001b[1mOtras Bd\u001b[0m: \n",
". \u001b[1mNº Agregados\u001b[0m: 5\n",
". Sistema de Referencia de Coordenadas del Proyecto' (\u001b[1mSRC\u001b[0m): ETRS89_UTM_zone_30N\n",
". Todas las capas presentan el \u001b[1mmismo SRC\u001b[0m: True\n"
]
}
],
"source": [
"precipi.estaciones"
"Doñana.info"
]
}
],
Expand Down
Loading

0 comments on commit 96c46c0

Please sign in to comment.