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
bcba2e3c
Commit
bcba2e3c
authored
4 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
return step from _validate_step
parent
c072fde5
No related branches found
No related tags found
2 merge requests
!146
Release CMO metadata to production
,
!17
Implement hourly/daily filtering products
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/algorithm/FilterAlgorithm.py
+6
-4
6 additions, 4 deletions
geomagio/algorithm/FilterAlgorithm.py
with
6 additions
and
4 deletions
geomagio/algorithm/FilterAlgorithm.py
+
6
−
4
View file @
bcba2e3c
...
...
@@ -110,10 +110,10 @@ class FilterAlgorithm(Algorithm):
self
.
output_sample_period
=
output_sample_period
self
.
steps
=
steps
self
.
load_state
()
#
ensure
correctly
aligned
coefficients
in
each
step
self
.
steps
=
self
.
steps
or
[]
for
step
in
self
.
steps
:
self
.
_validate_step
(
step
)
# ensure
correctly
aligned
coefficients
in
each
step
self
.
steps
=
(
self
.
steps
and
[
self
.
_validate_step
(
step
)
for
step
in
self
.
steps
]
or
[]
)
def
load_state
(
self
):
"""
Load filter coefficients from json file if custom filter is used.
...
...
@@ -176,6 +176,8 @@ class FilterAlgorithm(Algorithm):
"""
Verifies whether or not firfirlter steps have an odd number of coefficients
"""
if
step
[
"
type
"
]
==
"
firfilter
"
and
len
(
step
[
"
window
"
])
%
2
!=
1
:
raise
ValueError
(
"
Firfilter requires an odd number of coefficients
"
)
else
:
return
step
def
can_produce_data
(
self
,
starttime
,
endtime
,
stream
):
"""
Can Produce data
...
...
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