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
663fb23b
Commit
663fb23b
authored
10 years ago
by
Hal Simpson
Browse files
Options
Downloads
Patches
Plain Diff
Made changes and added a test, to deal with new observatory metadata dictionary format
parent
468d54e4
No related branches found
Branches containing commit
Tags
3.11.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/edge/ObservatoryMetadata_test.py
+32
-19
32 additions, 19 deletions
geomagio/edge/ObservatoryMetadata_test.py
with
32 additions
and
19 deletions
geomagio/edge/ObservatoryMetadata_test.py
+
32
−
19
View file @
663fb23b
...
@@ -7,28 +7,40 @@ import obspy.core
...
@@ -7,28 +7,40 @@ import obspy.core
METADATA
=
{
METADATA
=
{
'
BOU
'
:
{
'
BOU
'
:
{
'
station_name
'
:
'
Boulder
'
,
'
data_interval_type
'
:
{
'
agency_name
'
:
'
United States Geological Survey (USGS)
'
,
'
minute
'
:
'
filtered 1-minute (00:15-01:45)
'
,
'
geodetic_latitude
'
:
-
90
,
'
second
'
:
'
Average 1-Second
'
'
geodetic_longitude
'
:
-
180
,
},
'
elevation
'
:
-
1000
,
'
metadata
'
:
{
'
sensor_orientation
'
:
'
HDZF
'
,
'
station_name
'
:
'
Boulder
'
,
'
sensor_sampling_rate
'
:
'
0.01 second
'
,
'
agency_name
'
:
'
United States Geological Survey (USGS)
'
,
'
data_interval_type
'
:
'
filtered 1-minute (00:15-01:45)
'
,
'
geodetic_latitude
'
:
-
90
,
'
declination_base
'
:
20000
,
'
geodetic_longitude
'
:
-
180
,
'
is_intermagnet
'
:
False
,
'
elevation
'
:
-
1000
,
'
conditions_of_use
'
:
'
The Conditions of Use for data provided
'
+
'
sensor_orientation
'
:
'
HDZF
'
,
'
through INTERMAGNET and acknowledgement templates can be
'
+
'
sensor_sampling_rate
'
:
'
0.01 second
'
,
'
found at www.intermagnet.org
'
,
'
declination_base
'
:
20000
,
'
filter_comments
'
:
'
Vector 1-minute values are computed from
'
+
'
is_gin
'
:
False
,
'
1-second values using the INTERMAGNET gaussian filter
'
+
'
is_intermagnet
'
:
False
,
'
centered on the minute. Scalar 1-minute values are
'
+
'
conditions_of_use
'
:
'
The Conditions of Use for data provided
'
+
'
computed from 1-secondvalues using the INTERMAGNET
'
+
'
through INTERMAGNET and acknowledgement templates
'
+
'
gaussian filter centered on the minute.
'
,
'
can be found at www.intermagnet.org
'
,
'
filter_comments
'
:
'
Vector 1-minute values are computed from
'
+
'
1-second values using the INTERMAGNET gaussian filter
'
+
'
centered on the minute. Scalar 1-minute values are
'
+
'
computed from 1-secondvalues using the INTERMAGNET
'
+
'
gaussian filter centered on the minute.
'
}
}
}
}
}
DATA_INTERVAL_TYPE
=
{
'
minute
'
:
'
filtered 1-minute (00:29-01:30)
'
,
'
second
'
:
'
filtered 1-Second
'
}
def
test_set_metadata
():
def
test_set_metadata
():
"""
geomagio.edge.ObservatoryMetadata_test.test_set_metadata()
"""
geomagio.edge.ObservatoryMetadata_test.test_set_metadata()
"""
"""
...
@@ -47,7 +59,8 @@ def test_set_metadata():
...
@@ -47,7 +59,8 @@ def test_set_metadata():
# Test custom metadata
# Test custom metadata
stats
=
obspy
.
core
.
Stats
()
stats
=
obspy
.
core
.
Stats
()
observatorymetadata
=
ObservatoryMetadata
(
METADATA
)
observatorymetadata
=
ObservatoryMetadata
(
METADATA
,
DATA_INTERVAL_TYPE
)
observatorymetadata
.
set_metadata
(
stats
,
'
BOU
'
,
'
MVH
'
,
observatorymetadata
.
set_metadata
(
stats
,
'
BOU
'
,
'
MVH
'
,
'
quasi-definitive
'
,
'
second
'
)
'
quasi-definitive
'
,
'
second
'
)
assert_equals
(
stats
[
'
declination_base
'
],
20000
)
assert_equals
(
stats
[
'
declination_base
'
],
20000
)
assert_equals
(
stats
[
'
data_interval_type
'
],
'
filtered 1-Second
'
)
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