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

DET_OVERSAMP header keyword does not return detector oversampling #201

Open
douglase opened this issue Jan 16, 2017 · 1 comment
Open

DET_OVERSAMP header keyword does not return detector oversampling #201

douglase opened this issue Jan 16, 2017 · 1 comment

Comments

@douglase
Copy link
Contributor

When the MFT detector sampling is not equal to the wavefront oversampling the correct value is not passed to the output FITS file header.

Example code:

osys = poppy.OpticalSystem(oversample=18)
osys.add_pupil(poppy.CircularAperture())
osys.add_detector(0.1, fov_pixels=30,oversample=10)
psf=osys.calc_psf()
psf[0].header["OVERSAMP"], psf[0].header["DET_SAMP"]

returns:
(18,18)

rather than (18,10) as expected.

@mperrin
Copy link
Owner

mperrin commented Jan 17, 2017

Argh, good catch. I have to admit, the multiple types of oversampling available is sort of a confused and tricky area of the code, for various historical reasons.

The wavefront oversampling is set when instantiating a Wavefront object, and stored as an object attribute which persists throughout the calculation. The detector oversampling isn't; it's read from the Detector object inside Wavefront._propagate_mft. The cleanest fix here is probably to modify that function to record the detector oversampling as another attribute, and update Wavefront.as_fits correspondingly.

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

2 participants