casaconfig.private

data_available()

List available casarundata versions on CASA server

This returns a list of the casarundata versions available on the CASA download server. The version parameter of data_update must be one of the values in that list if set (otherwise the most recent version in this list is used).

Parameters

None

Returns

list - version names returned as list of strings

data_update(path, auto_update_rules=False, version=None, force=False, logger=None)

Retrieve the casarundata from the CASA server and install it in path

See the External Data section in casadocs for more information about the data retrieved. This retrieves the full set of CASA runtime data, including the measures data available when the requested version of casarundata was produced.

A text file (readme.txt in top-level directory at path) records the version string and the date when that version was installed in path.

If the version requested matches the one in that text file then this function does nothing unless force is True.

If a specific version is not requested (the default) and the date in that text file is today, then this function does nothing unless force is True even if there is a more recent version available from the CASA server.

A file lock is used to prevent more that one data_update and measures_update from updating any files in path at the same time. When locked, the lock file (datea_update.lock in path) will contain information about the process that has the lock. When a data_update gets the lock it will check the readme.txt file in path to make sure that an update is still necessary (if force is True then an update always happens).

Some of the tables installed by data_update are only read when casatools starts. Use of data_update should typically be followed by a restart of CASA so that any changes are seen by the tools and task that use this data.

Note: data_update requires that the expected readme.txt file already exists at the top-level directory at path. If the file does not exist or can not be interpreted as expected then data_update will return without updating any data.

Note: if auto_update_rules is True the user must own path (in addition to having read and write permissions there). The version must then also be None and the force option must be False.

Note: the most recent casarundata may not include the most recent measures data. A data_update is typically followed by a measures update.

Parameters
  • path (str) - Folder path to update. Must contain a valid readme.txt,

  • auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.

  • version (str=None) - Version of casarundata to retrieve (usually in the form of casarundata-x.y.z.tar.gz, see data_available()). Default None retrieves the latest.

  • force (bool=False) - If True, always re-download the casarundata. Default False will not download casarundata if already updated today unless the version parameter is specified and different from what was last downloaded.

  • logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal.

Returns

None

measures_available()

List available measures versions on ASTRON FTP server

This returns a list of the measures files available on the ASTRON FTP server. The version parameter of measures_update must be one of the values in that list if set (otherwise the most recent version in this list is used).

Parameters

None

Returns

list - version names returned as list of strings

measures_update(path, auto_update_rules=False, version=None, force=False, logger=None)

Retrieve IERS data used for measures calculations from ASTRON FTP server

Original data source is here: https://www.iers.org/IERS/EN/DataProducts/data.html

CASA maintains a separate Observatory table which is used by measures_update instead of the version that accompanies the ASTRON measures tables.

A text file (readme.txt in the geodetic directory in path) records the version string and the date when that version was installed in path.

If the version requested matches the one in that text file then this function does nothing unless force is True.

If a specific version is not requested (the default) and the date in that text file is today, then this function does nothing unless force is True even if there is a more recent version available from the ASTRON FTP server.

Automatic updating (when the measures_auto_update config value is True) uses this function as the casatools module is starting so that the updated measures are in place before any tool needs to use them.

Using measures_update after casatools has started should always be followed by exiting and restarting casa (or the casatools module if modular casa components are being used).

A file lock is used to prevent more that one measures_update and data_update from updating the measures files in path at the same time. When locked, the lock file (data_update.lock in path) will contain information about the process that has the lock. When a measures_update gets the lock it will check the readme.txt file in the geodetic directory in path to make sure that an update is still necessary (if force is True an update always happens).

Care should be used when using measures_update outside of the normal automatic update that other casa sessions are not using the same measures at the same time, especially if they may also be starting at that time. If a specific version is requested or force is True there is a risk that the measures may be updated while one of those other sessions are trying to load the same measures data, leading to unpredictable results. The lock file will prevent simulateous updates from happening but if each simultanous update eventually updates the same measures location (because force is True or the updates are requesting different versions) then the measures that any of those simultanous casatools modules sees is unpredictable. Avoid multiple, simultanous updates outside of the automatic update process.

Note: measures_update requires that the expected readme.txt file already exists in the geodetic directory at path. If that file does not exist or can not be interpreted as expected then measures_update will return without updating any data.

Note: if auto_update_rules is True the user must own path (in addition to having read and write permissions there). The version must then also be None and the force option must be False.

Parameters
  • path (str) - Folder path to place updated measures data. Must contain a valid geodetic/readme.txt

  • auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.

  • version (str=None) - Version of measures data to retrieve (usually in the form of yyyymmdd-160001.ztar, see measures_available()). Default None retrieves the latest.

  • force (bool=False) - If True, always re-download the measures data. Default False will not download measures data if already updated today unless the version parameter is specified and different from what was last downloaded.

  • logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal

Returns

None

pull_data(path, version=None, force=False, logger=None)

Pull down the package data contents from the CASA host to the specified directory

The path must be specified and must be empty or not exist.

The measures tables included in the package data will typically not be the most recent versions. To get the most recent measures data, measures_update should be used after pull_data.

Some of the tables installed by pull_data are only read when casatools starts. Use of pull_data should typically be followed by a restart so that any changes are seen by the tools and tasks that use this data.

Parameters
  • path (str) - Folder path to place casadata contents. It must be empty or not exist unless force is True.

  • version (str=None) - casadata version to retrieve data from. Default None gets the most recent version.

  • force (bool=False) - If True, always re-download the data even if already present in path. If True, path is Not first emptied so the result may contain files in addition to the ones just downloaded. Default False will not download data if already populated.

  • logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal

Returns

None

set_casacore_path(path=None)

Set the path in .casarc to the desired data directory

The “measures.directory” in the .casarc file is not used by any part of CASA. This function is provided as a convenience for casacore users (e.g. python-casacore) so that the path to the casacore data directory can be found by casacore users. It sets the value of that parameter to the casacore data location, replacing any previously set value.

Parameters
  • path (string=None) - path to the desired data directory. Default None uses the included data directory from this package

Returns

None