Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
92050fa3
Commit
92050fa3
authored
4 months ago
by
Wernle, Alexandra Nicole
Browse files
Options
Downloads
Patches
Plain Diff
Changed metadata_class to typehint of MetadataCategory since this will not be used for flags only.
parent
b94c90b4
No related branches found
No related tags found
1 merge request
!344
New MetadataAlgorithm, SpikesAlgorithm, and flag-spikes application
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/algorithm/MetadataAlgorithm.py
+2
-3
2 additions, 3 deletions
geomagio/algorithm/MetadataAlgorithm.py
with
2 additions
and
3 deletions
geomagio/algorithm/MetadataAlgorithm.py
+
2
−
3
View file @
92050fa3
...
@@ -4,7 +4,6 @@ from datetime import timedelta
...
@@ -4,7 +4,6 @@ from datetime import timedelta
from
enum
import
Enum
from
enum
import
Enum
from
typing
import
Optional
from
typing
import
Optional
from
..metadata.flag.Flag
import
Flag
from
..metadata
import
Metadata
,
MetadataFactory
,
MetadataCategory
from
..metadata
import
Metadata
,
MetadataFactory
,
MetadataCategory
from
..edge.MiniSeedFactory
import
MiniSeedFactory
from
..edge.MiniSeedFactory
import
MiniSeedFactory
from
..edge.EdgeFactory
import
EdgeFactory
from
..edge.EdgeFactory
import
EdgeFactory
...
@@ -55,7 +54,7 @@ class MetadataAlgorithm(BaseModel):
...
@@ -55,7 +54,7 @@ class MetadataAlgorithm(BaseModel):
def
create_metadata
(
def
create_metadata
(
self
,
self
,
metadata_class
:
Flag
,
metadata_class
:
MetadataCategory
,
metadata_dict
:
dict
,
metadata_dict
:
dict
,
category
:
MetadataCategory
,
category
:
MetadataCategory
,
network
:
str
,
network
:
str
,
...
@@ -103,7 +102,7 @@ class MetadataAlgorithm(BaseModel):
...
@@ -103,7 +102,7 @@ class MetadataAlgorithm(BaseModel):
return
self
.
_get_metadata_factory
().
create_metadata
(
metadata
=
metadata_obj
)
return
self
.
_get_metadata_factory
().
create_metadata
(
metadata
=
metadata_obj
)
def
split_stream_by_day
(
self
,
stream
:
Stream
)
->
list
[
Stream
]:
def
split_stream_by_day
(
self
,
stream
:
Stream
)
->
list
[
Stream
]:
"""
Split stream into daily streams to
prevent metadata from overlapping
.
"""
"""
Split stream into daily streams to
control size of spike arrays
.
"""
daily_streams
=
[]
daily_streams
=
[]
# get min and max time
# get min and max time
current_time
=
min
(
trace
.
stats
.
starttime
for
trace
in
stream
)
current_time
=
min
(
trace
.
stats
.
starttime
for
trace
in
stream
)
...
...
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