utils¶
-
class
utils
[source]¶ Utility component, verified, xml translator
Methods Summary
Returns detailed information about last C-level exception
Clears information about last C-level exception
removes all directories from the data path
Returns the complete version description as a string.
returns the default data path
If a param is an enum it will minmatch the enum value and return the full value otherwise it just returns the value
retrieves the data path
Parameters
returns host information
initialize CASAtools
get the tables locked by this process
retrieve registry information
Parameters
resolve a complete path from a subdirectory using the data path
retrieve registered services
Sets the internal contraints records from an XML file
sets the data path to the specified list of directories
shutdown signal from python
Get information about a particular table
returns two element vector containing CASA 6 tool version number
Returns the complete CASA 6 CASAtools version description as a string
Transforms an XML string into a record
Turns a record into an xml string
Construct a utility tool
Verifies an input record against an XML interface description of took or task
Verifies an individual parameter against a prespecified constraints record
returns four element vector for the version
returns the descriptive version string, e.g.
Returns the complete version description as a string.
Returns the complete version description as a string but without the description (i.e.
returns the target instrument f.e.
-
c_exception
()[source]¶ Returns detailed information about last C-level exception
- Returns detailed information from the last CASA C++ exception (i.e., AipsError). The
exception message and the stack trace (mangled; use the shell’s c++filt to demangle) from the last CASA C++ exception. The information is from the last one generated and may not represent an exception from the last action; c_exception_clear can be used to remove stale information. The information’s exception might also have been caught in the C++ code and not have been translated into a Python-level exception.
-
c_exception_clear
()[source]¶ Clears information about last C-level exception
- Clears the CASA C++ exception information. This allows the user to be sure that
information retrieved using c_exception is not from an exception in the distant past.
-
clearpath
()[source]¶ removes all directories from the data path
Removes all directories from the data path.
-
compare_version
(comparitor='', vec='')[source]¶ Returns the complete version description as a string.
Returns a description string that includes the version information and the descriptive string..
Parameters
comparitor (string='')
- what sort of comparison to do, one of >, <, <=, >=, ==, = !=vec (intArray='')
- vector to use to compare current version number against vec
-
defaultpath
()[source]¶ returns the default data path
Returns the default data path. This path is used unless the user has set the current path to something else using the setpath function.
-
expandparam
(name='', value='')[source]¶ If a param is an enum it will minmatch the enum value and return the full value otherwise it just returns the value
Parameters
name (string='')
- Parameter name to expandvalue (variant='')
- Value of the parameter
-
getpath
()[source]¶ retrieves the data path
Returns the list of directories that are currently in the data path.
-
getrc
(rcvar='')[source]¶ Parameters
rcvar (string='')
- Returns the value of the rc variable given.If no value is give it returns the root directory of CASA.
-
initialize
(default_path='')[source]¶ initialize CASAtools
returns true if initalization was performed; returns false if initialization was already done
Parameters
default_path (stringArray='')
- directories that should constitute the default data path
-
registry
()[source]¶ retrieve registry information
returns record containing the URI for the CASAtools registry which can be used by other unix processes to access the registry
-
removetable
(tablenames=[''])[source]¶ Parameters
tablenames (stringArray=[''])
- Removes tables safely
-
resolve
(path='')[source]¶ resolve a complete path from a subdirectory using the data path
If the provided path already represents a file or a directory, it is returned. If it does not, this function tries to find a complete path by matching up this partial directory with the elements of the data path.
Parameters
path (string='')
- path to be expanded
-
services
()[source]¶ retrieve registered services
returns record containing the information about the services that have been registered with CASAtools
-
setconstraints
(xmldescriptor='')[source]¶ Sets the internal contraints records from an XML file
Parameters
xmldescriptor (variant='')
- XML description, either record or url
-
setpath
(dirs=[''])[source]¶ sets the data path to the specified list of directories
Sets the data path to the specified list of directories. Returns true if all directories were added returns false otherwise.
Parameters
dirs (stringArray=[''])
- directories that should constitute the data path
-
shutdown
()[source]¶ shutdown signal from python
python is shutting down cleanup anything that is outstanding
-
tableinfo
(tablename='')[source]¶ Get information about a particular table
- Currently this only returns the pid of the process locking the table (lockpid), if the lock
is permanent (lockperm), and the status (lockstatus) – ‘not in use’, ‘open’, ‘read’, ‘write’, or ‘unknown’. However, the hope is that this will eventually return a complete description of the table.
Parameters
tablename (string='')
- path to table
-
toolversion
()[source]¶ returns two element vector containing CASA 6 tool version number
Returns a two element vector representing the CASAtools version (year, build). This is only returned with CASA 6. With CASA 5, an zero element vector is returned.
-
toolversion_string
()[source]¶ Returns the complete CASA 6 CASAtools version description as a string
Returns a description string that shows the CASA 6 CASAtools version information as a descriptive string. With CASA 5, a zero length string is returned.
-
torecord
(input='')[source]¶ Transforms an XML string into a record
Parameters
input (string='')
- XML string, maybe a URL
-
toxml
(input='', asfile=False, filename='recordas.xml')[source]¶ Turns a record into an xml string
Parameters
input (record='')
- name of thing to vieweasfile (bool=False)
- write the xml as a filefilename (string='recordas.xml')
- if asfile is true then output filename
-
verify
(input='', xmldescriptor='', throwexecpt=False)[source]¶ Verifies an input record against an XML interface description of took or task
Parameters
input (record='')
- The input record to verifyxmldescriptor (variant='')
- XML description, either record or urlthrowexecpt (bool=False)
- Throw an exception if the verification fails
-
verifyparam
(param='')[source]¶ Verifies an individual parameter against a prespecified constraints record
Parameters
param (record='')
- Parameter name:value pair to verify
-
version
()[source]¶ returns four element vector for the version
Returns a four element vector representing the version (major, minor, patch and feature).
-
version_desc
()[source]¶ returns the descriptive version string, e.g. DEV or REL
The descriptive string describes a particular packaged version. During a development cycle there are different sorts of packaged distributions. For example, a development version (“DEV”) or a release version (“REL”).
-
version_info
()[source]¶ Returns the complete version description as a string.
Returns a description string that includes the version information and the descriptive string..
-