if os.environ.has_key('LD_PRELOAD'):
del os.environ['LD_PRELOAD']
homedir = os.getenv('HOME')
print "Environment variable HOME is not set, please set it"
print 'Failed to load IPython: ', e
print "failed to load matplotlib:\n", e
print "sys.path =", "\n\t".join(sys.path)
print "failed to load casa:\n", e
cu = __casac__.utils.utils()
'time': casadef.build_time,
'version': cu.version_info( ),
'number': casadef.subversion_revision
'url': casadef.subversion_url,
'revision': casadef.subversion_revision
'rc': homedir + '/.casa',
'recipes': casadef.python_library_directory+'/recipes',
'logfile': os.getcwd( ) + '/casa-'+time.strftime("%Y%m%d-%H%M%S", time.gmtime())+'.log'
'state' : { 'startup': True }
if os.environ.has_key('CASAPATH') :
__casapath__ = os.environ['CASAPATH'].split(' ')[0]
if not os.path.exists(__casapath__ + "/data") :
raise RuntimeError, "Unable to find the data repository directory in your CASAPATH. Please fix."
casa['dirs']['root'] = __casapath__
casa['dirs']['data'] = __casapath__ + "/data"
__casapath__ = casac.__file__
while __casapath__ and __casapath__ != "/" :
if os.path.exists( __casapath__ + "/data") :
__casapath__ = os.path.dirname(__casapath__)
if not os.path.exists(__casapath__ + "/data") :
raise RuntimeError, "casa path could not be determined"
casa['dirs']['root'] = __casapath__