get_data_info

get_data_info(path=None, logger=None, type=None)[source]

Get the summary information on the 3 types of data managed by casaconfig.

The return value is a dictionary by type of data : ‘casarundata’, ‘measures’, and ‘release’. Each type is itself a dictionary as described below.

The path is the location to use to search for the installed release information. The path argument defaults to config.measurespath when not set.

The return value can be limited to just a specific type using the type argument (‘casarundata’, ‘measures’, ‘release’). In that case the returned value is the dictionary for just the requested type. When type is None (the default) the full set of dictionaries is returned.

The ‘casarundata’ and ‘measures’ dictionaries contain ‘version’ and ‘date’ where version is the version string and date is the date when it was installed. These values are taken from the readme.txt file for each type. For ‘casarundata’ an additional field of ‘manifest’ is present which is the list of files that have been installed for that specific version (this will be empty for an unknown or invalid version). The measures dictionary also contains a ‘site’ field which holds the URL of the site that supplied that version. For older readme files that lack any site infromation the site is assumed to be the astron site.

The ‘release’ dictionary comes from the release_data_readme.txt file which is copied into place when a modular CASA is built. It consists of ‘casarundata’ and ‘measures’ dictionaries where each dictionary contains the ‘version’ string and ‘date’ that that version was created for the described release. This allows casaconfig to install that casarundata version for testing purposes. The release information does not depend on the path argument since it is found in the casaconfig module.

If path is empty or does not exist then the return value for the ‘casarundata’ and ‘measures’ types is None.

If no readme.txt file can be found at path but the contents of path have the directories expected for casarundata then the version returned for ‘casarundata’ is ‘unknown’ and the date is an empty string. In that case the path may contain casarundata from a legacy installation of CASA data. CASA will be able to use the files at this location but they can not be maintained by casaconfig. If the path is not empty (except for a possible lock file while it’s in use but does not appear to contain legacy casarundata or the readme.txt file found there can not be read as expected then the version is ‘invalid’.

If no readme.txt file can be found for the measures at path/geodetic but both the geodetic and ephemeris directories are present in path then the version returned for ‘measures’ is ‘unknown’ and the date is an empty string. The path location may contain measures data from a legacy installation of CASA data. CASA will be able to use any measures tables at this location by they can not be maintained by casaconfig. If the path is not empty but does not appear to contain legacy measures data or the readme.txt file found in path/geodetic can not be read as expected then the version is ‘invalid’.

If no casadata release information is found or the contents are unexpected the returned value for ‘release’ is None and the “–reference-testing” option will not do anything for this installation of casaconfig. This will be the case for a modular installation.

If path has not been set (has a value of None) then the returned value will be None. This likely means that a casasiteconfig.py exists but has not yet been edited to set measurespath.

Parameters
  • path (str) - Folder path to find the casarundata and measures data information. If not set then config.measurespath is used.

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

  • type (str) - the specific type of data info to return (None, ‘casarundata’, ‘measures’, ‘release’; None returns a dictionary of all types)

Returns
  • a dictionary by type, ‘casarundata’, ‘measures’, ‘release’ where each type is a dictionary containing ‘version’ and ‘date’. A return value of None indicates path is unset. A value of None for that type means no information could be found about that type. If a specific type is requested then only the dictionary for that type is returned (or None if that type can not be found).

Raises
  • casaconfig.UnsetMeasurespath - path is None and has not been set in config

  • ValueError - raised when type has an invalid value