Skip to content

Commit

Permalink
v1.2.0 (Soporte GMT6)
Browse files Browse the repository at this point in the history
  • Loading branch information
nestor-ld93 committed Dec 31, 2022
1 parent 62de66f commit b736d6f
Show file tree
Hide file tree
Showing 15 changed files with 3,625 additions and 312 deletions.
148 changes: 74 additions & 74 deletions 1_sismicidad.csh

Large diffs are not rendered by default.

166 changes: 83 additions & 83 deletions 3_sismicidad_perfil.csh

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions 4_perfil_sismico.csh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#==================================================================================
echo ""
echo "+==========================================================================+"
echo "| PERFIL SISMICO v1.1.0 |"
echo "| PERFIL SISMICO v1.2.0 |"
echo "+==========================================================================+"
echo "| -Grafica el perfil de profundidad con datos de topografia (GRD/NC) |"
echo "| -Ultima actualizacion: 17/10/2020 |"
echo "| -Ultima actualizacion: 29/12/2022 |"
echo "| -Basado en los scripts de Cesar Jimenez y Cristobal Condori |"
echo "+--------------------------------------------------------------------------+"
echo "| -Copyright (C) 2020 Nestor Luna Diaz |"
Expand Down Expand Up @@ -81,10 +81,10 @@ set Texto_leyenda_02 = `echo $Texto_leyenda_02_pre | tr "%" " "`
set Texto_leyenda_03_pre = $13
set Texto_leyenda_03 = `echo $Texto_leyenda_03_pre | tr "%" " "`

gmtset HEADER_FONT_SIZE 14
gmtset ANOT_FONT_SIZE 12
gmtset LABEL_FONT_SIZE 14
gmtset GRID_PEN_PRIMARY = 0.25p/121/128/129
gmt set FONT_ANNOT 12
gmt set FONT_LABEL 14
gmt set FONT_TITLE 14
gmt set MAP_GRID_PEN_PRIMARY 0.25p,121/128/129

if ($perfil_region == 'norte') then
set L = $L1
Expand Down Expand Up @@ -163,47 +163,47 @@ while ($i <= $N)
end

################## Generar línea (puntos) del perfil #########################
project -C$p1 -E$p2 -G.5 -Dd -Q > $linea_perfil
gmt project -C$p1 -E$p2 -G.5 -Dd -Q > $linea_perfil

##### Extrae valores de la topografia en función de la línea del perfil ######
grdtrack $linea_perfil -G$grdfile | awk '{print $3, $4 }' > $linea_topo_bati
gmt grdtrack $linea_perfil -G$grdfile | awk '{print $3, $4 }' > $linea_topo_bati

#################### Graficar el pefil de la topografia ######################
psbasemap -JX$SIZE1 -R$REGION1 -B$AXIS1 -P -K -X3.0c -Y15.0c > $psfile
awk '{print $1,$2*0.001 }' $linea_topo_bati | psxy -R$REGION1 -JX$SIZE1 -W4/10/10/10 -K -O -P >> $psfile
gmt psbasemap -JX$SIZE1 -R$REGION1 -B$AXIS1 -P -K -X3.0c -Y15.0c > $psfile
awk '{print $1,$2*0.001 }' $linea_topo_bati | gmt psxy -R$REGION1 -JX$SIZE1 -W1,0/0/0 -K -O -P >> $psfile

################# Texto (SW, NE) - Ahora es: AA', BB', CC' ###################
set L1 = `echo "scale=2; $L-20.0" | bc` # Operación para ubicar el texto "NE" (Ahora es: AA', BB', CC').
if ($perfil_region == 'norte') then
echo 0 10 12 0 0 5 "A" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "A\47" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo 0 10 12 0 0 5 "A" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "A\47" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
endif

if ($perfil_region == 'centro') then
echo 0 10 12 0 0 5 "B" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "B\47" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo 0 10 12 0 0 5 "B" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "B\47" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
endif

if ($perfil_region == 'sur') then
echo 0 10 12 0 0 5 "C" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "C\47" | pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo 0 10 12 0 0 5 "C" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
echo $L1 10 12 0 0 5 "C\47" | gmt pstext -R$REGION1 -JX$SIZE1 -V -N -O -K >> $psfile
endif
############ Perfil de Sismos (Longitud, Latitud, Profundidad) ###############
psbasemap -JX$SIZE2 -R$REGION2 -B$AXIS2 -P -K -X0 -Y-7.5c -O >> $psfile
gmt psbasemap -JX$SIZE2 -R$REGION2 -B$AXIS2 -P -K -X0 -Y-7.5c -O >> $psfile

if ($mostrar_sup == 'si') then
awk '{print $3, $2, $4*-1}' $txt_sup | pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -sc0.28 -G255/0/0 -L1 -P -O -K >> $psfile
awk '{print $3, $2, $4*-1}' $txt_sup | gmt pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -Fsc0.28 -G255/0/0 -L1 -P -O -K >> $psfile
endif

if ($mostrar_int == 'si') then
awk '{print $3, $2, $4*-1}' $txt_int | pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -sc0.28 -G255/255/0 -L1 -P -O -K >> $psfile
awk '{print $3, $2, $4*-1}' $txt_int | gmt pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -Fsc0.28 -G255/255/0 -L1 -P -O -K >> $psfile
endif

if ($mostrar_prof == 'si') then
awk '{print $3, $2, $4*-1}' $txt_pro | pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -sc0.28 -G0/0/255 -L1 -P -O -K >> $psfile
awk '{print $3, $2, $4*-1}' $txt_pro | gmt pscoupe -JX$SIZE2 -R$REGION2 \
-Aa$p1/$p2/90/$W_mitad/0/-60 -Fsc0.28 -G0/0/255 -L1 -P -O -K >> $psfile
endif

########################## Leyenda 01: Sismicidad ############################
Expand All @@ -212,7 +212,7 @@ endif
set SIZE_LEYENDA = 3.65c/2.55c/7.2c/2.5c/TC

if ($leyenda == 'si' && $mostrar_sup == 'si' && $mostrar_int == 'si' && $mostrar_prof == 'si') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i red 0.25p 0.2i $Texto_leyenda_01
Expand All @@ -225,7 +225,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'si' && $mostrar_int == 'si' && $mostrar_prof == 'no') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i red 0.25p 0.2i $Texto_leyenda_01
Expand All @@ -236,7 +236,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'si' && $mostrar_int == 'no' && $mostrar_prof == 'si') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i red 0.25p 0.2i $Texto_leyenda_01
Expand All @@ -247,7 +247,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'si' && $mostrar_int == 'no' && $mostrar_prof == 'no') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i red 0.25p 0.2i $Texto_leyenda_01
Expand All @@ -256,7 +256,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'no' && $mostrar_int == 'si' && $mostrar_prof == 'si') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i yellow 0.25p 0.2i $Texto_leyenda_02
Expand All @@ -267,7 +267,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'no' && $mostrar_int == 'si' && $mostrar_prof == 'no') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i yellow 0.25p 0.2i $Texto_leyenda_02
Expand All @@ -276,7 +276,7 @@ END
endif

if ($leyenda == 'si' && $mostrar_sup == 'no' && $mostrar_int == 'no' && $mostrar_prof == 'si') then
pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F -G255/255/255 -O >> $psfile
gmt pslegend <<END -Dx$SIZE_LEYENDA -R$REGION2 -JX$SIZE2 -F+g255/255/255+p1p -O >> $psfile
H 12 1 $TITULO_leyenda
D 0 1p
S 0.1i c 0.1i blue 0.25p 0.2i $Texto_leyenda_03
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## LISTA DE CAMBIOS

- (v1.0.0) [25/08/2020] Lanzamiento inicial.
- (v1.0.1) [08/12/2022] Corregido generador de coordenadas en versiones actuales de sh.
- (v1.1.0) [08/12/2022] Los textos editables ahora aceptan caracteres con tildes y ñ (´,ñ) en minúsculas y mayúsculas.
- (v1.1.0) [08/12/2022] Agregado opción para utilizar paleta de colores personalizada.
- (v1.1.0) [08/12/2022] Agregado opción "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado textos editables con parámetros de personalización en "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado textos editables para modificar el contenido de la Leyenda 1.
- (v1.1.0) [08/12/2022] Agregado opción para mostrar escala del mapa en "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado opciones de grillado para el mapa.
- (v1.2.0) [30/12/2022] Agregado compatibilidad inicial con GMT6.
- (v1.2.0) [30/12/2022] GMT6 es utilizado por defecto, pero se puede utilizar GMT4.
- (v1.2.0) [30/12/2022] Eliminado la pestaña "Manual".
Binary file modified IMGs/Graf_SPS_01.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified IMGs/Graf_SPS_02.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions Launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# -*- coding: utf-8 -*-
#==================================================================================
# +==========================================================================+ #
# | GrafSPS v1.1.0 | #
# | GrafSPS v1.2.0 | #
# +==========================================================================+ #
# | -Graficador de Sismicidad y Perfiles Sísmicos | #
# | -Interfaz gráfica: PyQt5 | #
# | -Ultima actualizacion: 17/10/2020 | #
# | -Ultima actualizacion: 30/12/2022 | #
# +--------------------------------------------------------------------------+ #
# | -Copyright (C) 2020 Nestor Luna Diaz | #
# +--------------------------------------------------------------------------+ #
Expand All @@ -30,19 +30,18 @@
#==================================================================================
# NOTA:
# - Este Script y todos los Sub-Scripts están pensados para graficar la sismicidad
# en el Perú utilizando el catálogo sísmico del NEIC-USGS son ',' (archivo CSV
# en el Perú utilizando el catálogo sísmico del NEIC-USGS sin ','s (archivo CSV
# sin comas).
# - Se recomienda modificar manualmente el título de la leyenda.

#==================================================================================
# REQUISITOS MINIMOS:
# - GMT4 (Linux)
# - Shell y C-Shell (Linux)
# - ps2eps (Linux)
# - Evince (Linux)
# - python3 (Linux)
# - python3-pyqt5 (Linux)
# - GNU Linux (Kernel 4.15) 64-bit [Se recomienda una distribución con KDE Plasma 5.12 o superior]
# - GMT4 o GMT6
# - sh & csh
# - gawk
# - ps2eps
# - evince
# - python3
# - python3-pyqt5
#==================================================================================

import sys
Expand Down Expand Up @@ -185,7 +184,7 @@ def __init__(self):

#============================================================================================================
def Borrar_resultados(self):
comando_01 = "rm .gmt* *.txt *.eps *.ps *.cpt"
comando_01 = "rm .gmt* gmt.conf gmt.history *.txt *.eps *.ps *.cpt"
process = subprocess.Popen(comando_01, shell=True)
#============================================================================================================

Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,18 @@ Programa con interfaz gráfica PyQt5 basado en scripts en lenguaje C-Shell y Bas

## REQUISITOS MÍNIMOS

- `GMT4`
- `GMT4` o `GMT6`
- `sh` & `csh`
- `gawk` (Para Ubuntu 20.04 o superior)
- `gawk`
- `ps2eps`
- `evince`
- `python3`
- `python3-pyqt5`
- `GNU Linux (Kernel 4.15) 64-bit`

## ¿CÓMO DESCARGAR?

Para obtener la última versión estable, descargue desde la pestaña [[Releases](https://github.com/nestor-ld93/GrafSPS/releases)].
Para obtener la última versión candidata a estable, descargue desde el botón [Code] o ejecute en un terminal:
Para obtener la última versión dev, descargue desde el botón [Code] o ejecute en un terminal:

git clone https://github.com/nestor-ld93/GrafSPS

Expand All @@ -84,19 +83,22 @@ Para obtener la última versión candidata a estable, descargue desde el botón

## NOTAS IMPORTANTES

1. En cada inicio del programa es obligatorio seleccionar los archivos CSV y GRD/NC además de la carpeta contenedora de los datos de contorno. Pero, si el usuario lo desea, puede ingresar al archivo "`Launcher.py`" (con cualquier editor de texto) y modificar estas opciones para que se guarden por defecto (linea 56-92).
1. Se utiliza por defecto `GMT6`.
1. Para utilizar `GMT4`, ingrese a la carpeta `Scripts_templates`, copie y renombre los archivos `1_sismicidad_gmt4.csh`, `3_sismicidad_perfil_gmt4.csh` y `4_perfil_sismico_gmt4.csh` al directorio principal para reemplazar los archivos por defecto.
1. En cada inicio del programa es obligatorio seleccionar los archivos CSV y GRD/NC además de la carpeta contenedora de los datos de contorno. Pero, si el usuario lo desea, puede ingresar al archivo "`Launcher.py`" (con cualquier editor de texto) y modificar estas opciones para que se guarden por defecto.
1. Por defecto, los archivos EPS se ejecutan en "`Evince`". El usuario puede cambiar este lector por el de su preferencia modificando las últimas lineas de los archivos bash/shell.
1. Muchos de los botones no se encuentran desactivados, por lo que si se realiza un procedimiento inadecuado el programa no realizará acción alguna. Para conocer el procedimiento adecuado, revisar la sección "`¿CÓMO EJECUTAR?`".
1. Se proporciona GrafSPS con la carpeta "`Datos_contornos`" (contiene los rasgos tectónicos para Perú).
1. No se proporciona los datos de topografía-batimetría. El usuario deberá conseguirlos de fuentes oficiales.
1. Mientras más grande sean los archivos GRD/NC, mayor será el tiempo computacional para generar los mapas y los perfiles (Este no es un problema de GrafSPS). Para solventarlo, el usuario puede recortar el archivo de topografía-batimetría para una región de interés.
1. Mientras más grande sean los archivos GRD/NC, mayor será el tiempo computacional para generar los mapas y los perfiles (Este no es un problema de GrafSPS). Para solventarlo, el usuario puede recortar el archivo de topografía-batimetría para una región de interés usando herramientas externas.
1. Los parámetros del mapa de sismicidad con las regiones rectangulares son dependientes de las pestaña "`Sismicidad`".
1. En distribuciones basadas en el escritorio KDE Plasma, **GrafSPS** se adapta al esquema de colores seleccionado por el SO.

## RECURSOS EXTERNOS

1. "[GMT4 y documentación oficial de instalación](https://www.generic-mapping-tools.org/download/)"
1. "[GMT4 instalación semi-desatendida](https://github.com/nestor-ld93/GMT4)"
1. "[GMT6 y documentación oficial de instalación](https://github.com/GenericMappingTools/gmt)"
1. "[Catálogo sísmico del NEIC](http://earthquake.usgs.gov/earthquakes/map/)"
1. "[Topografía - ETOPO1 Global Relief Model](https://www.ngdc.noaa.gov/mgg/global/)"
1. "[Batimetría - GEBCO The General Bathymetric Chart of the Oceans](https://www.gebco.net/data_and_products/gridded_bathymetry_data/)"
Expand Down Expand Up @@ -131,12 +133,4 @@ GMT uses (or can access) data derived from these sources:

## LISTA DE CAMBIOS

- (v1.0.0) [25/08/2020] Lanzamiento inicial.
- (v1.0.1) [08/12/2022] Corregido generador de coordenadas en versiones actuales de sh.
- (v1.1.0) [08/12/2022] Los textos editables ahora aceptan caracteres con tildes y ñ (´,ñ) en minúsculas y mayúsculas.
- (v1.1.0) [08/12/2022] Agregado opción para utilizar paleta de colores personalizada.
- (v1.1.0) [08/12/2022] Agregado opción "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado textos editables con parámetros de personalización en "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado textos editables para modificar el contenido de la Leyenda 1.
- (v1.1.0) [08/12/2022] Agregado opción para mostrar escala del mapa en "3) Opciones avanzadas".
- (v1.1.0) [08/12/2022] Agregado opciones de grillado para el mapa.
Todos los cambios notables de este proyecto se encuentran en [Changelog](https://github.com/nestor-ld93/GrafSPS/blob/master/CHANGELOG.md).
Loading

0 comments on commit b736d6f

Please sign in to comment.