Commit 8efe6ba5 authored by  Hector Salas's avatar Hector Salas

Replaces obs['id'] with obs.id

parent cfe7bd96
......@@ -20,7 +20,7 @@ def save_chi2(obs, variable, models, chi2, values):
"""Save the chi² and the associated physocal properties
"""
fname = 'out/{}_{}_chi2-block-{}.npy'.format(obs['id'], variable,
fname = 'out/{}_{}_chi2-block-{}.npy'.format(obs.id, variable.replace('/', '\/'),
models.iblock)
data = np.memmap(fname, dtype=np.float64, mode='w+',
shape=(2, chi2.size))
......
......@@ -216,7 +216,7 @@ def analysis(idx, obs):
else:
# It sometimes happens because models are older than the Universe's age
print("No suitable model found for the object {}. One possible origin "
"is that models are older than the Universe.".format(obs['id']))
"is that models are older than the Universe.".format(obs.id))
with gbl_ncomputed.get_lock():
gbl_ncomputed.value += 1
......
......@@ -32,6 +32,7 @@ class Observation(object):
"""
def __init__(self, row, cls):
self.redshift = row['redshift']
self.id = row['id']
self.fluxes = np.array([row[band] for band in cls.bands])
self.fluxes_err = np.array([row[band + '_err'] for band in cls.bands])
self.intprops = np.array([row[prop] for prop in cls.intprops])
......
Markdown is supported
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