How to use the stingray.Lightcurve function in stingray

To help you get started, we’ve selected a few stingray examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KeplerGO / lightkurve / lightkurve / lightcurve.py View on Github external
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)
github StingraySoftware / dave / src / main / python / utils / dataset_helper.py View on Github external
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)
github StingraySoftware / dave / src / main / python / utils / dataset_helper.py View on Github external
def get_lightcurve(time_data, counts, err_counts, gti):
    return Lightcurve(time_data, counts, err=err_counts, input_counts=True, gti=gti)
github StingraySoftware / dave / src / main / python / utils / dataset_helper.py View on Github external
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)