diff --git a/src/pyoteapp/pyote-info.pdf b/src/pyoteapp/pyote-info.pdf index af672bf..75f3b0b 100644 Binary files a/src/pyoteapp/pyote-info.pdf and b/src/pyoteapp/pyote-info.pdf differ diff --git a/src/pyoteapp/pyote.py b/src/pyoteapp/pyote.py index b169d76..0846f38 100644 --- a/src/pyoteapp/pyote.py +++ b/src/pyoteapp/pyote.py @@ -7462,7 +7462,7 @@ def finalReportPenumbral(self): f'{self.observedDrop:0.1f} three sigma drop from noise: {self.threeSigmaLine:0.1f} margin: {margin:0.1f}' self.showMsg(stats_msg, blankLine=False, bold=True, color='red') - stats_msg = f'fit metrics === observed drop has probability {self.drop_nie_probability:0.6e} of being a noise-induced-event' + stats_msg = f'fit metrics === observed drop has {self.reportDropProbability()} of being a noise-induced-event' self.showMsg(stats_msg, blankLine=False, bold=True) stats_msg = f'fit metrics === {self.magDropReportStr}' @@ -7554,7 +7554,7 @@ def finalReport(self, error_bar_plots_available=True): # self.showMsg(f"This 'drop' has a zero probability of being an artifact of noise.", # bold=True, color='green', blankLine=False) - self.showMsg(f'The observed drop has a probability of {self.drop_nie_probability:0.6e} of being a noise-induced-event', + self.showMsg(f'The observed drop has {self.reportDropProbability()} of being a noise-induced-event', bold=True, color='blue', blankLine=True) # self.showMsg(f">>>> probability > 0.0000 indicates the 'drop' may be spurious (a noise artifact)." @@ -7640,7 +7640,8 @@ def finalReport(self, error_bar_plots_available=True): f'{self.observedDrop:0.1f} three sigma drop from noise: {self.threeSigmaLine:0.1f} margin: {margin:0.1f}' self.showMsg(stats_msg, blankLine=False, bold=True, color='red') - stats_msg = f'fit metrics === observed drop has probability {self.drop_nie_probability:0.6e} of being a noise-induced-event' + + stats_msg = f'fit metrics === observed drop has {self.reportDropProbability()} of being a noise-induced-event' self.showMsg(stats_msg, blankLine=False, bold=True) stats_msg = f'fit metrics === {self.magDropReportStr}' @@ -7675,7 +7676,7 @@ def finalReport(self, error_bar_plots_available=True): self.updateFitMetricTxtFile() if error_bar_plots_available: - self.showHelp(self.helpLabelForFalsePositive) + self.showHelp(self.helpLabelForFalsePositive) # Hidden label on SqWave model tab def addSourceFileToFitMetricTxtFile(self): lightCurveDir = os.path.dirname(self.csvFilePath) # This gets the folder where the light-curve.csv is located @@ -8081,7 +8082,8 @@ def computeErrorBars(self, plots_wanted=True): # self.fiveSigmaLine = self.doFalsePositiveReport(posCoefs, plots_wanted=False) # noqa fp_plot, false_positive, false_probability, self.observedDrop, self.threeSigmaLine, \ - self.fourSigmaLine, fiveSigmaLine = self.doFalsePositiveReport(posCoefs) # noqa + self.fourSigmaLine, self.fiveSigmaLine = self.doFalsePositiveReport(posCoefs) # noqa + if plots_wanted: self.errBarWin = pg.GraphicsWindow( @@ -8228,6 +8230,22 @@ def computeErrorBars(self, plots_wanted=True): self.newRedrawMainPlot() # To add envelope to solution + def reportDropProbability(self): + # TODO Remove these print statements + # print(f'3 sigma drop: {self.threeSigmaLine:0.3f}') + # print(f'4 sigma drop: {self.fourSigmaLine:0.3f}') + # print(f'5 sigma drop: {self.fiveSigmaLine:0.3f}') + # print(f'observed drop: {self.observedDrop:0.3f}') + + # Expected usage: observed drop has of being induced by noise + if self.observedDrop < self.threeSigmaLine: + return f'a less than 3 sigma probability level' + elif self.observedDrop < self.fiveSigmaLine: + return f'a probability of {self.drop_nie_probability:0.1e}' + else: + self.dropSigmaEstimate = (self.observedDrop - self.fiveSigmaLine) / (self.fiveSigmaLine - self.fourSigmaLine) + return f'an estimated {self.dropSigmaEstimate:0.1f} sigma level' + def calcDetectability(self): if self.timeDelta == 0: self.showInfo(f'Cannot use the detectibilty tool on a light curve without timestamps.') @@ -8572,11 +8590,11 @@ def falsePositiveReport(self, event_duration, num_trials, observation_size, obse three_sigma_estimate = sorted_drops[int(.997 * drops.size)] - self.showInfo(f'Calculating the noise-induced-drop probability - this can take many seconds!\n\n' - f'Be patient if/while the hourglass is showing.') + # self.showInfo(f'Calculating the noise-induced-drop probability - this can take many seconds!\n\n' + # f'Be patient if/while the hourglass is showing.') self.showMsg(f'Calculating the noise-induced-drop probability - this can take many seconds! ' - f'Be patient if/while the hourglass is showing.', color='red', bold=True) + f'Be patient.', color='red', bold=True) QtGui.QGuiApplication.processEvents() two_sigma_line, three_sigma_line, four_sigma_line, five_sigma_line, self.drop_nie_probability = \ @@ -8596,9 +8614,7 @@ def falsePositiveReport(self, event_duration, num_trials, observation_size, obse title=f'Noise Induced Events (brightness drops) found in correlated noise for event duration: {event_duration}', labels={'bottom': 'brightness drop', 'left': 'number of times noise produced drop'}) pw.hideButtons() - # y, x = np.histogram(drops, bins='auto') - # y[0] = y[1] / 2.0 # Plot drops histogram pw.plot(bins, counts, stepMode=True, fillLevel=0, brush=(0, 0, 255, 150)) @@ -8622,7 +8638,7 @@ def falsePositiveReport(self, event_duration, num_trials, observation_size, obse pw.addLegend() pw.plot(name=f'red line: the observed drop (B - A) extracted from lightcurve has ' - f'probability {self.drop_nie_probability:0.6e} of being noise induced') + f'a probability {self.drop_nie_probability:0.1e} of being noise induced') pw.plot(name=f'black curve is LSQ fit to drop data using the Gumbel Extreme Value distribution') pw.plot(name=f'green lines are at 3 sigma (99.7%), 4 sigma (99.9938%), and 5 sigma (99.99994%)') # pw.plot(name=f'PyOTE reports a "pass" if red line is to the right of the three_sigma_line,') diff --git a/src/pyoteapp/pyote.ui b/src/pyoteapp/pyote.ui index c5ac4a3..2cd2c32 100644 --- a/src/pyoteapp/pyote.ui +++ b/src/pyoteapp/pyote.ui @@ -180,7 +180,7 @@ true - + Lightcurves @@ -2574,7 +2574,7 @@ - + SqWave model @@ -2781,7 +2781,7 @@ - <html><head/><body><p><span style=" font-weight:600; color:#fc0107;">Advisory =========== for Noise Induced Event (NIE) distribution</span></p><p>Assuming that you have been diligent in removing common lightcurve artifacts (dips caused by something other than an occultation,  like clouds, or a contrail, or ...) using the normalization function (when appropriate), please be aware that ...</p><p>... finding the <span style=" color:#ff0000;">red</span> bar (positioned at the observed brightness drop value) to the left of the <span style=" color:#00aa00;">green</span> bar (this <span style=" font-weight:700; color:#0000ff;">three_sigma_line</span> shows where 99.7% of brightness drops due to noise are located) is usually sufficient reason to report a 'miss' (but see note below).<span style=" font-weight:600; color:#fc0107;"> But</span>, before reporting a 'miss', you should use the Event Detectability calculator to determine if the event was 'detectable'. If the event was 'detectable' and yet a 'miss', the observation has value in constraining one edge of the asteroid. If the 'miss' was of an 'undetectable' event, its value as a constraint on the asteroid edge is greatly diminished.</p><p><span style=" font-weight:600; color:#fc0107;">However</span>,  a <span style=" color:#ff0000;">red</span> bar to the right of the black bar should <span style=" font-weight:600; color:#fc0107;">NEVER</span> be the sole reason to report a 'positive'.</p><p>If you get a red bar to the right of the black bar, <span style=" font-weight:600; text-decoration: underline;">and this is the only available chord</span>, look at the Noise Induced Event distribution plot and only consider reporting a 'positive' if the measured brightness drop is well to the right of the black bar (which shows the biggest brightness drop found during the simulation run). 'Well to the right' is rather vague, so consult with your area coordinator whenever you are uncertain.</p><p><span style=" font-weight:600; color:#fc0107;">Note:</span> if your observed 'brightness drop' (<span style=" color:#ff0000;">red</span> bar) is to the right of the <span style=" color:#00aa7f;">green</span> bar AND there are nearby chords reporting 'positives', there may be value in your observation in spite of a non-zero NIE probability calculation result; your observation may increase confidence in the event recorded by the nearby chords.<br/></p></body></html> + <html><head/><body><p><span style=" font-weight:600; color:#fc0107;">Advisory =========== for Noise Induced Event (NIE) distribution</span></p><p>Assuming that you have been diligent in removing common lightcurve artifacts (dips caused by something other than an occultation,  like clouds, or a contrail, or ...) using the normalization function (when appropriate), please be aware that ...</p><p>... finding the <span style=" color:#ff0000;">red</span> bar (positioned at the observed brightness drop value) to the left of the three <span style=" color:#00aa00;">green</span> bars (the leftmost bar is the <span style=" font-weight:700; color:#0000ff;">three_sigma_line</span> and shows where 99.7% of brightness drops due to noise are located) is usually sufficient reason to report a 'miss' (but see <span style=" font-weight:700; color:#ff0000;">Note</span> below).<span style=" font-weight:600; color:#fc0107;"> But</span>, before reporting a 'miss', you should use the Event Detectability calculator to determine if the event was 'detectable'. If the event was 'detectable' and yet a 'miss', the observation has value in constraining one edge of the asteroid. If the 'miss' was of an 'undetectable' event, its value as a constraint on the asteroid edge is greatly diminished.</p><p>(The green bars are at the 3 sigma, 4 sigma, and 5 sigma positions. Any event with a drop that is greater than 5 sigma has a vanishingly small probability of being induced by noise alone.)</p><p><span style=" font-weight:600; color:#fc0107;">However</span>,  a <span style=" color:#ff0000;">red</span> bar to the right of the three green bars should <span style=" font-weight:600; color:#fc0107;">NEVER</span> be the sole reason to report a 'positive'.</p><p>If you get a red bar to the right of all the green bars, <span style=" font-weight:600; text-decoration: underline;">and this is the only available chord</span>,  consult with your area coordinator as to whether the observation can be reported as a positive.</p><p><span style=" font-weight:600; color:#fc0107;">Note:</span> if your observed 'brightness drop' (<span style=" color:#ff0000;">red</span> bar) is to the right of at least the first <span style=" color:#00aa7f;">green</span> bar but not to the right of the last green bar AND there are nearby chords reporting 'positives', there may be value in your observation in spite of the drop falling in the three sigma to five sigma probability 'gray zone'; your observation may increase confidence in the event recorded by the nearby chords.<br/></p></body></html> @@ -3312,7 +3312,7 @@ - + VizieR export @@ -4846,7 +4846,7 @@ - + Other models @@ -6543,7 +6543,7 @@ Setting this value to zero will force Miss distance optimization to be skipped.< - + Manual timestamps @@ -7087,7 +7087,7 @@ Setting this value to zero will force Miss distance optimization to be skipped.< - + Noise analysis/Detectability @@ -7452,7 +7452,7 @@ Setting this value to zero will force Miss distance optimization to be skipped.< - + Night Eagle 3 diff --git a/src/pyoteapp/version.py b/src/pyoteapp/version.py index 8723782..d91c48f 100644 --- a/src/pyoteapp/version.py +++ b/src/pyoteapp/version.py @@ -1,2 +1,2 @@ def version(): - return '5.4.3' + return '5.4.4'