How to use the function in hendrics

To help you get started, we’ve selected a few hendrics 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 StingraySoftware / dave / src / main / python / utils / View on Github external
def load_dataset_from_intermediate_file(fname):
    """Save Stingray object to intermediate file."""

    from stingray.lightcurve import Lightcurve
    from import EventList
    from stingray.crossspectrum import Crossspectrum
    from import get_file_type
    from import _retrieve_pickle_object

    # This will return an EventList, a light curve, a Powerspectrum, ...
    # depending on the contents of the file
        ftype, contents = get_file_type(fname)
        contents = _retrieve_pickle_object(fname)

    if isinstance(contents, Lightcurve):
        return DataSet.get_lightcurve_dataset_from_stingray_Lightcurve(contents)

    elif isinstance(contents, EventList):
        return DataSet.get_eventlist_dataset_from_stingray_Eventlist(contents)

    # This also work for Powerspectrum and AveragedCrosspowerspectrum, clearly
    elif isinstance(contents, Crossspectrum):
        logging.error("Unsupported intermediate file type: Crossspectrum")

        logging.error("Unsupported intermediate file type: %s" % type(stingray_object).__name__)


"High ENergy Data Reduction Interface from the Command Shell"

Latest version published 13 days ago

Package Health Score

72 / 100
Full package analysis