Splitting COS Exposures into sub-exposures.
If COS Data were taken in TIME-TAG mode, in which each individual encounter with a photon is recorded with its time of arrival, one can split a COS exposure into multiple sub-exposure files.
pip install calcos –user
pip install costools –user
#– Necessary library imports
import os
import glob
import numpy as np
from scipy.ndimage.filters import convolve
import matplotlib as mpl
import matplotlib.pyplot as plt
from astropy.io import fits
from calcos import calcos
from costools import splittag, x1dcorr
#Splittage can be used in two primary ways; giving start, increment, and stop times or by supplying a complete time list:
export lref=/scisoft/Other_Soft/HST/lref/
gethead *.fits EXPTIME
calcos -o data lc1v28geq_5_corrtag_a.fits
