Closed laurenmarietta closed 5 years ago
There are several parts of this, with multiple axes of complexity.
On the other hand, it's not all bad: for these OTE commissioning cases we will almost never care about field dependence, so the PSF "library" could reduce down to just a single PSF per each SCA. And at minimal subpixel sampling as well.
I've finally had time to read through your example notebook OTECommissioning_simulator_use_examples.ipynb
I hadn't realized that the calls to MIRAGE generate many YAML files at once from a given program but then only actually simulate one image at a time. Good to know! This suggests that it may not be so hard to handle telescope state changes during the observations, since each exposure within that observation will actually be done with a separate call to MIRAGE. Yes?
I can imagine a process something like:
Does that approach sound about right to you, @laurenmarietta?
That approach definitely makes sense!
The main question I have is, if we would be generating one PSF library file per exposure, is it really worthwhile to generate the PSF libraries at all? Why not just generate the PSFs on-the-fly (since that would be already happening from a computational standpoint anyway)? Do you think we gain something by having that particular set of PSF library files to pull from in the future? I'm also thinking about how we might want to use MIRAGE to create, for example, multiple different versions of OTE-12, with the telescope at different states (different roles of the dice). So we would end up with a separate library not only for each commissioning step, but also for each specific telescope state for each commissioning step. What are your thoughts?
But besides the library v. on-the-fly question, I think this method sounds great. I would be happy to start playing around with the implementation, if I could access some OPD/SUR files?
is it really worthwhile to generate the PSF libraries at all? Why not just generate the PSFs on-the-fly (since that would be already happening from a computational standpoint anyway)? Do you think we gain something by having that particular set of PSF library files to pull from in the future?
The main benefit might just be code simplicity: avoiding any need for multiple different interfaces inside MIRAGE for how it gets PSFs. It could just always read in PSFs via the library interface, rather than having to have separate interfaces for library and also on-the-fly. And for realistic scenes with more than one star in the FOV, you wouldn't want to redo the on-the-fly calculation for every individual star, so you'd need the on-the-fly interface to save them, which would end up in practice being a small library, right?
I completely agree with you that it wouldn't be likely we'd reuse that PSF library file in the future. Might be that we just create it, run MIRAGE, and then throw it away.
As for getting SURs, any of Keira, Chris, Marcio, Greg, or Tom should have lots of those they can give you from their ITM simulation runs. You can also create some manually in the WEx; there's a simple graphical interface for making them. They're just XML files listing a set of requested mirror moves.
In webbpsf
, you'll want to use the move_sur
method in the OTE_Linear_Model_WSS
class. Something like:
nrc = webbpsf.NIRCam()
ote, nrc = webbpsf.enable_adjustable_ote(nrc)
ote.move_sur('some_filename.xml')
psf = nrc.calc_psf()
Fair point - I hadn't really started to think about how a deviation from the current library infrastructure might be challenging....
Thanks for the WebbPSF example! I emailed Marcio and he sent me a directory with SURs that I can play with, so I'll start investigating this soon.
I made some preliminary PSFs from SURs that Marcio provided me with, and they are looking like this (ignoring the ones that are blank):
Particularly during Image Stacking, I would have expected the PSFs to look much more diffuse. (Though this could very well be a result of my incomplete understanding of what exactly a SUR is and how it works in WebbPSF.) Do they look like you would have expected?
Additionally, I receive an error if providing any SURs that include a command to the secondary mirror:
SM not supported by move_seg_local. Use move_sm_local instead.
It seems like this is a result of the changes you made in this commit. If we want to update this, I get the sense that it might be an easy thing to add an if statement to handle SM moves in the code for move_sur()
.
This was implemented in #303.
Once we have developed and merged the infrastructure for how to query a PSF from the new library, we need to develop an off-ramp of that to use for commissioning data.
At the moment, my idea is that we would provide an OPD (optical path difference) file to provide the telescope mirror state and a SUR (segment update request) file to provide the mirror moves for any given step of commissioning. These can be input to WebbPSF to generate PSFs from any possible telescope configuration.
When MIRAGE is generating NIRCam images from commissioning, we'll need to do this (or something like this!) in order to generate the huge diversity of PSFs that will result from a frequently-changing observatory state.