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
11527bde
Commit
11527bde
authored
May 15, 2021
by
Franco Mele
Browse files
modifica della specifica della data sul python
parent
538fc5a7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
20201101_20210423.txt
deleted
100644 → 0
View file @
538fc5a7
This diff is collapsed.
Click to expand it.
ingv_earthquakes.py
View file @
11527bde
...
...
@@ -24,8 +24,8 @@ def main():
maxdepth
=
input
(
" profondita' massima (ES: 60.0) "
)
minmag
=
input
(
" magnitudo minima (ES: 0.0) "
)
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 "
)
startt
=
input
(
" data di inizio nella forma yyyy-mm-dd
T00:00:00
"
)
endt
=
input
(
" data di fine nella forma yyyy-mm-dd
T00:00:00
"
)
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
...
...
@@ -43,13 +43,13 @@ def main():
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"
+
\
"&starttime="
+
startt
+
"&endtime="
+
endt
+
\
"&minmag="
+
minmag
+
"&maxmag="
+
maxmag
+
"&format=text"
print
(
url
)
url0
=
url
.
replace
(
" "
,
""
)
print
(
url
0
)
# data = pd.read_csv(url,sep='|',header=0,names=['evid','ot','lat','lon','dep','author','catalog','contrib','mtype','mag','magauthor','eventlocname'])
data
=
pd
.
read_csv
(
url
,
sep
=
'|'
,
header
=
0
,
\
data
=
pd
.
read_csv
(
url
0
,
sep
=
'|'
,
header
=
0
,
\
dtype
=
{
'Latitude'
:
float
,
'Longitude'
:
float
,
'Depth/Km'
:
float
,
'Magnitude'
:
float
})
print
(
data
)
# datas = data.replace("/","_")
...
...
@@ -58,6 +58,10 @@ def main():
filout
=
startt
+
"_"
+
endt
+
".txt"
filo
=
filout
.
replace
(
"-"
,
""
)
filo
=
filout
.
replace
(
" "
,
""
)
filo
=
filout
.
replace
(
":"
,
""
)
with
open
(
filo
,
'w'
)
as
f
:
ii
=
0
for
ind
in
df
.
index
[::
-
1
]:
...
...
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