Skip to content

Commit

Permalink
Fix bug in write_collated_data - no longer writing halo_id to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
aphearin committed Nov 13, 2024
1 parent b319c93 commit 1628b82
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions diffmah/fitting_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,16 @@ def _check_for_logmah_vs_mah_mistake(mah_sim):
def write_collated_data(outname, fit_data_strings, chunk_arr=None):
import h5py

halo_id = fit_data_strings[:, 0].astype(int)
logm0 = fit_data_strings[:, 1].astype(float)
logtc = fit_data_strings[:, 2].astype(float)
early_index = fit_data_strings[:, 3].astype(float)
late_index = fit_data_strings[:, 4].astype(float)
t_peak = fit_data_strings[:, 5].astype(float)
loss = fit_data_strings[:, 6].astype(float)
n_points_per_fit = fit_data_strings[:, 7].astype(int)
fit_algo = fit_data_strings[:, 8].astype(int)
logm0 = fit_data_strings[:, 0].astype(float)
logtc = fit_data_strings[:, 1].astype(float)
early_index = fit_data_strings[:, 2].astype(float)
late_index = fit_data_strings[:, 3].astype(float)
t_peak = fit_data_strings[:, 4].astype(float)
loss = fit_data_strings[:, 5].astype(float)
n_points_per_fit = fit_data_strings[:, 6].astype(int)
fit_algo = fit_data_strings[:, 7].astype(int)

with h5py.File(outname, "w") as hdf:
hdf["halo_id"] = halo_id
hdf["logm0"] = logm0
hdf["logtc"] = logtc
hdf["early_index"] = early_index
Expand Down

0 comments on commit 1628b82

Please sign in to comment.