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

ValueError: operands could not be broadcast together with shapes (4,) (200710,31,7) #65

Open
cress1234 opened this issue Mar 27, 2019 · 3 comments

Comments

@cress1234
Copy link

cress1234 commented Mar 27, 2019

Using the example exactly as in the documentation with the example files (none of my own input data), I get this error. It is flagging this line

>residual = log_flux - model_fluxes

Here is the whole error message:

ValueError                                Traceback (most recent call last)
<ipython-input-3-8bf1c972f8ac> in <module>()
     14 
     15 # Run the fitting
---> 16 fit('sedlist.txt', filters, apertures, model_dir,'output.fitinfo',extinction_law=extinction,n_data_min=2,distance_range=[1., 2.] * u.kpc,av_range=[0., 40.])

~\Anaconda3\lib\site-packages\sedfitter\fit.py in fit(data, filter_names, apertures, model_dir, output, n_data_min, extinction_law, av_range, distance_range, output_format, output_convolved, remove_resolved)
    235         if s.n_data >= n_data_min:
    236 
--> 237             info = fitter.fit(s)
    238 
    239             if not output_convolved:

~\Anaconda3\lib\site-packages\sedfitter\fit.py in fit(self, source)
    116 
    117         info = self.models.fit(source, self.av_law, self.sc_law,
--> 118                                self.av_range[0], self.av_range[1])
    119 
    120         info.meta.model_dir = self.model_dir

~\Anaconda3\lib\site-packages\sedfitter\models.py in fit(self, source, av_law, sc_law, av_min, av_max, output_convolved)
    370 
    371             # Use optimal scaling to fit the Av
--> 372             residual = log_flux - model_fluxes
    373             av_best = f.optimal_scaling(residual, weight, av_law)
    374 

ValueError: operands could not be broadcast together with shapes (4,) (200710,31,7) 
@jsmonzon
Copy link

Same error pops up for me when I try following the example. What are we doing wrong?

@mattpovich
Copy link

mattpovich commented Jul 11, 2019 via email

@jsmonzon
Copy link

Thanks for the tip!

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

No branches or pull requests

3 participants