spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
115 stars 61 forks source link

Improved MIRI cruciform model using Fresnel diffraction #672

Open mperrin opened 1 year ago

mperrin commented 1 year ago

@merope82 informs me that @patapisp has developed an improved model of the cruciform effect seen in MIRI detectors. @patapisp tells me he intends to (eventually) contribute this to webbpsf, but the timescale is TBD, due to other ongoing projects (many... :-). This issue is just a reminder of that for the future, to plan to include this in some future version (i.e. beyond summer 2023, timescale TBD).

amn3142 commented 1 year ago

@patapisp would you be willing to share your algorithm (in whatever form it's currently in)?

patapisp commented 1 year ago

@amn3142 we are working on finalising the model, but I could share the code. At the moment however, it's not based on webbpsf and its physical optics module, but on an other package called diffractio.

obi-wan76 commented 9 months ago

Hi @patapisp, I wanted to follow-up in this old issue as we are very interested in improving MIRI cruciform model in webbpsf. I wonder if you finished working on a model that we can incorporate into webbpsf. I know this time of the year is a bit complicated but I wanted to remind ourselves about this issue.
I would appreciate any help with this or any advise on the best way to proceed. Thanks! Marcio

mperrin commented 9 months ago

And to be clear, we would be happy to take any half-baked work in progress too, and maybe we can lend a hand getting it moved along? Thanks!

patapisp commented 9 months ago

@obi-wan76 @mperrin That's a good suggestion! I will try to gather up everything I have and share it. It would be interesting to incorporate in webbpsf although I need to stress that we should define what the scope of this model would be (maybe this evolves as well).

patapisp commented 8 months ago

I have created a repository with a working cruciform simulation code for the MIRI Imager. Disclaimer: some of the parameters are set arbitrarily and therefore at the moment the simulation output is only qualitatively correct.

@obi-wan76 @mperrin since I am not sure of the scope and use of the model for webbPSF, I prefer to develop it independently and people interested can check it out. Should continue discussing how/if we should incorporate parts of the simulation to webbpsf.

Also tagging @YannisArgyriou who has been working on this with me in the past years.

mperrin commented 8 months ago

Thanks @patapisp ! I can verify that I have this installed and running now. Mostly; there are some minor path issues which caused problems saving outputs at the end of the first test.

Definitely let's continue discussions. I agree completely that it likely makes sense for now to keep these as separate codes, but I can imagine integrating them in such a way that (for instance) WebbPSF might import and call this code, optionally under some circumstances. Alternatively, perhaps we might try to derive some precomputed simplified lookup table of matching kernels for convolving a WebbPSF output to add this effect (improving on the very very simplified version currently in WebbPSF but still staying somewhat simplified.

I can see that it's quite time consuming to run (many minutes) but also it's running single-threaded. So should be possible to accelerate a lot via multiprocessing, too.

mperrin commented 8 months ago

And now that I have the code running, I have about a dozen different technical questions about how it works and the diffraction model physics and the assumptions and more... :-) This is really interesting and impressively sophisticated to say the least. Maybe we can set up a call sometime to chat together about this? Might be more efficient and more enjoyable than my typing a long list of questions to you here on GitHub... :-)