-
Notifications
You must be signed in to change notification settings - Fork 109
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
Extinction for chromatic objects #541
Comments
I think that sounds very cool! |
Applying extinction to an SED should be as simple as multiplying it by a function of wavelength, I think, which is already supported. I'd be happy to see some methods added to make this more convenient, though. We could steal this file from astropy/specutils and add it to the GalSim repository (which I believe is allowed by the specutils BSD license), and/or modify it if needed to conform to GalSim conventions. A more complicated question is whether it makes sense to be able to add extinction to ChromaticObjects inside of drawImage. I think this is okay, but we would need to think through all the possible (or at least meaningful) combinations of sums and convolutions of profiles. Another thing to consider is whether to provide keywords for both Milky Way and host galaxy extinction in drawImage. |
Oh, that's handy. I think we should steal and modify, which I believe is permitted.
Hmmmm. I originally thought "of course it does" because you could imagine getting an extincted SED and then using it for a bunch of objects. In what case do you think this could be problematic? Are you worried about people adding two objects corresponding to galaxy components, and forgetting to apply extinction to one of them? If there are any problematic cases, we could simply have SEDs store whatever extinction law has been applied to them, so we can check for those problematic cases and throw an exception or warning when they happen.
I worry about making drawImage really cumbersome. For a single type of extinction, we presumably will have to require people to pass in Another option would be as follows:
|
Personally, I think it makes more sense to have As Josh said, this is already possible by multiplying the object by a function:
Having a
I think that's clearer than adding extinction parameters to the
vs.
Another possible UI for this would be to have an
And the same syntax would work to apply it to an SED. (At least I think you can currently multiply two SEDs together.)
|
I would think it would be the case that the result should be the same regardless of whether you do
You can multiply an SED by a callable function, and an SED is a callable function, so I would think this would work. Hopefully Josh will set me straight if I'm wrong. Is there any reason not to have a bare |
It is. But if you already have the galaxy profile made, you don't want to have to remake it multiple times to view it at different galactic latitudes by applying the extinction separately to each component. Plus, we may someday have chromatic galaxies that are not separable this way, so it might not be possible to effect an extinction only via the SED.
That would be a bit unpythonic. The maxim is one and only one obvious way to do anything. Plus if |
Yes, I realize that, the reason i was asking is that there are some applications where people will want to actually check out / manipulate / plot the extinction they are using, so having an extinction function would facilitate that. Having both would facilitate that at the expense of making multiple ways to draw an object with extinction. |
Why not just use the function version then? I don't see the need for the |
Yes, I guess that makes sense. I volunteer to do this (relatively small) bit of work sometime in the next ~month or so. If someone is super eager and wants to jump in and do it first, that’s fine with me ;) but I am happy to do it myself if that doesn’t happen! |
This does probably work right now but it's kind of a side-effect. I never intended for I'm a bit torn about applying extinction directly to |
Just realized I never responded to this: if this wasn't an intended use (multiplying |
Hi @rmandelb, One other small point is that I'm not sure we actually want to allow multiplication by |
Sorry, I actually meant to say "multiplying by an extinction function" (that is a function of wavelength), not multiplying by an SED object per se. |
I figured :), but thought it was worth raising the question: should we actively try to catch and raise an exception if you try to multiply a |
I think this could be valid either way:
Either of these options seems fine by me. |
I'd vote for option 2 for two related reasons:
|
I also prefer option 2. |
Also a vote for 2 from me, I think the arguments you put forward are persuasive Josh! |
I've been thinking about the issue of extinction for chromatic objects. For example, for photo-z tests or whatever you might want to be able to draw an image through various bandpasses and also allow for a different extinction law and extinction zero-point.
I thought of a few options and am curious for opinions on what makes the most sense (pinging @jmeyers314 @barnabytprowe @rmjarvis ):
withExtinction
that will create a new SED object from another one, with an extinction law applied (as specified via kwargs),ChromaticObject.drawImage()
method that applies the extinction at the time of drawing, without requiring a new SED to be created.I can see a use for both of these. The first could be useful if you anticipate re-using the object with extinction and don't want to have to do the calculations each time you draw, but the second could be useful if you only plan to use the object once.
Any thoughts? Any interest? :)
The text was updated successfully, but these errors were encountered: