Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Geodynamo
pygeodyn
Commits
e9aea9ac
Commit
e9aea9ac
authored
Aug 06, 2019
by
Loic Huder
Browse files
Fixed the reading order of errors for GOVO
parent
210d3d65
Changes
1
Hide whitespace changes
Inline
Side-by-side
pygeodyn/inout/observations.py
View file @
e9aea9ac
...
...
@@ -79,7 +79,10 @@ def build_go_vo_observations(cfg, nb_realisations, measure_type):
raise
IOError
(
"Variance {} file for observations was not found ! Check that {} is a valid file path."
.
format
(
measure_type
,
var_path
))
var_data
=
np
.
loadtxt
(
var_path
)
# Take only the diagonal of the variance
var_data
=
np
.
diag
(
np
.
loadtxt
(
var_path
))
assert
len
(
var_data
)
%
3
==
0
numberofVOs
=
len
(
var_data
)
//
3
# Draw a seed for normal draw
seed
=
np
.
random
.
randint
(
0
,
50000
)
...
...
@@ -101,8 +104,9 @@ def build_go_vo_observations(cfg, nb_realisations, measure_type):
for
j
in
range
(
0
,
3
):
n
=
3
*
i_obs
+
j
# Extract the var_data of the current observation thanks to the obs_id
# Format: [Br1, Br2, ..., BrN, Bth1, ..., BthN, Bph1, ..., BphN]
# The value stored is assumed to be sigma**2
sigma2
=
var_data
[
3
*
obs_id
+
j
,
3
*
obs_id
+
j
]
sigma2
=
var_data
[
j
*
numberofVOs
+
obs_id
]
var_at_date
.
append
(
sigma2
)
# Noise data with normal noise N(data, sigma)
noised_data_at_date
[:,
n
]
=
random_draw
(
obs_data
[
date
][
n
],
math
.
sqrt
(
sigma2
),
size
=
nb_realisations
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment