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
141b65b9
Commit
141b65b9
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Plot masspos lines in log file
parent
d9675c87
No related branches found
No related tags found
1 merge request
!191
Read log files generated by users
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/reftek_data/reftek.py
+30
-0
30 additions, 0 deletions
sohstationviewer/model/reftek_data/reftek.py
with
30 additions
and
0 deletions
sohstationviewer/model/reftek_data/reftek.py
+
30
−
0
View file @
141b65b9
...
...
@@ -2,9 +2,11 @@
RT130 object to hold and process RefTek data
"""
from
pathlib
import
Path
from
time
import
strptime
from
typing
import
Union
,
List
,
Tuple
,
Dict
import
traceback
import
numpy
as
np
from
obspy
import
UTCDateTime
from
obspy.core
import
Stream
from
sohstationviewer.conf
import
constants
...
...
@@ -77,6 +79,7 @@ class RT130(GeneralData):
if
self
.
creator_thread
.
isInterruptionRequested
():
raise
ThreadStopped
()
self
.
finalize_data
()
print
(
self
.
mass_pos_data
)
def
finalize_data
(
self
):
"""
...
...
@@ -134,6 +137,33 @@ class RT130(GeneralData):
self
.
log_data
[
file_key
][
'
SOH
'
].
append
(
(
key_file_count
,
reader
.
soh_lines
)
)
self
.
convert_mass_pos_log_lines_to_data
(
file_key
,
reader
.
masspos_lines
)
def
convert_mass_pos_log_lines_to_data
(
self
,
current_key
,
masspos_lines
):
for
masspos_num
in
range
(
1
,
7
):
masspos_string
=
f
'
MassPos
{
masspos_num
}
'
current_lines
=
[
line
.
split
()
for
line
in
masspos_lines
if
int
(
line
.
split
()[
2
])
==
masspos_num
]
data
=
np
.
asarray
([
line
[
3
]
for
line
in
current_lines
],
dtype
=
float
)
time_format
=
'
%Y:%j:%H:%M:%S.%f
'
times
=
np
.
array
([
UTCDateTime
.
strptime
(
line
[
1
]
+
'
000
'
,
time_format
).
timestamp
for
line
in
current_lines
])
if
len
(
data
)
==
0
:
continue
trace
=
{}
trace
[
'
startTmEpoch
'
]
=
times
[
0
]
trace
[
'
endTmEpoch
'
]
=
times
[
-
1
]
trace
[
'
data
'
]
=
data
trace
[
'
times
'
]
=
times
if
masspos_string
not
in
self
.
mass_pos_data
[
current_key
]:
self
.
mass_pos_data
[
current_key
][
masspos_string
]
=
{
'
tracesInfo
'
:
[
trace
]}
self
.
mass_pos_data
[
current_key
][
masspos_string
][
'
samplerate
'
]
=
0
trace
[
'
startTmEpoch
'
]
=
times
[
0
]
trace
[
'
endTmEpoch
'
]
=
times
[
-
1
]
else
:
self
.
mass_pos_data
[
current_key
][
masspos_string
][
'
tracesInfo
'
].
append
(
trace
)
trace
[
'
endTmEpoch
'
]
=
times
[
-
1
]
def
read_folders
(
self
)
->
None
:
"""
...
...
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