casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
viewer.py
Go to the documentation of this file.
00001 #
00002 # This file was generated using xslt from its XML file
00003 #
00004 # Copyright 2009, Associated Universities Inc., Washington DC
00005 #
00006 import sys
00007 import os
00008 from  casac import *
00009 import string
00010 from taskinit import casalog
00011 #from taskmanager import tm
00012 import task_viewer
00013 def viewer(infile='', displaytype='raster', channel=0, zoom=1, outfile='', outscale=1.0, outdpi=300, outformat='jpg', outlandscape=False, gui=True):
00014 
00015         """View an image or visibility data set
00016 
00017         examples of usage:
00018 
00019         viewer
00020         viewer "myimage.im"
00021         viewer "mymeasurementset.ms"
00022         viewer "myrestorefile.rstr"
00023         
00024         viewer "myimage.im", "contour"
00025 
00026         viewer "'myimage1.im' - 2 * 'myimage2.im'", "lel"
00027         
00028         
00029         Keyword arguments:
00030         infile -- Name of file to visualize
00031                 default: ''
00032                 example: infile='ngc5921.image'
00033                 If no infile is specified the Load Data window
00034                 will appear for selecting data.
00035         displaytype -- (optional): method of rendering data
00036                 visually (raster, contour, vector or marker).  
00037                 You can also set this parameter to 'lel' and
00038                 provide an lel expression for infile (advanced).
00039                 default: 'raster'
00040                 example: displaytype='contour'
00041 
00042         Note: the filetype parameter is optional; typing of
00043         data files is now inferred:
00044                 example:  viewer infile='my.im'
00045                 obsolete: viewer infile='my.im', filetype='raster'
00046         the filetype is still used to load contours, etc.
00047 
00048         
00049         """
00050 
00051 #
00052 #    The following is work around to avoid a bug with current python translation
00053 #
00054         mytmp = {}
00055 
00056         mytmp['infile'] = infile
00057         mytmp['displaytype'] = displaytype
00058         mytmp['channel'] = channel
00059         mytmp['zoom'] = zoom
00060         mytmp['outfile'] = outfile
00061         mytmp['outscale'] = outscale
00062         mytmp['outdpi'] = outdpi
00063         mytmp['outformat'] = outformat
00064         mytmp['outlandscape'] = outlandscape
00065         mytmp['gui'] = gui
00066         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00067         trec = casac.utils().torecord(pathname+'viewer.xml')
00068 
00069         casalog.origin('viewer')
00070         if trec.has_key('viewer') and casac.utils().verify(mytmp, trec['viewer']) :
00071             result = task_viewer.viewer(infile, displaytype, channel, zoom, outfile, outscale, outdpi, outformat, outlandscape, gui)
00072 
00073         else :
00074           result = False
00075         return result