2
0
forked from xmm/arches
This commit is contained in:
2025-04-23 19:34:07 +03:00
parent a665b052ec
commit 9820befec3
8 changed files with 1058 additions and 33 deletions

View File

@@ -1,3 +1,17 @@
from pathlib import Path
good_pn=['0862470801','0862470601']
pn_threshold = 0.2
mos_threshold=[0.2,0.3]
"""
Ядро скопления
RA=17h 45m 50.3s
Dec=-28d 49m 19s
Radius=15"
Фоновая скорость счёта для области ядра Арки оценивалась в кольце 70 < R < 130.
"""
skip=['0862471401','0862471501','0862470501']

View File

@@ -13,18 +13,24 @@ from fitsio import FITS
from pathlib import Path
import pandas
import pickle
from os.path import dirname
import inspect
from pysas.wrapper import Wrapper as w
from astropy.table import QTable, Table, Column
from astropy import units as u
from astropy.coordinates import SkyCoord # High-level coordinates
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
from astropy.coordinates import Angle, Latitude, Longitude # Angles
from astropy.time import Time, TimeDelta, TimezoneInfo, TimeFromEpoch
import statistics
import shutil
def create_folder(folder):
if not (os.path.exists(folder)):
os.makedirs(folder)
@@ -81,3 +87,46 @@ def plotLC(plt,threshold,fileName):
else:
print("File not found "+fileName+"\n")
def init_work_dir(obsid):
import arches
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'
ds9reg_dir=root_path+'/data/ds9reg'
create_folder(products_dir)
#inargs = ['--version']
#t = w('sasver', inargs)
#t.run()
print(f'*** ObsID: {obsid} ***')
local_ccf=f'{events_dir}/{obsid}/ccf.cif'
work_dir=f'{products_dir}/{obsid}'
create_folder(work_dir)
if not os.path.exists(local_ccf):
print("*** Not found SAS_CCF = {}".format(local_ccf))
sys.exit()
sasfiles = glob.glob(events_dir+f'/{obsid}/*SUM.SAS')
if not (sasfiles):
print("*** run 01_init_events.py ***")
sys.exit()
os.environ['SAS_ODF'] = sasfiles[0]
os.environ['SAS_CCF'] = local_ccf
w('sasver', []).run() # print info
inargs = [f'workdir={work_dir}']
w('startsas', inargs).run()
return work_dir