Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update convex hull code #789

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
added 'beast_idx' to obs files for simulations being split
  • Loading branch information
christinawlindberg committed May 23, 2024
commit 886c074e3289616ad2bedf1e4da5133960295087
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
Loading