Commit 481d8953 authored by Médéric Boquien's avatar Médéric Boquien

Use np.full() to create an array with all elements set to the same value.

parent e57cb6e6
......@@ -264,12 +264,11 @@ def complete_obs_table(obs_table, used_columns, filter_list, tolerance,
if name_err not in obs_table.columns:
obs_table.add_column(Column(
name=name_err,
data=np.ones(len(obs_table), dtype=float))*-9999.,
data=np.full(len(obs_table), -9999.)),
index=obs_table.colnames.index(name)+1
)
else:
obs_table[name_err] = np.ones(len(obs_table),
dtype=float)*-9999.
obs_table[name_err] = np.full(len(obs_table), -9999.)
obs_table[name_err] = adjust_errors(obs_table[name],
obs_table[name_err],
......
......@@ -171,8 +171,8 @@ def sed(idx):
gbl_params.from_index(idx))
if 'sfh.age' in sed.info and sed.info['sfh.age'] > sed.info['universe.age']:
model_fluxes = -99. * np.ones(len(gbl_filters))
model_variables = -99. * np.ones(len(gbl_analysed_variables))
model_fluxes = np.full(len(gbl_filters), -99.)
model_variables = np.full(len(gbl_analysed_variables), -99.)
else:
model_fluxes = np.array([sed.compute_fnu(filter_) for filter_ in
gbl_filters])
......
......@@ -83,7 +83,7 @@ def fluxes(idx):
sed.to_votable(OUT_DIR + "{}_best_model.xml".format(idx))
if 'sfh.age' in sed.info and sed.info['sfh.age'] > sed.info['universe.age']:
model_fluxes = -99. * np.ones(len(gbl_filters))
model_fluxes = np.full(len(gbl_filters), -99.)
else:
model_fluxes = np.array([sed.compute_fnu(filter_) for filter_ in
gbl_filters])
......
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