Skip to content

Commit

Permalink
added 'beast_idx' to obs files for simulations being split
Browse files Browse the repository at this point in the history
  • Loading branch information
christinawlindberg committed May 23, 2024
1 parent 63ebe6a commit 886c074
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beast/fitting/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@ def IAU_names_and_extra_info(obsdata, surveyname="PHAT", extraInfo=False):
obsfiltname = obsdata.filter_aliases[filtername]
r[filtername] = (obsdata.data[obsfiltname] * obsdata.vega_flux[k]).astype(float)

# if running a simulation, propagate beast_idx numbers to resort to input obs file
if "beast_idx" in list(obsdata.data.keys()):
r["beast_idx"] = obsdata.data["beast_idx"]

return r


Expand Down
3 changes: 3 additions & 0 deletions beast/tools/split_simulated_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def split_simulated_catalog(
"""
cat = Table.read(catfile)

# add index column to help sort merged files later
cat["beast_idx"] = np.arange(len(cat))

# write out sub-files, if chosen
if (n_per_file is not None) or (min_n_subfile is not None):

Expand Down

0 comments on commit 886c074

Please sign in to comment.