Created
April 8, 2011 17:21
-
-
Save augustfly/910311 to your computer and use it in GitHub Desktop.
notes as script on using ds9 private SAMP and public samp mtypes
This file contains hidden or 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
| # '/Users/aamn/Projects/VO_Projects/Python/Test_vaods9' | |
| import os | |
| import vao_intercom | |
| ds9c = vao_intercom.ds9Com() | |
| # find out where ds9 thinks it is | |
| ds9c.get('cd') | |
| # and make it where python is or you want to work | |
| p = os.path.abspath(os.curdir) | |
| ds9c.set('cd %s' % p) | |
| # i have an example file foo.fits in examples | |
| f = os.path.join(p,'examples','foo.fits') | |
| # push it over samp to ds9; set the cmap to heat; center; zoom to fit | |
| ds9c.set('file %s' % f) | |
| ds9c.set('cmap Heat') | |
| ds9c.set('frame center') | |
| ds9c.set('zoom to fit') | |
| # now try using the default mtype; be tricky and do it in an rgb cube | |
| # do it in the blue frame and reset the scaling | |
| # note: you have write the "url" with the file:// protocol | |
| ds9c.set('frame new rgb') | |
| ds9c.set('rgb blue') | |
| ff = "file://%s" % f | |
| ds9c.send_fits_image(name='def mtype',url=ff) | |
| ds9c.set('frame center') | |
| ds9c.set('zoom to fit') | |
| ds9c.set('zscale 0.05') | |
| # now after some modification to the calls here is an example | |
| # of an image and votable broadcast over common mtypes. | |
| # there is also a file url fixer | |
| ds9c.send('fits_image','test2',f) | |
| x = os.path.join(p,'examples','foo.xml') | |
| ds9c.send('votable','testtable',x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment