Source
casalog.post( "imview() failed to change to the new working directory (" + os.path.abspath(os.curdir) + ") [" + str(sys.exc_info()[0]) + ": " + str(sys.exc_info()[1]) + "]", 'SEVERE')
##########################################################################
#
# Copyright (C) 2019
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
#
# Correspondence concerning AIPS++ should be adressed as follows:
# Internet email: aips2-request@nrao.edu.
# Postal address: AIPS++ Project Office
# National Radio Astronomy Observatory
# 520 Edgemont Road
# Charlottesville, VA 22903-2475 USA
###########################################################################
import sys
import os
import string
import time
from . import viewertool
from casatasks import casalog
###
### if numpy is not available, make float64 and ndarray redundant checks...
###
try:
from numpy import float64 as float64
from numpy import ndarray as ndarray
except:
float64 = float
ndarray = list
class __imview_class(object):
"imview() task with local state for created viewer tool"
def __init__( self ):
self.__dirstack = [ ]
self.__colorwedge_queue = [ ]
def __call__( self, raster={ }, contour={ }, zoom=1, axes={ }, out='' ):
""" Old parameters:
infile=None,displaytype=None,channel=None,zoom=None,outfile=None,
outscale=None,outdpi=None,outformat=None,outlandscape=None,gui=None
The imview task will display images in raster, contour, vector or
marker form. Images can be blinked, and movies are available
for spectral-line image cubes. For measurement sets, many
display and editing options are available.
examples of usage:
imview
imview "myimage.im"
imview "myrestorefile.rstr"
imview "myimage.im", "contour"
imview "'myimage1.im' - 2 * 'myimage2.im'", "lel"
Executing imview( ) will bring up a display panel
window, which can be resized. If no data file was specified,
a Load Data window will also appear. Click on the desired data
file and choose the display type; the rendered data should appear
on the display panel.
A Data Display Options window will also appear. It has drop-down
subsections for related options, most of which are self-explanatory.
The state of the imview task -- loaded data and related display
options -- can be saved in a 'restore' file for later use.
You can provide the restore filename on the command line or
select it from the Load Data window.
See the cookbook for more details on using the imview task.
Keyword arguments:
infile -- Name of file to visualize
default: ''
example: infile='ngc5921.image'
If no infile is specified the Load Data window
will appear for selecting data.