Skip to content

Commit

Permalink
added indexing for simulated obsdata being split
Browse files Browse the repository at this point in the history
  • Loading branch information
christinawlindberg committed May 23, 2024
1 parent bcc8cb5 commit 568735c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions beast/fitting/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@ 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
4 changes: 4 additions & 0 deletions beast/tools/split_simulated_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ 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 568735c

Please sign in to comment.