utils

class utils[源代码]

Utility component, verified, xml translator

Methods Summary

c_exception

Returns detailed information from the last CASA C++ exception (i.e., AipsError).

c_exception_clear

Clears the CASA C++ exception information.

clearpath

Removes all directories from the data path.

compare_version

Returns a description string that includes the version information and the descriptive string..

defaultpath

Returns the default data path.

getagg

Returns the value of the agg parameter used at startup.

getcachedir

Returns the value of the cachedir parameter used at startup.

getnogui

Returns the value of the nogui parameter used at startup.

getpath

Returns the list of directories that are currently in the data path.

getpipeline

Returns the value of the pipeline parameter used at startup.

getpython

get path to python executable

getrc

getrc method

hostinfo

returns host information

initialize

returns True if initalization was performed; returns False if initialization was already done

lockedtables

get the tables locked by this process

maxint

maximum number an C++ int can hold

maxlong

maximum number an C++ long can hold

measurespath

path to the measures data

minint

minimum number an C++ int can hold

minlong

minimum number an C++ long can hold

registry

returns record containing the URI for the CASAtools registry which can be used by other unix processes to access the registry

remove_service

Remove a service from the registry using the URI for the service.

removetable

removetable method

resolve

If the provided path already represents a file or a directory, it is returned.

rundata

path to the measures data.

services

returns record containing the information about the services that have been registered with CASAtools

setmeasurespath

Set path to the measures data.

setpath

Sets the data path to the specified list of directories.

setrundata

Set path to the measures data.

shutdown

python is shutting down cleanup anything that is outstanding

tableinfo

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’.

tryit

test variant convesion

utils

Construct a utility tool

version

Returns a four element vector representing the version (major, minor, patch and feature).

version_desc

The descriptive string describes a particular packaged version.

version_info

Returns a description string that includes the version information and the descriptive string..

version_string

Returns a description string that includes the version information and the descriptive string..

version_variant

Returns the target instrument.

c_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()[源代码]

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()[源代码]

Removes all directories from the data path.

compare_version(comparitor='', vec='')[源代码]

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 (intVec='') - vector to use to compare current version number against vec

Returns

bool

defaultpath()[源代码]

Returns the default data path. This path is used unless the user has set the current path to something else using the setpath function.

getagg()[源代码]

Returns the value of the agg parameter used at startup. Defaults to False.

getcachedir()[源代码]

Returns the value of the cachedir parameter used at startup.

getnogui()[源代码]

Returns the value of the nogui parameter used at startup. Defaults to False.

getpath()[源代码]

Returns the list of directories that are currently in the data path.

getpipeline()[源代码]

Returns the value of the pipeline parameter used at startup. Defaults to False.

getpython()[源代码]

get path to python executable

getrc(rcvar='')[源代码]

getrc method

Parameters

  • rcvar (string='') - Returns the value of the rc variable given. If no value is give it returns the root directory of CASA.

Returns

string

hostinfo()[源代码]

returns host information

initialize(python_path='')[源代码]

returns True if initalization was performed; returns False if initialization was already done

Parameters

  • python_path (string='') - path to python executable

Returns

bool

lockedtables()[源代码]

get the tables locked by this process

maxint()[源代码]

maximum number an C++ int can hold

maxlong()[源代码]

maximum number an C++ long can hold

measurespath()[源代码]

path to the measures data

minint()[源代码]

minimum number an C++ int can hold

minlong()[源代码]

minimum number an C++ long can hold

registry()[源代码]

returns record containing the URI for the CASAtools registry which can be used by other unix processes to access the registry

remove_service(uri='')[源代码]

Remove a service from the registry using the URI for the service. The URI should be a string that looks something like “0.0.0.0:34101”. This function returns True if the removal was successful. Otherwise, it returns False.

Parameters

  • uri (string='') - uri (Address) of the service to remove.

Returns

bool

removetable(tablenames='')[源代码]

removetable method

Parameters

  • tablenames (stringVec='') - Removes tables safely

Returns

bool

resolve(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

Returns

string

rundata()[源代码]

path to the measures data. This function is deprecated measurespath should be used instead.

services()[源代码]

returns record containing the information about the services that have been registered with CASAtools

setmeasurespath(path='')[源代码]

Set path to the measures data. Must be called during initalization before Measures module is initialized.

Parameters

  • path (string='') - path to IERS data

setpath(dirs='')[源代码]

Sets the data path to the specified list of directories. Returns True if all directories were added returns False otherwise.

Parameters

  • dirs (stringVec='') - directories that should constitute the data path

Returns

bool

setrundata(path='')[源代码]

Set path to the measures data. Must be called during initalization before Measures module is initialized. This function is deprecated. setmeasurespath should be used instead.

Parameters

  • path (string='') - path to IERS data

shutdown()[源代码]

python is shutting down cleanup anything that is outstanding

tableinfo(tablename='')[源代码]

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

Returns

record

tryit(input='')[源代码]

test variant convesion

Parameters

  • input (record='') - testing variant

Returns

double

utils()[源代码]

Construct a utility tool

version()[源代码]

Returns a four element vector representing the version (major, minor, patch and feature).

version_desc()[源代码]

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()[源代码]

Returns a description string that includes the version information and the descriptive string..

version_string()[源代码]

Returns a description string that includes the version information and the descriptive string..

version_variant()[源代码]

Returns the target instrument. This helps distinguish versions that otherwise may have the same version number