beast icon indicating copy to clipboard operation
beast copied to clipboard

metal_small example failing at make_ast_inputs

Open crobinett1 opened this issue 1 year ago • 2 comments

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,)

crobinett1 avatar Jul 19 '23 19:07 crobinett1

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.

karllark avatar Jul 20 '23 17:07 karllark

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.

crobinett1 avatar Jul 26 '23 18:07 crobinett1