Release 1.1.5: compare against the nearby or best frame
All checks were successful
Release AstroFrame / packages (push) Successful in 56s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-10-05 18:30:11 -07:00
parent b8ffe97c46
commit d8923ea85d
4 changed files with 41 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
<Authors>Elijah Kuntz</Authors>
<Product>AstroFrame</Product>
</PropertyGroup>

View file

@ -0,0 +1,9 @@
# AstroFrame 1.1.5
- Choose what **Compare** shows: **Nearby frame**, the exposure closest in capture time, or **Best frame**, the strongest kept exposure in the selected exposure's session. The dropdown appears next to Compare while comparison is on.
- Best frame picks the highest quality score among kept, measured exposures, then the sharpest stars (lowest FWHM), then the strongest stellar flux. If the selected exposure is itself the best, the next best is shown. The pane caption reads **Best**, and its tooltip lists the score and FWHM.
- Nearby frame is the default, and each launch starts on Nearby. Overlay, Denoised, stretch, zoom and pan apply to both choices.
Comparison choice is display-only: it never changes measurements, classifications or manual decisions.
Validation: 95 engine, 23 updater, 10 mocked publisher and 77 isolated Windows interaction checks (including 11 new comparison checks), with rendering at 96 and 144 DPI on a copied workspace fixture. Verification leaves the installed app untouched. The server workflow builds Windows and Linux packages and checks the packaged Linux settings page.

View file

@ -21,6 +21,7 @@ public sealed partial class MainWindow
bitmap.Render(this);bitmap.Save(System.IO.Path.Combine(output,name+".png"));
}
Check(project==null&&selected==null&&visible.Count==0,"ordinary startup starts a fresh session");
Check(compareTarget.SelectedIndex==0&&!compareTarget.IsVisible,"each launch starts comparing against the nearby exposure");
Check(!memoryUsage.IsVisible&&!memoryTimer.IsEnabled&&!progress.IsVisible&&!inspectElongation.IsEnabled,"idle startup hides processing stats and disables star inspection");
Check(Background==Palette.Background&&TransparencyBackgroundFallback==Palette.Background&&NativeWindowBackground.IsApplied(this),"managed and native startup backgrounds match the application grey");
Capture("fresh-session");
@ -55,6 +56,22 @@ public sealed partial class MainWindow
spatial.IsChecked=true;compare.IsChecked=false;compare.IsChecked=true;Select(visible[0]);await WaitForPreviews();await Task.Delay(150);
Check(preview.Spatial&&comparison.Spatial&&comparison.HasImage,"Overlay persists on both panes after toggling comparison and changing frame");
Capture("comparison-fit",144);
Check(compareTarget.IsVisible&&compareTarget.Items.Cast<string>().SequenceEqual(new[]{"Nearby frame","Best frame"})&&compareTarget.SelectedIndex==0&&comparison.Caption=="Nearby","comparison target offers Nearby and Best and defaults to Nearby");
var nearest=project!.Frames.Where(f=>f.Session==selected!.Session&&f.Id!=selected.Id&&f.Timestamp.HasValue&&f.Error=="").MinBy(f=>Math.Abs((f.Timestamp!.Value-selected!.Timestamp!.Value).TotalSeconds));
Check(comparison.Frame==nearest,"Nearby compares the exposure closest in capture time");
compareTarget.SelectedIndex=1;await WaitForPreviews();await Task.Delay(150);var bestFrame=comparison.Frame;
var kept=project.Frames.Where(f=>f.Session==selected!.Session&&f.Id!=selected.Id&&f.Error==""&&f.Measured&&f.Effective==AstroFrame.Engine.Verdict.Keep&&f.Fwhm>0).ToArray();
Check(bestFrame!=null&&comparison.Caption=="Best","Best selects a comparison exposure ("+kept.Length+" kept candidates)");
Check(comparison.HasImage,"Best comparison preview loads");
Check(kept.Contains(bestFrame!)&&!kept.Any(f=>f.Score>bestFrame!.Score||f.Score==bestFrame!.Score&&f.Fwhm<bestFrame.Fwhm),"Best compares the highest-scoring, sharpest kept exposure in the session");
Check(preview.Spatial&&comparison.Spatial&&preview.Viewport==comparison.Viewport,"Best comparison keeps Overlay and the shared viewport");
Capture("best-comparison",144);Width=1120;Height=740;await Task.Delay(150);
var targetBounds=compareTarget.TranslatePoint(default,this)!.Value;
Check(targetBounds.X>=0&&targetBounds.X+compareTarget.Bounds.Width<=Bounds.Width&&compareTarget.Bounds.Width>0,"comparison target dropdown stays visible at minimum window width");Capture("best-comparison-minimum",144);
Select(bestFrame!);await WaitForPreviews();Check(comparison.Frame!=null&&comparison.Frame!=selected&&comparison.Caption=="Best","selecting the best exposure compares the next best instead of itself");
compare.IsChecked=false;Check(!compareTarget.IsVisible,"comparison target hides with Compare");compare.IsChecked=true;
Check(compareTarget.SelectedIndex==1&&comparison.Caption=="Best","comparison target persists while toggling Compare in a session");
compareTarget.SelectedIndex=0;Select(visible[0]);await WaitForPreviews();Check(comparison.Caption=="Nearby"&&comparison.Frame!=null&&comparison.Frame.Session==selected!.Session,"switching back restores the nearby comparison");
Check(previewMode.Items.Cast<string>().SequenceEqual(new[]{"Frame view","Denoised"}),"preview dropdown contains only Frame view and Denoised");
Check(preview.HasDenoised&&comparison.HasDenoised&&preview.Mode==AstroFrame.Engine.PreviewMode.Denoised&&comparison.Mode==preview.Mode,"Denoised applies to both comparison panes");Capture("denoised-comparison",144);
double retainedZoom=viewport.Zoom;var retainedPan=viewport.Pan;previewMode.SelectedIndex=0;previewMode.SelectedIndex=1;await WaitForPreviews();

View file

@ -45,6 +45,8 @@ public sealed partial class MainWindow:Window
readonly ProgressBar progress=new(){Height=5,Minimum=0,Maximum=100,IsVisible=false,Foreground=Palette.Progress,Background=Palette.Line};
readonly Button analyze=Button("Analyze lights",true),export=Button("Export accepted"),stop=Button("Cancel");
readonly CheckBox spatial=new(){Content="Spatial overlay",FontSize=12},compare=new(){Content="Compare nearby",FontSize=12};
// Not persisted: each launch starts comparing against the nearby exposure.
readonly ComboBox compareTarget=new(){ItemsSource=new[]{"Nearby frame","Best frame"},SelectedIndex=0,MinWidth=120,FontSize=11,IsVisible=false,Margin=new(10,0,0,0)};
Frame? selected;List<Frame> visible=[];
readonly Stack<(Frame Frame,Verdict? Verdict,string Note,DateTime? At)> undo=[];
public MainWindow()
@ -93,7 +95,7 @@ public sealed partial class MainWindow:Window
var previewActions=new WrapPanel{Margin=new(0,8,0,0)};
resetView.Padding=new(9,5);resetView.FontSize=11;resetView.Click+=(_,_)=>viewport.Reset();ToolTip.SetTip(resetView,"Reset image zoom and position");previewActions.Children.Add(resetView);
inspectElongation.Padding=new(9,5);inspectElongation.FontSize=11;inspectElongation.Margin=new(8,0,0,0);inspectElongation.IsEnabled=false;inspectElongation.Click+=(_,_)=>ShowElongation();ToolTip.SetTip(inspectElongation,"Enlarge source stars and highlight their shape, with a matched KEEP frame when available");previewActions.Children.Add(inspectElongation);Grid.SetRow(previewActions,1);Grid.SetColumnSpan(previewActions,2);previewHeading.Children.Add(previewActions);center.Children.Add(previewHeading);
var viewRow=new Grid{ColumnDefinitions=new("Auto,*,Auto")};previewMode.MinWidth=125;previewMode.FontSize=11;viewRow.Children.Add(previewMode);var switches=new StackPanel{Orientation=Orientation.Horizontal,VerticalAlignment=VerticalAlignment.Center};spatial.Content="Overlay";compare.Content="Compare";spatial.Margin=new(0,0,12,0);switches.Children.Add(spatial);switches.Children.Add(compare);Grid.SetColumn(switches,2);viewRow.Children.Add(switches);Grid.SetRow(viewRow,1);center.Children.Add(viewRow);
var viewRow=new Grid{ColumnDefinitions=new("Auto,*,Auto")};previewMode.MinWidth=125;previewMode.FontSize=11;viewRow.Children.Add(previewMode);var switches=new StackPanel{Orientation=Orientation.Horizontal,VerticalAlignment=VerticalAlignment.Center};spatial.Content="Overlay";compare.Content="Compare";spatial.Margin=new(0,0,12,0);switches.Children.Add(spatial);switches.Children.Add(compare);switches.Children.Add(compareTarget);Grid.SetColumn(switches,2);viewRow.Children.Add(switches);Grid.SetRow(viewRow,1);center.Children.Add(viewRow);
previewWorkspace.Children.Add(previewPanel);Grid.SetColumn(comparisonBorder,1);previewWorkspace.Children.Add(comparisonBorder);comparisonBorder.IsVisible=false;Grid.SetRow(previewWorkspace,2);center.Children.Add(previewWorkspace);
Grid.SetRow(previewControls,3);center.Children.Add(previewControls);
var caption=new StackPanel{Spacing=4,Margin=new(0,0,0,12)};exposureName.TextTrimming=TextTrimming.CharacterEllipsis;caption.Children.Add(exposureName);caption.Children.Add(exposureStatus);Grid.SetRow(caption,4);center.Children.Add(caption);
@ -107,7 +109,7 @@ public sealed partial class MainWindow:Window
analyze.Click+=async(_,_)=>await Analyze();export.Click+=async(_,_)=>await ExportAccepted();stop.Click+=(_,_)=>cancellation?.Cancel();
filter.SelectionChanged+=(_,_)=>{if(!refreshing)RefreshFrames();};sort.SelectionChanged+=(_,_)=>{if(!refreshing)RefreshFrames();};metric.SelectionChanged+=(_,_)=>{chart.Metric=QualityChart.Metrics[Math.Max(0,metric.SelectedIndex)];chart.InvalidateVisual();};
chart.FrameClicked+=f=>{if(!visible.Contains(f))filter.SelectedIndex=0;frames.SelectedItem=f;frames.ScrollIntoView(f);Select(f);};
spatial.IsCheckedChanged+=(_,_)=>{preview.Spatial=comparison.Spatial=spatial.IsChecked==true;preview.InvalidateVisual();comparison.InvalidateVisual();};compare.IsCheckedChanged+=(_,_)=>UpdateComparison();
spatial.IsCheckedChanged+=(_,_)=>{preview.Spatial=comparison.Spatial=spatial.IsChecked==true;preview.InvalidateVisual();comparison.InvalidateVisual();};compare.IsCheckedChanged+=(_,_)=>UpdateComparison();compareTarget.SelectionChanged+=(_,_)=>UpdateComparison();
ToolTip.SetTip(spatial,"Pink shows the strongest excess sky brightness against the clean session reference, excluding weak background residuals. Grid colors show regional stellar flux. This is supporting evidence, not an exact cloud boundary.");
KeyDown+=async(_,e)=>
{
@ -243,10 +245,18 @@ public sealed partial class MainWindow:Window
void UpdateComparison()
{
bool show=compare.IsChecked==true;comparisonBorder.IsVisible=show;previewWorkspace.ColumnDefinitions[1].Width=show?new GridLength(1,GridUnitType.Star):new GridLength(0);previewPanel.Margin=show?new(0,0,6,0):new(0);
preview.Caption=show?"Selected":"";comparison.Caption=show?"Nearby":"";preview.InvalidateVisual();
bool best=compareTarget.SelectedIndex==1;compareTarget.IsVisible=show;
preview.Caption=show?"Selected":"";comparison.Caption=show?best?"Best":"Nearby":"";preview.InvalidateVisual();
comparison.Spatial=spatial.IsChecked==true;
if(selected==null||project==null||!show){comparison.Load(projectDirectory,null);return;}
var nearby=project.Frames.Where(f=>f.Session==selected.Session&&f.Id!=selected.Id&&f.Timestamp.HasValue&&selected.Timestamp.HasValue&&f.Error=="").OrderBy(f=>Math.Abs((f.Timestamp!.Value-selected.Timestamp!.Value).TotalSeconds)).FirstOrDefault();comparison.Load(projectDirectory,nearby,project.Frames);ToolTip.SetTip(comparisonBorder,nearby==null?"No comparable nearby exposure":"Nearby · "+nearby.Time+" · "+nearby.Status);
var other=best?BestFrame(project.Frames,selected):project.Frames.Where(f=>f.Session==selected.Session&&f.Id!=selected.Id&&f.Timestamp.HasValue&&selected.Timestamp.HasValue&&f.Error=="").OrderBy(f=>Math.Abs((f.Timestamp!.Value-selected.Timestamp!.Value).TotalSeconds)).FirstOrDefault();
comparison.Load(projectDirectory,other,project.Frames);ToolTip.SetTip(comparisonBorder,other==null?best?"No other kept, measured exposure in this session":"No comparable nearby exposure":(best?"Best":"Nearby")+" · "+other.Time+" · "+other.Status+(best?$" · score {other.Score:0} · FWHM {other.Fwhm:0.00}":""));
}
// Best kept exposure in the same session: highest quality score, then sharpest stars, then strongest stellar flux.
static Frame? BestFrame(IEnumerable<Frame> frames,Frame selected)
{
return frames.Where(f=>f.Session==selected.Session&&f.Id!=selected.Id&&f.Error==""&&f.Measured&&f.Effective==Verdict.Keep&&f.Fwhm>0)
.OrderByDescending(f=>f.Score).ThenBy(f=>f.Fwhm).ThenByDescending(f=>f.Transparency).ThenBy(f=>f.Timestamp).FirstOrDefault();
}
void Move(int step){if(visible.Count==0)return;int index=selected==null?0:visible.IndexOf(selected);var f=visible[Math.Clamp(index+step,0,visible.Count-1)];frames.SelectedItem=f;frames.ScrollIntoView(f);}
async Task Override(Verdict? verdict,bool advance=true)