spacetelescope / synphot_refactor

Synthetic photometry using Astropy
http://synphot.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
39 stars 25 forks source link

Tapering behavior for Observation is confusing #217

Closed pllim closed 4 years ago

pllim commented 5 years ago

@mgennaro is going to post more details about this. In a nutshell, when bandpass data ends abruptly without being tapered, Observation extrapolates the bandpass and there does not seem to be an easy way to control that behavior. On the contrary, when source spectrum data ends abruptly, it can be controlled using force keyword.

mgennaro commented 5 years ago

Thanks @pllim for filing this...and sorry for my delay. I don't have much to add to your description except:

obs  = sp.Observation(spectrum, b.taper())
pllim commented 5 years ago

I vaguely remember a campaign some time ago to explicitly taper all the HST throughput files to avoid just this problem, or am I just imagining it? Maybe @rizeladiaz or @vglaidler remember.

pllim commented 5 years ago

For the record, I am not opposed to changing the behavior but there is backward compatibility issue to consider, as this effects ETC itself. Maybe I should ping @ibusko too.

ibusko commented 5 years ago

The HST ETC uses force='taper' whenever a PartialOverlap exception is raised by Pysynphot (not the new synphot! Since the code wasn't refactored yet to connect to synphot).

vglaidler commented 5 years ago

vaguely remember a campaign some time ago to explicitly taper all the HST throughput files to avoid just this problem, or am I just imagining it? Maybe @rizeladiaz or @vglaidler remember.

Yes, this is correct. The rationale is that the software should not be trying to guess what to do; the user should provide data that has the correct behavior. That is the most transparent and explicit approach, and thus safest from the perspective of "is the ETC giving the correct answer".

In the original pysynphot, the force keyword was designed to handle the situation of partial overlap either by tapering to zero, or by extrapolating (don't recall whether it was linear extrapolation, or extrapolation at constant value).

Note that this design decision was reached by a combined group of software folks and scientists, trying to handle all use cases both correctly and with, at least, an ease-of-use option for users.

A significant topic in this discussion was that "absence of data does not equal zero data": that is, if a throughput file (or spectrum file, for that matter) contains no data, it is explicitly not correct to fill the missing data with zeros.

pllim commented 4 years ago

I think the conclusion here is that we won't change the software behavior.