Skip to content

Commit

Permalink
Merge pull request #812 from christinawlindberg/master
Browse files Browse the repository at this point in the history
added indexing for simulated obsdata being split (i give up)
  • Loading branch information
karllark committed May 23, 2024
2 parents 150bd4e + 46af310 commit a66947b
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 a66947b

Please sign in to comment.