Changes
This commit is contained in:
49
scripts/02_merge_events.py
Executable file
49
scripts/02_merge_events.py
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python
|
||||
"""Создает объедененный список событий и помещает его в uds/products
|
||||
|
||||
Этот список событий нужен, в основном для извлечения спектров с помощью srctool
|
||||
"""
|
||||
|
||||
from astropy.wcs import WCS
|
||||
from astropy.io import fits
|
||||
import sys, os, os.path, time, subprocess
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
import glob
|
||||
from os.path import dirname
|
||||
import inspect
|
||||
import uds
|
||||
|
||||
from uds.utils import *
|
||||
from uds.config import *
|
||||
|
||||
outkey="mosa_tm0"
|
||||
|
||||
""" find UDS root dir """
|
||||
root_path=dirname(dirname(dirname(inspect.getfile(uds))))
|
||||
print("UDS root path: {}".format(root_path))
|
||||
|
||||
outfile_subdir=root_path+'/products/'
|
||||
create_folder(outfile_subdir)
|
||||
|
||||
index=4
|
||||
|
||||
events=[]
|
||||
for tmkey in keylist_tm.keys():
|
||||
print("TM{} in work... init events".format(tmkey))
|
||||
for datakey in keylist_tm[tmkey]:
|
||||
print("--> {}".format(datakey))
|
||||
|
||||
events.append(init_events(key=datakey, eband_index=eband[index],
|
||||
subdir=outfile_subdir,
|
||||
do_obsmode=True,
|
||||
do_center=True,
|
||||
do_evtool=False,
|
||||
do_expmap=False,
|
||||
ra_cen=ra_cen, de_cen=de_cen,
|
||||
emin_kev=emin_kev[index],
|
||||
emax_kev=emax_kev[index]))
|
||||
sys.exit()
|
||||
outfile_evtool="{}_EventList_en{}.fits".format(os.path.join(outfile_subdir,outkey), eband[index])
|
||||
do_evtool_esass(events=events, outfile=outfile_evtool)
|
||||
|
Reference in New Issue
Block a user