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
86e257d3
Commit
86e257d3
authored
1 year ago
by
Geels, Brendan Ryan
Browse files
Options
Downloads
Patches
Plain Diff
Exclude invalid entries in get_instrument_calibrations
parent
f10f33f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!306
Replace geomagio/Metadata.py & Poetry Update
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/metadata/instrument/InstrumentCalibrations.py
+10
-1
10 additions, 1 deletion
geomagio/metadata/instrument/InstrumentCalibrations.py
with
10 additions
and
1 deletion
geomagio/metadata/instrument/InstrumentCalibrations.py
+
10
−
1
View file @
86e257d3
...
...
@@ -2,6 +2,8 @@ from obspy import UTCDateTime
from
geomagio.metadata
import
Metadata
,
MetadataFactory
,
MetadataCategory
# REMOVE ANY INSTRUMENT METADATA ELEMENTS W/ "DATA_VALID=FALSE"
class
InstrumentCalibrations
:
"""
...
...
@@ -305,7 +307,8 @@ def get_instrument_calibrations(
observatory: observatory code
start_time: start time to match, or None to match any.
end_time: end time to match, or None to match any.
calibrations: use custom list, defaults to pulling and converting metadata
calibrations: use custom list, defaults to pulling and converting instrument metadata
metadata_url: metadata database url
Returns:
list of applicable instrument calibrations
"""
...
...
@@ -321,6 +324,12 @@ def get_instrument_calibrations(
station
=
observatory
,
)
metadata
=
factory
.
get_metadata
(
query
=
query
)
# remove invalid metadata entries
for
i
,
m
in
enumerate
(
metadata
):
if
not
m
.
data_valid
:
metadata
.
pop
(
i
)
instrumentCalibrations
=
InstrumentCalibrations
(
metadata
)
calibrations
=
instrumentCalibrations
.
get_calibrations
()
...
...
This diff is collapsed.
Click to expand it.
Geels, Brendan Ryan
@bgeels
mentioned in commit
2b968a62
·
1 year ago
mentioned in commit
2b968a62
mentioned in commit 2b968a62eeff45a4ecc5a07671007a6daa0a8270
Toggle commit list
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