AstarVienna / ScopeSim

A telescope observation simulator for Python.
GNU General Public License v3.0
13 stars 10 forks source link

Order of set_modes should not be important, but it is ... #150

Open astronomyk opened 2 years ago

astronomyk commented 2 years ago

Another (minor?) thing that Fraser and I encountered. The order of the set_modes options in the UserCommands() is quite important. While set_modes=["SCAO", "SPEC_15000x50"] works beautifully, set_modes=["SPEC_15000x50", "SCAO"] does not, as it raises an AttributeError (‘NoneType’ object has no attribute ‘header’).

Not a major issue of course, but some sort of check or raised suggestion would improve the user experience. :leichtes_lächeln:

yosata commented 2 years ago

Only an issue for the SPEC modes (SPEC_15000x50, SPEC_3000x50, etc.).

For imaging modes, the image is simulated just fine.

oczoske commented 2 years ago

The error occurs in FieldConstantPSF.get_kernel when trying to access fov.hdu.header while making a wavelength-dependent PSF cube. I'm lacking insight and time to investigate further. Given that there is something of a "natural" order in that SCAO is upstream of the spectroscopic elements, I wouldn't consider this particularly urgent.