Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franco Mele
decluster
Commits
8173ef4d
Commit
8173ef4d
authored
May 08, 2021
by
Franco Mele
Browse files
piccole modifiche
parent
11f0976a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
dati_test.txt
0 → 100644
View file @
8173ef4d
This diff is collapsed.
Click to expand it.
ingv_earthquakes.py
View file @
8173ef4d
...
...
@@ -12,7 +12,7 @@
# Il formato FREE è costituito da 5 interi e 4 reali separati da blank:
# yyyy mm dd HH MM lat lon depth mag
#
# Gli altri campi estratti da questa procedura
# Gli altri campi estratti da questa procedura
sono ignorati dai programmi cluster2000x.f e main_program.f90
import
pandas
as
pd
def
main
():
...
...
@@ -26,12 +26,25 @@ def main():
maxmag
=
input
(
" magnitudo massima (ES: 10.0) "
)
startt
=
input
(
" data di inizio nella forma yyyy-mm-dd "
)
endt
=
input
(
" data di fine nella forma yyyy-mm-dd "
)
mlyn
=
input
(
" trasformo tutte le magnitudo in ML ? (1=sì, 2=no) "
)
mltrue
=
False
# se mltrue=True, trasformo le tutte le magnitudo in ML
mldb
=
True
# se mltrue=True e mldb=True, uso per la trasformazione
# la relazione Di Bona, altrimenti uso la Scongn.Tin.Mich.
if
(
mlyn
==
1
):
mltrue
=
True
print
(
" "
)
print
(
" per la trasformazione uso la relazione"
)
stmyn
=
input
(
" Scognamiglio Tinti Michelini (2009) ? (1=sì, 2=no) "
)
if
(
stm
==
1
):
mldb
=
False
print
(
startt
,
" "
,
endt
)
url
=
"http://webservices.ingv.it/fdsnws/event/1/query?minlat="
+
minlat
+
"&maxlat="
+
maxlat
+
"&minlon="
+
minlon
+
"&maxlon="
+
maxlon
+
\
print
(
" estraggo i dati del periodo "
,
startt
,
" "
,
endt
)
url
=
"http://webservices.ingv.it/fdsnws/event/1/query?minlat="
+
minlat
+
"&maxlat="
+
maxlat
+
\
"&minlon="
+
minlon
+
"&maxlon="
+
maxlon
+
\
"&mindepth="
+
mindepth
+
"&maxdepth="
+
maxdepth
+
\
"&starttime="
+
startt
+
"T00:00:00&endtime="
+
endt
+
"T23:59:59"
+
\
"&minmag="
+
minmag
+
"&maxmag="
+
maxmag
+
"&format=text"
print
(
url
)
# data = pd.read_csv(url,sep='|',header=0,names=['evid','ot','lat','lon','dep','author','catalog','contrib','mtype','mag','magauthor','eventlocname'])
...
...
@@ -48,6 +61,8 @@ def main():
ii
=
0
for
ind
in
df
.
index
[::
-
1
]:
ii
=
ii
+
1
mymag
=
df
[
'Magnitude'
][
ind
]
print
(
df
[
'Time'
][
ind
][
0
:
4
],
" "
,
\
df
[
'Time'
][
ind
][
5
:
7
],
" "
,
\
df
[
'Time'
][
ind
][
8
:
10
],
" "
,
\
...
...
@@ -56,7 +71,7 @@ def main():
"%.5f"
%
round
(
df
[
'Latitude'
][
ind
],
5
),
" "
,
\
"%.5f"
%
round
(
df
[
'Longitude'
][
ind
],
5
),
" "
,
\
"%.1f"
%
round
(
df
[
'Depth/Km'
][
ind
],
1
),
" "
,
\
df
[
'Magnitude'
][
ind
]
,
" "
,
df
[
'EventLocationName'
][
ind
])
mymag
,
" "
,
df
[
'EventLocationName'
][
ind
])
ML
Md
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment