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
5a48ab24
Commit
5a48ab24
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Remove unneeded code
parent
732e8cb0
No related branches found
No related tags found
1 merge request
!139
Change the way RT130 data is read for better performance
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sohstationviewer/model/reftek/rt130_experiment/reftek.py
+5
-5
5 additions, 5 deletions
sohstationviewer/model/reftek/rt130_experiment/reftek.py
sohstationviewer/model/reftek/rt130_experiment/reftek_helper.py
+0
-20
0 additions, 20 deletions
...tionviewer/model/reftek/rt130_experiment/reftek_helper.py
with
5 additions
and
25 deletions
sohstationviewer/model/reftek/rt130_experiment/reftek.py
+
5
−
5
View file @
5a48ab24
...
...
@@ -20,7 +20,7 @@ from sohstationviewer.model.reftek.rt130_experiment.eh_et_packet import \
EHETPacket
,
read_eh_et_packet
,
eh_et_payload_end_in_packet
,
)
from
sohstationviewer.model.reftek.rt130_experiment.reftek_helper
import
(
print_error
,
packet_reader_placeholder
,
RT130ParseError
,
PacketHeader
,
packet_reader_placeholder
,
RT130ParseError
,
PacketHeader
,
)
from
sohstationviewer.model.reftek.from_rt2ms
import
core
...
...
@@ -66,14 +66,14 @@ def get_rt130_packet_header(rt130_packet: bytes,
# use str.decode() than the unpacker.
packet_type
=
rt130_packet
[:
2
].
decode
(
'
ASCII
'
)
except
UnicodeError
:
print
_error
(
f
'
Cannot decode packet type.
'
)
print
_error
(
'
The given file does not appear to be a valid RT130 file.
'
)
print
(
f
'
Cannot decode packet type.
'
)
print
(
'
The given file does not appear to be a valid RT130 file.
'
)
raise
RT130ParseError
valid_packet_types
=
[
'
AD
'
,
'
CD
'
,
'
DS
'
,
'
DT
'
,
'
EH
'
,
'
ET
'
,
'
OM
'
,
'
SH
'
,
'
SC
'
,
'
FD
'
]
if
packet_type
not
in
valid_packet_types
:
print
_error
(
f
'
Invalid packet type found:
{
packet_type
}
'
)
print
_error
(
'
The given file does not appear to be a valid RT130 file.
'
)
print
(
f
'
Invalid packet type found:
{
packet_type
}
'
)
print
(
'
The given file does not appear to be a valid RT130 file.
'
)
raise
RT130ParseError
experiment_number
=
int
(
rt130_packet
[
2
:
3
].
hex
())
...
...
This diff is collapsed.
Click to expand it.
sohstationviewer/model/reftek/rt130_experiment/reftek_helper.py
+
0
−
20
View file @
5a48ab24
...
...
@@ -4,26 +4,6 @@ from typing import Any
from
obspy
import
UTCDateTime
class
bcolors
:
HEADER
=
'
\033
[95m
'
OKBLUE
=
'
\033
[94m
'
OKCYAN
=
'
\033
[96m
'
OKGREEN
=
'
\033
[92m
'
WARNING
=
'
\033
[93m
'
FAIL
=
'
\033
[91m
'
ENDC
=
'
\033
[0m
'
BOLD
=
'
\033
[1m
'
UNDERLINE
=
'
\033
[4m
'
def
print_warning
(
message
,
*
args
,
**
kwargs
):
print
(
bcolors
.
WARNING
+
message
+
bcolors
.
ENDC
,
*
args
,
**
kwargs
)
def
print_error
(
message
,
*
args
,
**
kwargs
):
print
(
bcolors
.
FAIL
+
message
+
bcolors
.
ENDC
,
*
args
,
**
kwargs
)
def
packet_reader_placeholder
(
*
args
:
Any
,
**
kwargs
:
Any
)
->
None
:
"""
Placeholder function to be used in place of an RT130 packet reader
...
...
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