Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
98ceb6be
Commit
98ceb6be
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused code
parent
a61e7356
No related branches found
No related tags found
1 merge request
!133
WIP: prepare fast mseed to connect with SOHView
Pipeline
#2702
failed with stage
in 2 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/reftek/from_rt2ms/core.py
+15
-68
15 additions, 68 deletions
sohstationviewer/model/reftek/from_rt2ms/core.py
with
15 additions
and
68 deletions
sohstationviewer/model/reftek/from_rt2ms/core.py
+
15
−
68
View file @
98ceb6be
...
@@ -11,6 +11,9 @@ Maeva Pourpoint IRIS/PASSCAL
...
@@ -11,6 +11,9 @@ Maeva Pourpoint IRIS/PASSCAL
"""
"""
import
copy
import
copy
import
os
import
sys
import
obspy.io.reftek.core
as
obspy_rt130_core
import
obspy.io.reftek.core
as
obspy_rt130_core
import
warnings
import
warnings
...
@@ -38,74 +41,6 @@ class DiscontinuousTrace(Trace):
...
@@ -38,74 +41,6 @@ class DiscontinuousTrace(Trace):
self
.
times
=
times
self
.
times
=
times
EH_PAYLOAD
=
{
"
station_name_extension
"
:
(
35
,
1
,
_decode_ascii
),
"
station_name
"
:
(
36
,
4
,
_decode_ascii
),
"
sampling_rate
"
:
(
64
,
4
,
float
),
"
trigger_time
"
:
(
72
,
16
,
_parse_long_time
),
"
first_sample_time
"
:
(
eh_et_payload_last_field_start
,
eh_et_payload_last_field_size
,
_parse_long_time
),
}
# class EHPacket(packet.EHPacket):
# def __init__(self, data):
# self._data = data
# payload = self._data["payload"].tobytes()
# for name, (start, length, converter) in EH_PAYLOAD.items():
# data = payload[start:start + length]
# if converter is not None:
# data = converter(data)
# setattr(self, name, data)
#
# def eh_et_info(self, nbr_DT_samples):
# """
# Compile EH and ET info to write to log file.
# Returns list of strings.
# Formatting of strings is based on earlier version of rt2ms.
# """
# info = []
# # packet_tagline1 = ("\n\n{:s} exp {:02d} bytes {:04d} {:s} ID: {:s} "
# # "seq {:04d}".format(self.type.decode(),
# # self.experiment_number,
# # self.byte_count,
# # Packet.time_tag(self.time),
# # self.unit_id.decode(),
# # self.packet_sequence))
# # info.append(packet_tagline1)
# # if self.type.decode('ASCII') == 'EH':
# # nbr_DT_samples = 0
# # info.append("\nEvent Header")
# # else:
# # info.append("\nEvent Trailer")
# # info.append("\n event = " + str(self.event_number))
# # info.append("\n stream = " + str(self.data_stream_number + 1))
# # info.append("\n format = " + self.data_format.decode('ASCII'))
# # info.append("\n stream name = " + self.stream_name)
# # info.append("\n sample rate = " + str(self.sampling_rate))
# # info.append("\n trigger type = " + self.trigger_type)
# trigger_time = Packet.time_tag(UTCDateTime(ns=self.trigger_time))
# # info.append("\n trigger time = " + trigger_time)
# first_sample_time = Packet.time_tag(UTCDateTime(ns=self.first_sample_time)) # noqa: E501
# # info.append("\n first sample = " + first_sample_time)
# # if self.last_sample_time:
# # info.append("\n last sample = " + Packet.time_tag(UTCDateTime(ns=self.last_sample_time))) # noqa: E501
# # info.append("\n bit weights = " + " ".join([val for val in self.channel_adjusted_nominal_bit_weights if val])) # noqa: E501
# # info.append("\n true weights = " + " ".join([val for val in self.channel_true_bit_weights if val])) # noqa: E501
# packet_tagline2 = ("\nDAS: {:s} EV: {:04d} DS: {:d} FST = {:s} TT = "
# "{:s} NS: {:d} SPS: {:.1f} ETO: 0"
# .format(self.unit_id.decode(),
# self.event_number,
# self.data_stream_number + 1,
# first_sample_time,
# trigger_time,
# nbr_DT_samples,
# self.sampling_rate))
# info.append(packet_tagline2)
# return info
class
Reftek130Exception
(
ObsPyException
):
class
Reftek130Exception
(
ObsPyException
):
pass
pass
...
@@ -267,3 +202,15 @@ class Reftek130(obspy_rt130_core.Reftek130):
...
@@ -267,3 +202,15 @@ class Reftek130(obspy_rt130_core.Reftek130):
# check if endtime of trace is consistent
# check if endtime of trace is consistent
st
+=
tr
st
+=
tr
return
st
return
st
data_path
=
'
/Users/kle/Documents/SOHView data/RT130/2017149.92EB
'
for
root
,
subdirs
,
files
in
os
.
walk
(
data_path
):
for
file_name
in
files
:
if
file_name
.
startswith
(
'
.
'
):
continue
file_path
=
os
.
path
.
join
(
root
,
file_name
)
print
(
file_path
)
a
=
(
Reftek130
.
from_file
(
file_path
).
_data
)
print
(
EHPacket
(
a
[
0
]))
sys
.
exit
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment