Closed mperrin closed 6 years ago
Some other enhancement suggestions on the PSF creator script. These could be separate issues but for now I'm going to lump 'em all in here.
add_distortion
is left at its default value True
), but the PSF used in the library is the undistorted one. The distortion code slows the calculation down for no benefit in that case. I think it would be nice to make this a switch in the PSF lib creator: cases that don't need the distortion details exactly right can turn it off for faster library generation, but if it's turned on then it should be the distorted PSF that gets used in the library. Adding to the second bullet point, @KevinVolkSTScI mentioned that he wants the simulator to have an option where a single default PSF is used for all sources. So in that case, it may make sense to have a library consisting of a single PSF. If he wanted a case where the PSF used is exactly the same, then he could create a "library" containing a single PSF at the nominal pixel scale, so there is no spatial dependence across the detector, nor for sub-pixel shifts.
What's the benefit of not even allowing any sub-pixel shifts? That will bias all the source photometry by effectively rounding the positions of all sources to the nearest integer pixel. We could certainly do that; I'm just trying to understand better the use case.
(Sorry for the late reply, I have been on vacation the past 8 days.)
The purpose of having a single default PSF is to simulate a focus sweep observation for commissioning, with a defocussed PSF from WebbPSF. In such a case, we are not concerned about getting the stars to the correct sub-pixel position, and we are also not concerned about the photometry bias effect. Otherwise, there are a few other cases where we may not care about getting the stars to the right sub-pixel positions in simulations and having a single (small) default PSF file would be an advantage as one would not need to make a big PSF library calculation to do such simulations.
The question in the context of this PSF library change is how can I make such a "library" image for the defocussed case? I have a little WebbPSF driver code to make individual PSFs with some amount of defocussing, but it makes only one PSF at a time and writes out a single two-dimensional file. I suppose it is not difficult to "re-package" such a file in the format that the new PSF library files have.
For NIRISS it seems that changing the (x,y) pixel position makes no difference in the output PSF -- at least, I tried this in version 0.7.0 and there was no change in the PSF for the center of the array or the corner of the array. I might have been doing something wrong, of course.
@shanosborne, more suggestions for improvements to the library generation code, just in case you didn't see this thread earlier.
Solved by #162. I'll move the discussion about a default PSF to a separate issue.
Right now if you ask for just a short-wave filter, it doesn't know that must mean you only want the short wave detectors.
An improved approach might be to test if all the requested filters are short wave, and if so set the detector to short wave:
etc.
Alternatively, perhaps the 'all' mode could simply skip over any invalid combinations, without stopping program execution?