Commit ca81436e authored by Loic Huder's avatar Loic Huder
Browse files

Merge branch '66-fix-order-of-errors-in-govo-files' into 'master'

Resolve "Fix order of errors in GOVO files"

Closes #66

See merge request !38
parents 210d3d65 81de88c5
......@@ -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)
......
RELEASE_TYPE: patch
Fixed the reading order for errors of GOVO (wrong format was assumed).
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment