kammerje / jwst-kpi

Kernel phase pipeline for JWST.
GNU General Public License v3.0
3 stars 2 forks source link

More flexible workflow for pupil model & re-enable pupil rotation #13

Open vandalt opened 2 years ago

vandalt commented 2 years ago

Currently, the pupil model is used directly from the jwst subdirectory and the path is hardcoded. Two things that could add more flexbility would be:

@kammerje let me know what you think. The first item is probably simple to implement. The second one is a bit more involved.

kammerje commented 2 years ago

Yes, we should certainly allow the user to specify a path for the pupil model. However, I feel like for generating different pupil models there is already XARA and we can simply provide some example ones.

IMPORTANT: I just noticed that XARA does not handle my rotated pupil properly when computing the kernel of the A matrix (see Martinache 2010 for the definition of the A matrix). This caused significant deviations between the Fourier power of a point source and the redundancy of the baselines. I fixed the issue for now by simply ignoring the pupil rotation. This should be fine for NIRISS and NIRCam given that the pupil rotation for these instruments is <~1 deg but ultimately we need to apply the pupil rotation BEFORE generating a pupil model with XARA.

The attached plots show the Fourier power of a point source and the redundancy of the baselines for a 10% undersized and the default pupil model. The agreement for the default pupil model is significantly better than for the 10% undersized one. However, without undersizing a lot of noisy baselines contribute to the computation of the kernel phases which is non-ideal. While the default pupil model is good to check the agreement between the Fourier power of a point source and the redundancy of the baselines it is not suitable for computing the kernel phases. For now, I would suggest to use the 10% undersized pupil model for computing the kernel phases.

amp_vs_red_default.pdf amp_vs_red_undersized.pdf kerphase_default.pdf kerphase_undersized.pdf

kammerje commented 2 years ago

I think we can add some text to the documentation that the input pupil model needs to be correctly rotated as appearing on the detector. Then, we can close this issue. Our NIRISS and NIRCam pupil models do not need to be rotated because the pupil rotation as seen by the detector is small (<1 deg).