def create_glue_app(): filename = os.path.join(TEST_DATA_PATH, 'data_cube.fits.gz') # We need to make sure that the data factories have been instantiated # before creating the glue application below. Otherwise the test data file # will not be recognized and the application will hang waiting for user input. from ..data_factories import DataFactoryConfiguration dfc = DataFactoryConfiguration() app = GlueApplication() app.run_startup_action('cubeviz') app.load_data(filename) app.setVisible(True) return app
from glue.app.qt import GlueApplication from glue.viewers.image.qt import ImageViewer from glue.viewers.histogram.qt import HistogramViewer from glue.viewers.scatter.qt import ScatterViewer from glue.core.edit_subset_mode import AndNotMode, ReplaceMode from glue.core.link_helpers import LinkSame ga = GlueApplication() ga.resize(1230, 900) ga.show() ga.app.processEvents() ga.screenshot('main_window1.png') image = ga.load_data('w5.fits') image.label = 'W5' ga.app.processEvents() ga.screenshot('data_open.png') image_viewer = ga.new_data_viewer(ImageViewer, data=image) image_viewer._mdi_wrapper.resize(450, 400) image_viewer.state.layers[0].v_min = 440 image_viewer.state.layers[0].v_max = 900 image_viewer.state.layers[0].stretch = 'sqrt' image_viewer.state.reset_limits() ga.app.processEvents() ga.screenshot('main_window2.png')