generated from erosita/uds
Initial commit
This commit is contained in:
61
scripts/00_check.py
Executable file
61
scripts/00_check.py
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env python
|
||||
"""Печатает информацию о наблюдениях
|
||||
|
||||
"""
|
||||
|
||||
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))
|
||||
|
||||
infile_dir=root_path+'/data/processed'
|
||||
outfile_dir=root_path+'/products'
|
||||
create_folder(outfile_dir)
|
||||
|
||||
index=5
|
||||
|
||||
events=[]
|
||||
expmaps=[]
|
||||
totexp=0.0
|
||||
for tmkey in keylist_tm.keys():
|
||||
print("TM{} in work... init events".format(tmkey))
|
||||
for datakey in keylist_tm[tmkey]:
|
||||
#print("--> {}".format(datakey))
|
||||
""" Запускаем полностью в холостом режиме, нам нужно получить только названия файлов """
|
||||
outfile_evtool,outfile_expmap=init_events(key=datakey, eband_index=eband[index],
|
||||
infile_dir=infile_dir,
|
||||
outfile_dir=outfile_dir,
|
||||
do_init=False,
|
||||
do_obsmode=False,
|
||||
do_center=False,
|
||||
do_evtool=False,
|
||||
do_expmap=False,
|
||||
ra_cen=ra_cen, de_cen=de_cen,
|
||||
emin_kev=emin_kev[index],
|
||||
emax_kev=emax_kev[index])
|
||||
events.append(outfile_evtool)
|
||||
expmaps.append(outfile_expmap)
|
||||
tstart, tstop = read_tstart_tstop(infile=outfile_evtool)
|
||||
totexp=totexp+(tstop-tstart)
|
||||
print("{}, {} -- {}, {} -- {}, {:.2f} ks".format(outfile_evtool,tstart,tstop,
|
||||
mission2date_utc(tstart),
|
||||
mission2date_utc(tstop),
|
||||
(tstop-tstart)/1000))
|
||||
|
||||
print("\n***\n*** Total exposure: {:.1f} ks\n***".format(totexp))
|
||||
|
||||
|
Reference in New Issue
Block a user