コード例 #1
0
# This is a script that can be used to reproduce the screenshots for the
# Getting Started guide. The idea is that as we update glue, we can easily
# regenerate screenshots to make sure we include the latest ui.

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()
コード例 #2
0
ファイル: make_screenshots.py プロジェクト: glue-viz/glue
# This is a script that can be used to reproduce the screenshots for the
# Getting Started guide. The idea is that as we update glue, we can easily
# regenerate screenshots to make sure we include the latest ui.

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()