Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
This feature requires `Stingray `_
to be installed (e.g. ``pip install stingray``). An `ImportError` will
be raised if this package is not available.
Returns
-------
lightcurve : `stingray.Lightcurve`
An stingray Lightcurve object.
"""
try:
from stingray import Lightcurve as StingrayLightcurve
except ImportError:
raise ImportError("You need to install Stingray to use "
"the LightCurve.to_stringray() method.")
return StingrayLightcurve(time=self.time, counts=self.flux,
err=self.flux_err, input_counts=False)
if not is_lightcurve_dataset(dataset):
logging.warn("get_eventlist_from_evt_dataset: dataset is not a events dataset instance")
return None
# Extract axis values
time_data = np.array(dataset.tables["RATE"].columns[CONFIG.TIME_COLUMN].values)
counts = np.array(dataset.tables["RATE"].columns["RATE"].values)
err_counts = np.array(dataset.tables["RATE"].columns["RATE"].error_values)
# Extract GTIs
if not gti:
gti = get_stingray_gti_from_gti_table (dataset.tables["GTI"])
# Returns the EventList
if len(gti) > 0:
return Lightcurve(time_data, counts, err=err_counts, input_counts=True, gti=gti)
else:
return Lightcurve(time_data, counts, err=err_counts, input_counts=True)
def get_lightcurve(time_data, counts, err_counts, gti):
return Lightcurve(time_data, counts, err=err_counts, input_counts=True, gti=gti)
return None
# Extract axis values
time_data = np.array(dataset.tables["RATE"].columns[CONFIG.TIME_COLUMN].values)
counts = np.array(dataset.tables["RATE"].columns["RATE"].values)
err_counts = np.array(dataset.tables["RATE"].columns["RATE"].error_values)
# Extract GTIs
if not gti:
gti = get_stingray_gti_from_gti_table (dataset.tables["GTI"])
# Returns the EventList
if len(gti) > 0:
return Lightcurve(time_data, counts, err=err_counts, input_counts=True, gti=gti)
else:
return Lightcurve(time_data, counts, err=err_counts, input_counts=True)