Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gti2_valid = gti2 is not None and len(gti2) > 0
if gti1_valid and gti2_valid:
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([])