diff --git a/main/astrodatagui/CalcAllFlaresThread.py b/main/astrodatagui/CalcAllFlaresThread.py index 4ea054b..c48ae7c 100644 --- a/main/astrodatagui/CalcAllFlaresThread.py +++ b/main/astrodatagui/CalcAllFlaresThread.py @@ -42,25 +42,6 @@ def getFlareCount(filesDict): mkdir_p(starFolder) lc = lk.read(filesDict["FilePath"]) - lc.flux = lc["sap_flux"] - lc.flux_err = lc["sap_flux_err"] - lc = lc.normalize() - sapPeaks, sapFits = calculateFlareFitsForLightcurve(lc.flatten()) - sapValSec, sapTds = getTotalValidDataInSeconds(lc, "sap_flux") - sapPeriodogram = lc.to_periodogram() - sapPeakPeriod = sapPeriodogram.period[findMaxIndices(sapPeriodogram, num=4, distance=100, sortByHighest=True)[0]] - sapEpochTime = getEpochTime(lc) - sapFoldedLC = lc.fold(period=sapPeakPeriod, epoch_time=sapEpochTime) - sapPhase, sapSineFit, sapFitType = getFoldedBestFit(sapFoldedLC, fitType=filesDict["FitType"]) - sapMinima, sapMaxima = getFoldedFitPeakValley(sapSineFit) - sapminPhasesBounds, sapmaxPhasesBounds = getPhaseRangesNearPeak((sapMinima, sapMaxima), sapPhase, returnPhaseValue=True) - sapFoldedPeaks = [] - sapFoldedPeaksPhasePair = [] - for peak in sapPeaks: - cycle, foldedIndex = convertStarndardIndexToFoldedIndex(sapFoldedLC, peak["StandardIndex"]) - sapFoldedPeaks.append({"Cycle: ": cycle, "Index": foldedIndex}) - sapFoldedPeaksPhasePair.append({"Phase": sapFoldedLC.phase[sapFoldedLC.cycle == cycle][foldedIndex], "Peak": peak}) - lc.flux = lc["pdcsap_flux"] lc.flux_err = lc["pdcsap_flux_err"] lc = lc.normalize() @@ -130,22 +111,6 @@ def getFlareCount(filesDict): plt.savefig(f"{starFolder}/{starNameR}_{source}-{sequence}-foldedLC-marked_fit_flares.png") plt.close() - - filesDict["sapPeaks"] = sapPeaks - filesDict["sapPeaksCount"] = len(sapPeaks) - filesDict["sapFits"] = sapFits - filesDict["sapValidTimespans"] = sapTds - filesDict["sapValidSeconds"] = sapValSec - filesDict["sapFoldedCycle"] = sapFoldedLC.cycle - #filesDict["sapFoldedPhase"] = sapFoldedLC.phase.value - #filesDict["sapFoldedFitPhase"] = sapPhase - filesDict["sapFoldedFitPhaseStarEnd"] = (sapFoldedLC.phase.value[0], sapFoldedLC.phase.value[-1]) - filesDict["sapFoldedPeaksPhasePair"] = sapFoldedPeaksPhasePair - filesDict["sapPeriod"] = sapPeakPeriod.value - filesDict["sapPeriodMinima"] = sapMinima - filesDict["sapPeriodMinimaBoundaries"] = sapminPhasesBounds - filesDict["sapPeriodMaxima"] = sapMaxima - filesDict["sapPeriodMaximaBoundaries"] = sapmaxPhasesBounds filesDict["pdcsapPeaks"] = pdcsapPeaks filesDict["pdcsapPeaksCount"] = len(pdcsapPeaks) filesDict["pdcsapFits"] = pdcsapFits