-
Notifications
You must be signed in to change notification settings - Fork 0
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
Profesergiom
committed
Sep 30, 2022
1 parent
8282ba5
commit 334e64c
Showing
21 changed files
with
418 additions
and
42 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -104,7 +104,7 @@ def send_message(service, destination, obj, body, attachments=[]): | |
).execute() | ||
|
||
|
||
def sendMail(voldf,evsel): | ||
def sendMail(voldf,evsel,tipomail,debug): | ||
import numpy as np | ||
#volcan=voldf.nombre_db.iloc[0] | ||
idev = evsel.idevento.iloc[0] | ||
|
@@ -117,37 +117,56 @@ def sendMail(voldf,evsel): | |
ML= evsel.ml.iloc[0] | ||
volcan_real = voldf.nombre.iloc[0] | ||
tipo = voldf.vol_tipo.iloc[0] | ||
#lista_debug=['[email protected]','[email protected]'] | ||
lista_real = ['[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]' | ||
] | ||
asunto="Sismo tipo "+tipoev+" ML="+str(ML)+" "+tipo+" "+volcan_real | ||
if debug==True: | ||
lista=['[email protected]','[email protected]'] | ||
else: | ||
lista = ['[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]' | ||
] | ||
|
||
|
||
|
||
cuerpo = """\nSismo localizado en el {tipov} {volcan}: | ||
\nTipo Evento: {tipo} | ||
Magnitud : {ml} (ML) | ||
Amplitud: {amplitud} um/s (referencia) | ||
Frecuencia: {frecuencia} Hz (Referencia) | ||
Profundidad: {profundidad} km bajo nivel del mar | ||
Latitud: {latitud}° | ||
Longitud: {longitud}° | ||
\nSe adjunta imagen correspondiente a localización con Hypo71 realizada en la sala de monitoreo y localización usando NLL en base a las fases P y S detectadas por los especialistas. | ||
\nSaludos. | ||
\n(Este correo es automático, no responder) | ||
""" | ||
cuerpo = cuerpo.format(tipo=tipoev,ml=ML,tipov=tipo,volcan=volcan_real,amplitud=amp,frecuencia=frec,profundidad=np.round(prof,1), | ||
latitud=np.round(lat,2),longitud=np.round(lon,2)) | ||
for destino in lista_real: | ||
if tipomail=='REAV': | ||
asunto="PRUEBA - REAV "+tipoev+" ML="+str(ML)+" "+tipo+" "+volcan_real+" - PRUEBA" | ||
cuerpo = """\nSismo localizado en el {tipov} {volcan}: | ||
\nTipo Evento: {tipo} | ||
Magnitud : {ml} (ML) | ||
Amplitud: {amplitud} um/s (referencia) | ||
Frecuencia: {frecuencia} Hz (Referencia) | ||
Profundidad: {profundidad} km bajo nivel del mar | ||
Latitud: {latitud}° | ||
Longitud: {longitud}° | ||
\nSe adjunta Propuesta de REAV. | ||
\nSaludos. | ||
\n(Este correo es automático, no responder) | ||
""" | ||
cuerpo = cuerpo.format(tipo=tipoev,ml=ML,tipov=tipo,volcan=volcan_real,amplitud=amp,frecuencia=frec,profundidad=np.round(prof,1), | ||
latitud=np.round(lat,2),longitud=np.round(lon,2)) | ||
elif tipomail=='normal': | ||
asunto="Sismo tipo "+tipoev+" ML="+str(ML)+" "+tipo+" "+volcan_real | ||
cuerpo = """\nSismo localizado en el {tipov} {volcan}: | ||
\nTipo Evento: {tipo} | ||
Magnitud : {ml} (ML) | ||
Amplitud: {amplitud} um/s (referencia) | ||
Frecuencia: {frecuencia} Hz (Referencia) | ||
Profundidad: {profundidad} km bajo nivel del mar | ||
Latitud: {latitud}° | ||
Longitud: {longitud}° | ||
\nSe adjunta imagen correspondiente a localización con Hypo71 realizada en la sala de monitoreo y localización usando NLL en base a las fases P y S detectadas por los especialistas. | ||
\nSaludos. | ||
\n(Este correo es automático, no responder) | ||
""" | ||
cuerpo = cuerpo.format(tipo=tipoev,ml=ML,tipov=tipo,volcan=volcan_real,amplitud=amp,frecuencia=frec,profundidad=np.round(prof,1), | ||
latitud=np.round(lat,2),longitud=np.round(lon,2)) | ||
for destino in lista: | ||
print(destino) | ||
send_message(gmail_authenticate(), destino, asunto,cuerpo,['figs/loc_'+str(idev)+'.jpg']) | ||
send_message(gmail_authenticate(), destino, asunto,cuerpo,['figs/loc_'+str(idev)+'.jpg']) |
Oops, something went wrong.