Source
casalog.post( 'imval task complete for region bound by blc='+str(retValue['blc'])+' and trc='+str(retValue['trc']), 'NORMAL1' )
from __future__ import absolute_import
import os
import numpy
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import image, regionmanager, coordsys
from casatasks import casalog
_ia = image( )
_rg = regionmanager( )
else:
from taskinit import *
image = iatool
coordsys = cstool
_ia = iatool( )
_rg = rgtool( )
# AUTHOR: S. Jaeger
#
# NAME: getimaxes
#
# DESCRIPTION:
# This function uses the coordinate information associated
# with an image to find where the directional (sky) axes are,
# the spectral axes, and the stokes axes.
#
# INPUT:
# imagename string path to a file on disk.
#
# RETURN
# list of four lists, [list1, list2, list3, list4 ], as follows :
# list1: ['axis num of 1st sky axis', 'Name of axis' ]
# list2: ['axis num of 2nd sky axis', 'Name of axis' ]
# list3: ['axis num of spectral axis', 'Spectral' ]
# list4: ['axis num of stokes axis', 'Stokes' ]
def getimaxes(imagename):
"""
Open an image file, looking at its coordinate system information
to determine which axes are directional, linear, spectral, and
the stokes axies.
The return list or lists contains the axis numbers and names in
the following order:
1. Directional or Linear
2. Directional or Linear
3. Spectral
4. Stokes
Note that if an axis type is not found an empty list is returned
for that axis.
"""
# Get the images coord. sys.
csys=None
_ia.open( imagename )
csys=_ia.coordsys()
# Find where the directional and channel axies are
# Save the internal placement of the axies in a list