Conversation
|
Thanks for the review, @mwcraig ! I added a test, as requested. |
|
p.s. Do I also have to open an issue in @eteq 's API thingy? |
| kwargs : dict | ||
| Extra keywords to be passed into the viewer's file handler. | ||
|
|
||
| """ |
There was a problem hiding this comment.
@pllim, you might want to use:
from ginga.util import loader
image = loader.load_data(filename, **kwargs)
if not isinstance(image, AstroImage):
raise ValueError("Default index in '{}' does not reference an image".format(filename))
self._viewer.set_image(image)There was a problem hiding this comment.
Do you have a parameter for specifying HDU or some kind of index in the astrowidget load API? Because you could pass it in to idx in this load_data call.
There was a problem hiding this comment.
This new method is meant more for ASDF than for FITS, though ideally it would work on either one if the Ginga file loader registry is set up properly.
|
@ejeschke , test is failing because |
May as well, yes |
|
We agreed to do refactor this file loading API and have it be backend agnostic. See notes from Astropy Coordination Meeting 2023. |
This would fix #64 indirectly, as theoretically I could implement whatever Ginga file handler I want outside of the widget, register it with Ginga, and then simply use this to open my custom file format.
https://github.com/ejeschke/ginga/blob/bbfe6455d302266c1bfd3f01bd386fbc2494f3db/ginga/AstroImage.py#L186
I can add a test if you think this is an acceptable way forward. I am open to discussions. Thanks!
Depends on: ejeschke/ginga#764
cc @ejeschke