diff --git a/conf/params.py b/uds/config.py similarity index 100% rename from conf/params.py rename to uds/config.py diff --git a/uds/utils.py b/uds/utils.py new file mode 100644 index 0000000..ac23e0f --- /dev/null +++ b/uds/utils.py @@ -0,0 +1,40 @@ +import os +import sys +import numpy as np +from astropy.io import fits +from astropy import wcs +from astropy.wcs import WCS +from astropy.io.fits import update +from astropy.io.fits import getdata +import glob + +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 + + +import statistics +import shutil + +def create_folder(folder): + if not (os.path.exists(folder)): + os.makedirs(folder) + +def remove_file(filename): + if(os.path.isfile(filename)==True): + os.remove(filename) + +def do_evtool_esass(events,outfile): + cmd=["evtool", + "eventfiles=\'{}\'".format((" ").join(events)), + "outfile=%s" %(outfile), + "image=yes", + "flag=0x2000", + "pattern=15" + ] + # run the command + print((" ").join(cmd)) + os.system((" ").join(cmd))