generated from erosita/uds
39 lines
751 B
Python
Executable File
39 lines
751 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from pysas.wrapper import Wrapper as w
|
|
import os, sys
|
|
|
|
from arches.utils import *
|
|
from arches.config import *
|
|
|
|
root_path=dirname(dirname(dirname(inspect.getfile(arches))))
|
|
print("Arches root path: {}".format(root_path))
|
|
|
|
sys.exit()
|
|
|
|
root='/data/xmm'
|
|
|
|
inargs = ['--version']
|
|
t = w('sasver', inargs)
|
|
t.run()
|
|
|
|
obsid='0862470501'
|
|
local_ccf=f'{root}/work/{obsid}/ccf.cif'
|
|
work_dir=f'{root}/work/{obsid}'
|
|
|
|
os.environ['SAS_ODF'] = f'{root}/arc/{obsid}/odf/'
|
|
|
|
if not os.path.exists(work_dir):
|
|
os.makedirs(work_dir)
|
|
|
|
os.chdir(work_dir)
|
|
|
|
if not os.path.exists(local_ccf):
|
|
w('cifbuild', []).run()
|
|
else:
|
|
print("Skip cifbuild, SAS_CCF = {}".format(local_ccf))
|
|
|
|
os.environ['SAS_CCF'] = local_ccf
|
|
|
|
print(os.environ['SAS_CCF'])
|