Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Javier Quinteros
dastools
Commits
f04a5fed
Commit
f04a5fed
authored
Aug 01, 2020
by
Javier Quinteros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean old comments and code unused code snippets
parent
ed328950
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
12 deletions
+0
-12
dasscripts/tdmsws.py
dasscripts/tdmsws.py
+0
-12
No files found.
dasscripts/tdmsws.py
View file @
f04a5fed
...
@@ -398,7 +398,6 @@ class StationAPI(object):
...
@@ -398,7 +398,6 @@ class StationAPI(object):
# However it is the best to merge time windows from files int one epoch
# However it is the best to merge time windows from files int one epoch
# This allows to construct the generator returning one line at each iteration
# This allows to construct the generator returning one line at each iteration
for
ch
in
channels
:
for
ch
in
channels
:
cherrypy
.
log
(
'Channel %s'
%
ch
)
t
=
TDMS
(
self
.
__experiment
,
directory
=
self
.
__directory
,
starttime
=
starttime
,
endtime
=
endtime
,
iterate
=
'M'
,
t
=
TDMS
(
self
.
__experiment
,
directory
=
self
.
__directory
,
starttime
=
starttime
,
endtime
=
endtime
,
iterate
=
'M'
,
channels
=
[
ch
])
channels
=
[
ch
])
result
=
dict
()
result
=
dict
()
...
@@ -423,21 +422,15 @@ class StationAPI(object):
...
@@ -423,21 +422,15 @@ class StationAPI(object):
# yield json.dumps(data, default=datetime.isoformat)
# yield json.dumps(data, default=datetime.isoformat)
if
data
[
'data'
]:
if
data
[
'data'
]:
# cherrypy.log('%s' % data)
stt
=
data
[
'starttime'
]
stt
=
data
[
'starttime'
]
ent
=
data
[
'endtime'
]
ent
=
data
[
'endtime'
]
if
level
==
'station'
:
if
level
==
'station'
:
key
=
'XX|%s||FH1|%s|%s|%s|SiteName'
%
(
data
[
'id'
],
lat
,
lon
,
elev
)
key
=
'XX|%s||FH1|%s|%s|%s|SiteName'
%
(
data
[
'id'
],
lat
,
lon
,
elev
)
# text = 'XX|%s||FH1|%s|%s|%s|SiteName|%s|%s\n' %\
# (data['id'], lat, lon, elev, stt.isoformat(), ent.isoformat())
else
:
else
:
key
=
'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s'
%
\
key
=
'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s'
%
\
(
data
[
'id'
],
lat
,
lon
,
elev
,
samprate
)
(
data
[
'id'
],
lat
,
lon
,
elev
,
samprate
)
# text = 'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s|%s|%s\n' %\
# (data['id'], lat, lon, elev, samprate, stt.isoformat(), ent.isoformat())
if
key
in
result
:
if
key
in
result
:
# Get the minimum starttime
# Get the minimum starttime
stt
=
stt
if
stt
<
result
[
key
][
0
]
else
result
[
key
][
0
]
stt
=
stt
if
stt
<
result
[
key
][
0
]
else
result
[
key
][
0
]
...
@@ -451,7 +444,6 @@ class StationAPI(object):
...
@@ -451,7 +444,6 @@ class StationAPI(object):
# Key is in the proper format for station or channel level. We only need to add the start and end time
# Key is in the proper format for station or channel level. We only need to add the start and end time
text
=
'%s|%s|%s
\n
'
%
(
key
,
stt
.
isoformat
(),
ent
.
isoformat
())
text
=
'%s|%s|%s
\n
'
%
(
key
,
stt
.
isoformat
(),
ent
.
isoformat
())
# yield json.dumps(data, default=datetime.isoformat)
yield
text
yield
text
return
return
...
@@ -631,7 +623,6 @@ class DataselectAPI(object):
...
@@ -631,7 +623,6 @@ class DataselectAPI(object):
except
Exception
:
except
Exception
:
# Send Error 400
# Send Error 400
message
=
'Wrong formatted list of stations (%s).'
%
sta
message
=
'Wrong formatted list of stations (%s).'
%
sta
# self.log.error(message)
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
...
@@ -641,7 +632,6 @@ class DataselectAPI(object):
...
@@ -641,7 +632,6 @@ class DataselectAPI(object):
except
Exception
:
except
Exception
:
# Send Error 400
# Send Error 400
message
=
'Error converting the "starttime" parameter (%s).'
%
starttime
message
=
'Error converting the "starttime" parameter (%s).'
%
starttime
# self.log.error(message)
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
else
:
else
:
...
@@ -653,7 +643,6 @@ class DataselectAPI(object):
...
@@ -653,7 +643,6 @@ class DataselectAPI(object):
except
Exception
:
except
Exception
:
# Send Error 400
# Send Error 400
message
=
'Error converting the "endtime" parameter (%s).'
%
endtime
message
=
'Error converting the "endtime" parameter (%s).'
%
endtime
# self.log.error(message)
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
cherrypy
.
response
.
headers
[
'Content-Type'
]
=
'text/plain'
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
raise
cherrypy
.
HTTPError
(
400
,
errormessage
(
400
,
message
))
else
:
else
:
...
@@ -720,7 +709,6 @@ def main():
...
@@ -720,7 +709,6 @@ def main():
# Read general parameters
# Read general parameters
experiment
=
config
.
get
(
'General'
,
'experiment'
)
experiment
=
config
.
get
(
'General'
,
'experiment'
)
# logging.basicConfig(level=loglevel)
server_config
=
{
server_config
=
{
'global'
:
{
'global'
:
{
...
...
Write
Preview
Markdown
is supported
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