How to use the stingray.AveragedCrossspectrum 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 StingraySoftware / dave / src / main / python / utils / dave_engine.py View on Github external
gti = cross_two_gtis(gti1, gti2)
            logging.debug("GTIS crossed")
        elif gti1_valid and not gti2_valid:
            gti = gti1
            logging.debug("GTI 1 applied")
        elif not gti1_valid and gti2_valid:
            gti = gti2
            logging.debug("GTI 2 applied")

        # Creates the cross spectrum
        logging.debug("Create cross spectrum")

        if xds_type == 'Sng':
            xs = Crossspectrum(lc1=lc1, lc2=lc2, norm=norm, gti=gti)
        else:
            xs = AveragedCrossspectrum(lc1=lc1, lc2=lc2, segment_size=segm_size, norm=norm, gti=gti)

        if xs:

            if not hasattr(xs, 'pds1'):
                return common_error("Cant create PDS of lightcurve 1")

            if not hasattr(xs, 'pds2'):
                return common_error("Cant create PDS of lightcurve 2")

            freq = xs.freq
            power = xs.power
            power_err = xs.power_err
            if xds_type == 'Sng':
                time_lag, time_lag_err = xs.time_lag(), np.array([])
                coherence, coherence_err = xs.coherence(), np.array([])
            else: