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
issue when setting multiple bands in bandflux / bandmag #346
Comments
Hi Mickael, We can take a look at the documentation and see if it can be made a little clearer, but the issue here is that the length of Hence:
works. If I wanted to do what I think you want (fluxes at times in both ztfg and ztfr), I would probably do
|
Hi @rbiswas4, Thanks for the quick reply. This is indeed what I want, and what you provide almost works. It is however not very clean and satisfying. I would like to do something like this: from scipy import stats
xx = np.linspace(-10,10, 100)
means = [0,1,2]
pdfs = stats.norm.pdf(xx[:,None], loc=means, scale=1).T
# here pdfs is a 3*1000 array, 1 pdf for the full xx for each "loc" Does this make sense ? If this could be implemented that would be nice, if not, the solution you made (+ the reshape) works. |
Hi @MickaelRigault, (reply updated with url for sncosmo-eps mentioned before) Thanks for your suggestions. While I agree that the kind of API you show is closer to what we expect in That said, I have needed to do exactly what you were trying many times before. So, I think having functionality that achieves this is beneficial. There are ways to achieve what you are suggesting, without changing the API behavior in use. One possibility is to overload the function, so that when the length of BTW, I also saw your message about a different way to do what I suggested and actually prefer your |
@MickaelRigault, is this now a request to clarify the best practice in the documentation? |
that could be nice indeed if there is no aim to change the API. |
Hello guys,
given the documentation of sncosmo, I should be able to input a list of bands when I want to get a lightcurve (
bandflux
orbandmag
) for a given model.I fails here:
sncosmo/models.py:151, in _bandflux
because:
Here is a minimal example:
This works:
This does not for broadcast reasons, but it makes sense
This should work but does not:
The text was updated successfully, but these errors were encountered: