Closed kammerje closed 3 weeks ago
As an IMPORTANT note, the following code needs to be added to pyklip.rdi.py in order to make RDI work with high-pass filtering (after line 56):
if isinstance(highpass, bool): if highpass: data = high_pass_filter_imgs(data, numthreads=None) else:
if isinstance(highpass, (float, int)):
highpass = float(highpass)
fourier_sigma_size = (data.shape[1]/(highpass)) / (2*np.sqrt(2*np.log(2)))
data = high_pass_filter_imgs(data, numthreads=None, filtersize=fourier_sigma_size)
This plot shows the new background removal step and how it improves the measured contrast (injected contrast = 1e-4):
For point 1 about pixel scale, we ought to be able to do more than assume what the pipeline is doing. Let’s ask the developers.
The subtle part is that there is not a single unique correct pixel area; it varies slightly over the field of view due to optical distortions. So we should also double check which field point is being referred to. These are going to be tiny differences I expect but we should quantify.
For point 1 about pixel scale, we ought to be able to do more than assume what the pipeline is doing. Let’s ask the developers.
The subtle part is that there is not a single unique correct pixel area; it varies slightly over the field of view due to optical distortions. So we should also double check which field point is being referred to. These are going to be tiny differences I expect but we should quantify.
Yes, please do so! The main interest for me is to reverse exactly what the JWST pipeline did when it converted Jy to Jy/sr.
For point 1 about pixel scale, we ought to be able to do more than assume what the pipeline is doing. Let’s ask the developers. The subtle part is that there is not a single unique correct pixel area; it varies slightly over the field of view due to optical distortions. So we should also double check which field point is being referred to. These are going to be tiny differences I expect but we should quantify.
Yes, please do so! The main interest for me is to reverse exactly what the JWST pipeline did when it converted Jy to Jy/sr.
It turns out the pipeline is getting the average pixel area for each mode from the PHOTOM calibration files in CRDS. See docs here for that calibration step: https://jwst-pipeline.readthedocs.io/en/stable/jwst/photom/main.html Specifically the subsection entitled “Pixel area data”
As an IMPORTANT note, the following code needs to be added to pyklip.rdi.py in order to make RDI work with high-pass filtering (after line 56):
if isinstance(highpass, bool): if highpass: data = high_pass_filter_imgs(data, numthreads=None) else: # should be a number if isinstance(highpass, (float, int)): highpass = float(highpass) fourier_sigma_size = (data.shape[1]/(highpass)) / (2_np.sqrt(2_np.log(2))) data = high_pass_filter_imgs(data, numthreads=None, filtersize=fourier_sigma_size)
Yesterday I put in a pull request with a similar fix within pyklip!
@AarynnCarter @semaphoreP @mperrin (tagging all relevant people)
After some time of silence, I finally found the time to finish preparing this big PR from dev/jk
into develop
. In preparation for this PR, I have already merged develop
into dev/jk
a few days ago, resolved all the conflicts, tested things with the ERS data, and included a couple of additional fixes and improvements. Below, you can find a list of all the updates that this PR includes. Items in bold are new compared to the list posted at the top of this PR (several months ago). I recommend merging this PR as soon as possible before develop
diverts too far from dev/jk
again and new merging conflicts arise!
As an additional note for @semaphoreP, this PR is fully compatible with the pyKLIP
jwst
branch which I also updated this week. I reverted back to the previous version which does not need pysiaf
as a dependency and also implemented a fallback option for when the SVO FPS is unavailable (see here).
pysiaf
pixel scale and propagate it through the spaceKLIP
database.pyKLIP
JWST class and enabling processing of data without PIXAR_A2
SCI header keyword while not invoking additional dependencies on pyKLIP
. This is required to process data for which the JWST pipeline photometry step has been skipped for instance.make_psfmasks.py
.
This is a big PR comprising of multiple improvements and fixes: