generated from erosita/uds
Merge branch 'main' of heagit.cosmos.ru:xmm/arches
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
good_pn=['0862470801','0862470701','0862470601']
|
||||
good=['0862470801','0862470701','0862470601']
|
||||
|
||||
|
||||
|
||||
|
44
scripts/00_download_events.py
Executable file
44
scripts/00_download_events.py
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from pysas.wrapper import Wrapper as w
|
||||
import os, sys
|
||||
from os.path import dirname
|
||||
import inspect
|
||||
import glob
|
||||
|
||||
import arches
|
||||
from arches.utils import *
|
||||
from arches.config import *
|
||||
|
||||
root_path=dirname(dirname(dirname(inspect.getfile(arches))))
|
||||
print("Arches root path: {}".format(root_path))
|
||||
|
||||
archive_dir=root_path+'/data/archive'
|
||||
events_dir=root_path+'/data/processed'
|
||||
products_dir=root_path+'/products'
|
||||
|
||||
create_folder(events_dir)
|
||||
|
||||
inargs = ['--version']
|
||||
t = w('sasver', inargs)
|
||||
t.run()
|
||||
|
||||
|
||||
for obsid in good:
|
||||
|
||||
local_ccf=f'{events_dir}/{obsid}/ccf.cif'
|
||||
work_dir=f'{events_dir}/{obsid}'
|
||||
os.environ['SAS_ODF'] = f'{archive_dir}'
|
||||
|
||||
inargs = ['--version']
|
||||
t = w('sasver', [])
|
||||
t.run()
|
||||
|
||||
inargs = [f'odfid={obsid}',f'workdir={archive_dir}']
|
||||
w('startsas', inargs).run()
|
||||
|
||||
remove_file('ccf.cif')
|
||||
files=glob.glob("*.SAS")
|
||||
for fn in files:
|
||||
remove_file(fn)
|
||||
|
@@ -34,7 +34,7 @@ for obsid in files:
|
||||
#inargs = [f'odfid={obsid}',f'workdir={work_dir}']
|
||||
#w('startsas', inargs).run()
|
||||
|
||||
os.environ['SAS_ODF'] = f'{archive_dir}/{obsid}/odf'
|
||||
os.environ['SAS_ODF'] = f'{archive_dir}/{obsid}'
|
||||
|
||||
create_folder(work_dir)
|
||||
|
||||
|
Reference in New Issue
Block a user