Created
August 23, 2012 17:49
-
-
Save ChrisBeaumont/3439395 to your computer and use it in GitHub Desktop.
Scripting Glue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glue import core | |
from glue.core.data_factories import auto_data, tabular_data | |
from glue.core.link_helpers import Galactic2Equatorial, MultiLink | |
from glue.qt.glue_application import GlueApplication | |
from convert_xyz import galactic2xyz | |
# Load data from files | |
d = tabular_data('irdcs.fits') | |
d.label = "IRDC Catalog" | |
d2 = auto_data('mips_nessie.fits') | |
d2.label = "MIPS" | |
# Create Data Collection | |
dc = core.DataCollection([d, d2]) | |
#define the links | |
links1 = Galactic2Equatorial(d.id['_RAJ2000'], d.id['_DEJ2000'], | |
d2.id['World x: GLON-CAR'], | |
d2.id['World y: GLAT-CAR']) | |
dc.add_link(links1) | |
links2 = MultiLink([d2.id['World x: GLON-CAR'], d2.id['World y: GLAT-CAR']], | |
['gx', 'gy'], galactic2xyz) | |
dc.add_link(links2) | |
#start application | |
glue = GlueApplication(dc) | |
glue.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of setting up Glue using a python script. Posted to discuss whether scripting API can be simplified