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

metal_small example failing at make_ast_inputs #792

Open
crobinett1 opened this issue Jul 19, 2023 · 2 comments
Open

metal_small example failing at make_ast_inputs #792

crobinett1 opened this issue Jul 19, 2023 · 2 comments

Comments

@crobinett1
Copy link

In attempting to create an input AST list from the metal_small example, I am experiencing the following error which appears to be due to differing array dimensions in pick_models_toothpick_style.


ValueError Traceback (most recent call last)
Cell In[4], line 1
----> 1 make_ast_inputs.make_ast_inputs('beast_settings.txt')

File ~/miniconda3/lib/python3.10/site-packages/beast/tools/run/make_ast_inputs.py:79, in make_ast_inputs(beast_settings_info, pick_method)
76 min_N_per_flux = settings.ast_n_per_flux_bin
77 bins_outfile = "./{0}/{0}_ASTfluxbins.txt".format(settings.project)
---> 79 chosen_seds = pick_models_toothpick_style(
80 modelsedgrid_filename,
81 settings.filters,
82 N_fluxes,
83 min_N_per_flux,
84 outfile=outfile_seds,
85 outfile_params=outfile_params,
86 bins_outfile=bins_outfile,
87 )
89 if pick_method == "random_pick":
90
91 # construct magnitude cuts
92 mag_cuts = settings.ast_maglimit

File ~/miniconda3/lib/python3.10/site-packages/beast/observationmodel/ast/make_ast_input_list.py:188, in pick_models_toothpick_style(sedgrid_fname, filters, N_fluxes, min_N_per_flux, outfile, outfile_params, bins_outfile, bright_cut)
182 add_these[r] = True
184 # If all these bins are full...
185 else:
186 # ... do not include this model again, since we will reject it
187 # anyway.
--> 188 include_mask[idxs == rand_idx] = False
190 # Add the approved models
191 chosen_idxs.extend(rand_idx[add_these])

ValueError: operands could not be broadcast together with shapes (493713,) (100000,)

@karllark
Copy link
Member

Hummm.... I've tested most of the rest of the metal_small example in the past. But have to admit I have not been testing the make_ast_inputs part. Can you confirm that you are using the as provided beast_settings.txt? If so, I'll work on testing this and seeing if I can find a fix.

Thanks for opening an issue - much appreciated.

@crobinett1
Copy link
Author

The beast_settings.txt I am using is an exact copy of the one provided in the beast-examples/metal_small folder in the beast-examples repository.

Thanks for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants