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

Redshift wavelength calculation now done in double precision #22

Merged
merged 1 commit into from
Sep 13, 2016

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Sep 13, 2016

Redshift wavelength calculation now done in double precision. Otherwise, some wavelengths are merged unnecessarily, resulting in loss in sampling. Example:

>>> import pysynphot as S
>>> from pysynphot.spparser import parse_spec
>>> obsmode = 'wfc3,uvis1,f555w'
>>> spectrum = ('rn(z(spec($PYSYN_CDBS/calspec/bd_28d4211_stis_001.fits),'
...             '0.1),band(johnson,b),28.0,vegamag)')
>>> sp = parse_spec(spectrum)
>>> bp = S.ObsBandpass(obsmode)
>>> obs = S.Observation(sp, bp)
>>> obs_ref.wave[11044:11049]  # AFTER this fix
array([ 8721.        ,  8722.        ,  8722.39453125,  8722.39467773,
        8723.        ])

Without this fix, 8722.39453125, 8722.39467773 are merged as 8722.39453125 under single-precision calculations.

@pllim pllim added the bug label Sep 13, 2016
@pllim pllim self-assigned this Sep 13, 2016
@pllim pllim merged commit d6c7613 into spacetelescope:master Sep 13, 2016
@pllim pllim deleted the redshift-float64 branch September 13, 2016 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant