Programmatically loading a custom viewer ?

4 views
Skip to first unread message

Jonathan Gagné

unread,
Oct 8, 2021, 2:03:17 PM10/8/21
to Glue users
Hi all,

I am trying to load a custom viewer at launch from a Python file, something like this:

import numpy as np

from glue.core import Data, DataCollection
from glue.app.qt.application import GlueApplication
from glue.viewers.scatter.qt import ScatterViewer
from glue.core.data_factories import load_data

# create some data
dc = DataCollection()
data = load_data('base_glue_data.fits')
dc.append(data)

# create a GUI session
ga = GlueApplication(dc)

scatter = ga.new_data_viewer(ScatterViewer, data=data)

With the exception that I would like the new viewer to be a custom viewer that I have defined in my config.py file. However, I was unable to find where the custom viewer class gets recorded; probably somewhere inside "ga", given that the custom.py file seems to be read and loaded at the step where I do "ga = GlueApplication(dc)". I was unable to find  my custom viewer anywhere inside of "ga", however. Any help would be appreciated.

Thanks,
Jonathan

Reply all
Reply to author
Forward
0 new messages