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
04d8e9e9
Commit
04d8e9e9
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Override times() in DiscontinuousTrace
Override times() in DiscontinuousTrace to
parent
2b955c74
No related branches found
No related tags found
1 merge request
!139
Change the way RT130 data is read for better performance
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/reftek/from_rt2ms/core.py
+25
-1
25 additions, 1 deletion
sohstationviewer/model/reftek/from_rt2ms/core.py
with
25 additions
and
1 deletion
sohstationviewer/model/reftek/from_rt2ms/core.py
+
25
−
1
View file @
04d8e9e9
...
@@ -12,6 +12,8 @@ Maeva Pourpoint IRIS/PASSCAL
...
@@ -12,6 +12,8 @@ Maeva Pourpoint IRIS/PASSCAL
import
copy
import
copy
import
os
import
os
from
pathlib
import
Path
from
typing
import
Optional
,
Union
import
obspy.io.reftek.core
as
obspy_rt130_core
import
obspy.io.reftek.core
as
obspy_rt130_core
import
warnings
import
warnings
...
@@ -33,7 +35,29 @@ from sohstationviewer.model.reftek.rt130_experiment.reftek_helper import (
...
@@ -33,7 +35,29 @@ from sohstationviewer.model.reftek.rt130_experiment.reftek_helper import (
class
DiscontinuousTrace
(
Trace
):
class
DiscontinuousTrace
(
Trace
):
def
__init__
(
self
,
*
args
,
times
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
times
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
times
=
times
self
.
_times
=
times
def
times
(
self
,
type
:
str
=
"
relative
"
,
reftime
:
Optional
[
UTCDateTime
]
=
None
)
->
np
.
ndarray
:
"""
Override Trace.times(). Returns a numpy array of stored times data,
modified based on the argument
"
type
"
.
:param type: the type of times data to return. For more information,
refer to Trace.times(). Note: this method does not implement
types
'
utcdatetime
'
and
'
matplotlib
'
because they are not going
to be useful.
:param reftime: the time used as a reference point when getting
relative time. If None, the start time of the trace is used as
the reference point.
:return: the requested array of time data, modified based on the type
requested.
"""
if
type
==
'
utcdatetime
'
or
type
==
'
matplotlib
'
:
raise
NotImplementedError
if
type
==
'
relative
'
:
return
self
.
_times
-
self
.
stats
.
starttime
.
timestamp
elif
type
==
'
timestamp
'
:
return
self
.
_times
class
Reftek130Exception
(
ObsPyException
):
class
Reftek130Exception
(
ObsPyException
):
...
...
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