From 0a6476d428e437b647abf583df0858112b381f9a Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 3 Oct 2026 19:50:21 -0700 Subject: [PATCH 01/12] Use Forgejo single-commit route and validate release publisher in CI --- docs/releases.md | 2 +- packaging/Build-ServerRelease.ps1 | 1 + packaging/Publish.ps1 | 2 +- tools/Verify-ReleaseAutomation.ps1 | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index b74979c..276966f 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -69,7 +69,7 @@ git push origin v1.0.1 Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. For the first release, use `v1.0.0` after pushing this workflow and the finalized source. -The job runs the engine and updater validation suites, builds both packages, renders the Linux settings page under Xvfb, then uploads everything into one draft release. Only after all uploads succeed does it make the release public, so users cannot discover an incomplete update. No local installer build or manual asset attachment is needed. +The job runs the engine, updater and release-publisher validation suites, builds both packages, renders the Linux settings page under Xvfb, then uploads everything into one draft release. Only after all uploads succeed does it make the release public, so users cannot discover an incomplete update. No local installer build or manual asset attachment is needed. Use **Actions → Release AstroFrame → Run workflow** on `main` to verify runner setup without publishing. A manual run on a version tag publishes that version. Existing published releases cannot be overwritten. Interrupted uploads remain draft releases and can resume when matching build files are reused. If a fresh rebuild generates different bytes, the publisher reports the conflicting draft asset; remove the incomplete draft explicitly before rerunning. Do not delete an already published version. diff --git a/packaging/Build-ServerRelease.ps1 b/packaging/Build-ServerRelease.ps1 index efa769f..5842ee8 100644 --- a/packaging/Build-ServerRelease.ps1 +++ b/packaging/Build-ServerRelease.ps1 @@ -12,5 +12,6 @@ if (!$Ref) { throw 'Supply the source ref, for example -Ref refs/tags/v1.0.0 or Write-Output "Validating AstroFrame $version from $Ref" & ./Build.ps1 -Test if ($LASTEXITCODE) { throw 'Release validation failed.' } +& ./tools/Verify-ReleaseAutomation.ps1 & ./packaging/Release.ps1 -Version $version -Platform Both -PublishRoot artifacts/server-release/publish -Output artifacts/server-release/packages Write-Output "Windows and Linux packages ready for AstroFrame $version." diff --git a/packaging/Publish.ps1 b/packaging/Publish.ps1 index f525df9..6c83398 100644 --- a/packaging/Publish.ps1 +++ b/packaging/Publish.ps1 @@ -43,7 +43,7 @@ if ($LASTEXITCODE) { throw 'Cannot identify the release commit.' } $status = @(& git status --porcelain) if ($LASTEXITCODE) { throw 'Cannot check release source status.' } if ($status.Count -gt 0) { throw 'Commit the release source and push it before publishing.' } -Invoke-RestMethod "$api/commits/$commit" -Headers $headers | Out-Null +Invoke-RestMethod "$api/git/commits/$commit" -Headers $headers | Out-Null $tag = "v$Version" $remoteTag = $null try { $remoteTag = Invoke-RestMethod "$api/tags/$tag" -Headers $headers } diff --git a/tools/Verify-ReleaseAutomation.ps1 b/tools/Verify-ReleaseAutomation.ps1 index c06815c..3be0301 100644 --- a/tools/Verify-ReleaseAutomation.ps1 +++ b/tools/Verify-ReleaseAutomation.ps1 @@ -23,7 +23,8 @@ function git { function Invoke-RestMethod { param([string]$Uri, [string]$Method='Get', $Headers, [string]$ContentType, [string]$Body, $Form) $state.Calls++ - if ($Uri -match '/commits/') { return @{ sha=('a'*40) } } + # Forgejo's single-commit route is /git/commits/{sha}; /commits/{sha} is a 404. + if ($Method -eq 'Get' -and $Uri -match '/git/commits/[0-9a-f]{40}$') { return @{ sha=('a'*40) } } if ($Uri -match '/tags/' -and $Uri -notmatch '/releases/tags/') { return @{ commit=@{sha=$state.TagCommit} } } if ($Uri -match '/releases/tags/') { if (!$state.Created) { throw [Microsoft.PowerShell.Commands.HttpResponseException]::new('Not found', [Net.Http.HttpResponseMessage]::new([Net.HttpStatusCode]::NotFound)) } From 87d2c242889f41b1e0f4ff4848d0ea859ce48d6d Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 3 Oct 2026 19:51:22 -0700 Subject: [PATCH 02/12] Release AstroFrame 1.0.1 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b167766..7fa2fea 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.0.0 + 1.0.1 Elijah Kuntz AstroFrame From 1e8e8c88febee6bd5fd1635925cc92195b334cca Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 3 Oct 2026 19:55:36 -0700 Subject: [PATCH 03/12] Document published 1.0.1 and verified public update feed --- README.md | 2 +- docs/releases.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d3766fc..cc7af44 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Exports include `accepted.txt` with accepted output paths and `decisions.csv` wi ## Build and validate -The [server release workflow](.forgejo/workflows/release.yml) builds and publishes both platforms when a stable version tag such as `v1.0.1` is pushed. Set the matching version with `./packaging/Set-Version.ps1 -Version 1.0.1`, commit/push the source, then push the tag. It uses the existing Docker runner and automatically supplied Forgejo token. Pushes and manual Actions runs on `main` check the build without publishing. See [automatic releases](docs/releases.md#automatic-server-releases). +The [server release workflow](.forgejo/workflows/release.yml) builds and publishes both platforms when a stable version tag such as `v1.0.2` is pushed. Set the matching version with `./packaging/Set-Version.ps1 -Version 1.0.2`, commit/push the source, then push the tag. It uses the existing Docker runner and automatically supplied Forgejo token. Pushes and manual Actions runs on `main` check the build without publishing. Version [1.0.1 is published](https://git.elijahkuntz.com/Elijah/AstroFrame/releases/tag/v1.0.1). See [automatic releases](docs/releases.md#automatic-server-releases). Requires a .NET 8 SDK. `Build.ps1` uses the workspace-local SDK if present, otherwise `dotnet` from PATH: diff --git a/docs/releases.md b/docs/releases.md index 276966f..6208f5f 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -2,7 +2,7 @@ ## First release -Version **1.0.0** targets x64 Windows and Linux desktops. Windows uses a per-user Velopack installer. Linux uses one self-contained AppImage plus an optional per-user application-menu installer; the same binary targets both Debian and Arch. No Git client, Python, .NET runtime installation or administrator access is required to install AstroFrame itself. +The first published version, **1.0.1**, targets x64 Windows and Linux desktops. Download it from [the release page](https://git.elijahkuntz.com/Elijah/AstroFrame/releases/tag/v1.0.1). Windows uses a per-user Velopack installer. Linux uses one self-contained AppImage plus an optional per-user application-menu installer; the same binary targets both Debian and Arch. No Git client, Python, .NET runtime installation or administrator access is required to install AstroFrame itself. ### Windows @@ -59,15 +59,15 @@ Once this workflow is committed and pushed, enable Actions for the AstroFrame re To release a new version: ```powershell -./packaging/Set-Version.ps1 -Version 1.0.1 +./packaging/Set-Version.ps1 -Version 1.0.2 git add Directory.Build.props -git commit -m "Release 1.0.1" +git commit -m "Release 1.0.2" git push origin main -git tag v1.0.1 -git push origin v1.0.1 +git tag v1.0.2 +git push origin v1.0.2 ``` -Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. For the first release, use `v1.0.0` after pushing this workflow and the finalized source. +Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. Version `v1.0.1` is published; `v1.0.0` remains an unpublished tag from the first failed publishing attempt. Choose a new version for each later release. The job runs the engine, updater and release-publisher validation suites, builds both packages, renders the Linux settings page under Xvfb, then uploads everything into one draft release. Only after all uploads succeed does it make the release public, so users cannot discover an incomplete update. No local installer build or manual asset attachment is needed. @@ -89,14 +89,14 @@ The Windows script cross-packages both platforms. Results appear in `artifacts/r On Linux with a .NET 10 SDK: ```sh -bash packaging/release.sh 1.0.0 +bash packaging/release.sh 1.0.1 ``` That script builds the Linux channel. The tool manifest pins Velopack CLI 1.2.161, matching the application's SDK dependency. Building on Windows is enough to create both packages, but compatibility should still be checked on target Linux desktops. ## Publish to the repository -Commit and push the versioned source first. The initial release has **not** been uploaded by this implementation. To make update discovery live, create a public stable release tagged `v1.0.0` and attach the files described below. +Commit and push the versioned source first. Version `v1.0.1` was built and published automatically by the server. The following local publisher is an alternative to the tag workflow for future versions. The helper script reads a repository-write token from `ASTROFRAME_RELEASE_TOKEN` in the process environment. On the server this is supplied automatically by the workflow. For local publication, set your own Gitea/Forgejo repository-write token. The script uploads both platforms into one draft, including the Linux installation helpers. It does not store the token or embed it in the application: @@ -129,6 +129,6 @@ dotnet run --project tests/AstroFrame.Updates.Validation -c Release -- artifacts That test feed must contain a **1.0.1** package for the requested channel; it is not a production release. An explicit packaged-app `--verify-update --apply` probe verifies actual replacement and restart. A `--capture-settings [width] [dpi]` diagnostic captures the real settings page. -Both Windows and Linux local 1.0.0 → 1.0.1 replacement/restart were exercised during implementation. Linux rendering and per-user installation were checked under Ubuntu WSL with the missing ICU/X11 libraries extracted into a workspace test directory. Debian and Arch desktop execution have not yet been tested directly; those compatibility targets are based on the cross-platform runtime and documented system dependencies, not separate distro acceptance runs. The public repository API was verified anonymously; it currently contains no published releases. +Both Windows and Linux local 1.0.0 → 1.0.1 replacement/restart were exercised during implementation. Linux rendering and per-user installation were checked under Ubuntu WSL with the missing ICU/X11 libraries extracted into a workspace test directory. Debian and Arch desktop execution have not yet been tested directly; those compatibility targets are based on the cross-platform runtime and documented system dependencies, not separate distro acceptance runs. Server run #8 built and published version 1.0.1 with all 13 assets, passed 39 engine, 18 updater and 10 publisher checks, and rendered the packaged Linux settings page under Debian Bookworm. A packaged Linux 1.0.0 app also discovered and downloaded the public 1.0.1 update through the real Gitea source with checksum validation. References: [Velopack C# integration](https://docs.velopack.io/getting-started/csharp), [cross-packaging](https://docs.velopack.io/packaging/cross-compiling), [Linux update behavior](https://docs.velopack.io/packaging/operating-systems/linux), [Gitea distribution](https://docs.velopack.io/distributing/self-hosting), [Avalonia Linux dependencies](https://v11.docs.avaloniaui.net/docs/overview/supported-platforms/). From 6b56c0b1226a9dc6ae8930a8a910da5015c90526 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 3 Oct 2026 20:36:20 -0700 Subject: [PATCH 04/12] Release 1.0.2 with localized sky overlay and cloud-resistant display fit --- Directory.Build.props | 2 +- README.md | 2 +- docs/release-notes/1.0.2.md | 9 ++ docs/releases.md | 12 +-- packaging/Publish.ps1 | 4 +- src/AstroFrame.Desktop/MainWindow.cs | 5 +- src/AstroFrame.Desktop/Visuals.cs | 24 ++--- src/AstroFrame.Engine/Models.cs | 2 + src/AstroFrame.Engine/SkyModel.cs | 7 +- src/AstroFrame.Engine/SkyOverlay.cs | 88 +++++++++++++++++++ src/AstroFrame.Engine/SpatialReference.cs | 4 + .../AstroFrame.Validation.csproj | 1 + .../Fixtures/overlay-backgrounds.json | 1 + .../AstroFrame.Validation/ImageRegression.cs | 12 +++ .../OverlayRegression.cs | 77 ++++++++++++++++ tests/AstroFrame.Validation/Program.cs | 1 + 16 files changed, 227 insertions(+), 24 deletions(-) create mode 100644 docs/release-notes/1.0.2.md create mode 100644 src/AstroFrame.Engine/SkyOverlay.cs create mode 100644 tests/AstroFrame.Validation/Fixtures/overlay-backgrounds.json create mode 100644 tests/AstroFrame.Validation/OverlayRegression.cs diff --git a/Directory.Build.props b/Directory.Build.props index 7fa2fea..3c93a1e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.0.1 + 1.0.2 Elijah Kuntz AstroFrame diff --git a/README.md b/README.md index cc7af44..3ac163a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Exports include `accepted.txt` with accepted output paths and `decisions.csv` wi ## Build and validate -The [server release workflow](.forgejo/workflows/release.yml) builds and publishes both platforms when a stable version tag such as `v1.0.2` is pushed. Set the matching version with `./packaging/Set-Version.ps1 -Version 1.0.2`, commit/push the source, then push the tag. It uses the existing Docker runner and automatically supplied Forgejo token. Pushes and manual Actions runs on `main` check the build without publishing. Version [1.0.1 is published](https://git.elijahkuntz.com/Elijah/AstroFrame/releases/tag/v1.0.1). See [automatic releases](docs/releases.md#automatic-server-releases). +The [server release workflow](.forgejo/workflows/release.yml) builds and publishes both platforms when a stable version tag such as `v1.0.3` is pushed. Set the matching version with `./packaging/Set-Version.ps1 -Version 1.0.3`, commit/push the source, then push the tag. It uses the existing Docker runner and automatically supplied Forgejo token. Pushes and manual Actions runs on `main` check the build without publishing. Version 1.0.2 fixes the spatial preview overlay; see [release notes](docs/release-notes/1.0.2.md) and [automatic releases](docs/releases.md#automatic-server-releases). Requires a .NET 8 SDK. `Build.ps1` uses the workspace-local SDK if present, otherwise `dotnet` from PATH: diff --git a/docs/release-notes/1.0.2.md b/docs/release-notes/1.0.2.md new file mode 100644 index 0000000..d0b59ed --- /dev/null +++ b/docs/release-notes/1.0.2.md @@ -0,0 +1,9 @@ +AstroFrame 1.0.2 fixes the spatial preview overlay. + +- Pink now highlights positive sky structure relative to the clean session reference, rather than both brighter and darker differences. +- A cloud-resistant background fit removes offset and gradient without creating false highlights in clear corners. +- Strong and moderately bright cloud patches remain visible; weak background residuals are excluded. +- A legend explains the pink fill and the regional stellar-flux grid. +- Existing projects reconstruct the corrected display from cached measurements without requiring a full reanalysis. Classification metrics, decisions, notes and source images are preserved. + +Verified on the reported NGC 1432 exposures ending in 235115, 235146 and 235248, with regressions for visible cloud cores, dark comparison regions and read-only project reconstruction. diff --git a/docs/releases.md b/docs/releases.md index 6208f5f..0a1cc63 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -40,6 +40,8 @@ To uninstall a script-installed Linux copy, close AstroFrame and remove only `~/ ## Settings and updates +Version **1.0.2** corrects the spatial preview overlay. Pink shows the strongest positive sky structure against the clean session reference; the display fit resists bright cloud contamination, and weak background residuals are suppressed. Both bright and moderately bright cloud patches remain visible. The grid shows regional stellar flux. This is supporting evidence rather than an exact cloud boundary. Existing saved projects reconstruct the display from cached catalogs without changing classification metrics or human decisions. See [1.0.2 release notes](release-notes/1.0.2.md). + Open **Settings → Updates** for the installed version, update status, last successful check, automatic-check preference, and **Check for updates**. The sidebar and independent settings store leave room for future categories. Installed packages check on launch and every six hours while running. A persistent **Settings · Update available** indicator appears when a newer stable version is found. **Install update and restart** downloads the update, validates its package checksum, saves the project and restarts. Analysis, export and saving block installation; if work starts during download, the package remains ready for a later restart. Projects and settings survive updates. Failed checks display an error rather than claiming the app is up to date. Source-tree builds explain that installing a package enables updates. @@ -59,12 +61,12 @@ Once this workflow is committed and pushed, enable Actions for the AstroFrame re To release a new version: ```powershell -./packaging/Set-Version.ps1 -Version 1.0.2 +./packaging/Set-Version.ps1 -Version 1.0.3 git add Directory.Build.props -git commit -m "Release 1.0.2" +git commit -m "Release 1.0.3" git push origin main -git tag v1.0.2 -git push origin v1.0.2 +git tag v1.0.3 +git push origin v1.0.3 ``` Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. Version `v1.0.1` is published; `v1.0.0` remains an unpublished tag from the first failed publishing attempt. Choose a new version for each later release. @@ -89,7 +91,7 @@ The Windows script cross-packages both platforms. Results appear in `artifacts/r On Linux with a .NET 10 SDK: ```sh -bash packaging/release.sh 1.0.1 +bash packaging/release.sh 1.0.2 ``` That script builds the Linux channel. The tool manifest pins Velopack CLI 1.2.161, matching the application's SDK dependency. Building on Windows is enough to create both packages, but compatibility should still be checked on target Linux desktops. diff --git a/packaging/Publish.ps1 b/packaging/Publish.ps1 index 6c83398..6d41223 100644 --- a/packaging/Publish.ps1 +++ b/packaging/Publish.ps1 @@ -55,7 +55,9 @@ try { $release = Invoke-RestMethod "$api/releases/tags/$tag" -Headers $headers } catch { if ([int]$_.Exception.Response.StatusCode -ne 404) { throw } } if ($release -and !$release.draft) { throw "$tag is already published. Release assets are immutable; build a new version." } if (!$release) { - $body = @{ tag_name=$tag; target_commitish=$commit; name="AstroFrame $Version"; body="AstroFrame $Version for Windows and Linux. See the repository README for installation and update instructions."; draft=$true; prerelease=$false } | ConvertTo-Json + $notesPath = Join-Path 'docs/release-notes' "$Version.md" + $notes = if (Test-Path -LiteralPath $notesPath) { Get-Content -LiteralPath $notesPath -Raw } else { "AstroFrame $Version for Windows and Linux. See the repository README for installation and update instructions." } + $body = @{ tag_name=$tag; target_commitish=$commit; name="AstroFrame $Version"; body=$notes; draft=$true; prerelease=$false } | ConvertTo-Json $release = Invoke-RestMethod "$api/releases" -Method Post -Headers $headers -ContentType 'application/json' -Body $body } $attached = @(Invoke-RestMethod "$api/releases/$($release.id)/assets" -Headers $headers) diff --git a/src/AstroFrame.Desktop/MainWindow.cs b/src/AstroFrame.Desktop/MainWindow.cs index b015780..2e54b1e 100644 --- a/src/AstroFrame.Desktop/MainWindow.cs +++ b/src/AstroFrame.Desktop/MainWindow.cs @@ -94,6 +94,7 @@ public sealed partial class MainWindow:Window 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=spatial.IsChecked==true;preview.InvalidateVisual();};compare.IsCheckedChanged+=(_,_)=>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)=> { if(busy||updates.Applying||e.Source is TextBox)return; @@ -205,7 +206,7 @@ public sealed partial class MainWindow:Window { selected=f;chart.Selected=f;chart.InvalidateVisual();details.IsVisible=true;inspector.Children.Clear(); position.Text=$"{visible.IndexOf(f)+1:N0} / {visible.Count:N0}"; - preview.Load(projectDirectory,f);preview.Spatial=spatial.IsChecked==true;UpdateComparison(); + preview.Load(projectDirectory,f,project?.Frames);preview.Spatial=spatial.IsChecked==true;UpdateComparison(); exposureName.Text=f.Name;ToolTip.SetTip(exposureName,f.Name);exposureStatus.Text=f.Status+" · "+f.Time+" UTC"+(f.Override.HasValue?" · Manual":"");exposureStatus.Foreground=Palette.Verdict(f.Effective); inspector.Children.Add(Palette.Label("DECISION EVIDENCE",10,Palette.Muted)); inspector.Children.Add(new TextBlock{Text=f.Cause,FontSize=14,Foreground=Palette.Text,TextWrapping=TextWrapping.Wrap}); @@ -227,7 +228,7 @@ public sealed partial class MainWindow:Window 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(); 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);ToolTip.SetTip(comparisonBorder,nearby==null?"No comparable nearby exposure":"Nearby · "+nearby.Time+" · "+nearby.Status); + 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); } 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) diff --git a/src/AstroFrame.Desktop/Visuals.cs b/src/AstroFrame.Desktop/Visuals.cs index 4ac2af9..034ba38 100644 --- a/src/AstroFrame.Desktop/Visuals.cs +++ b/src/AstroFrame.Desktop/Visuals.cs @@ -75,6 +75,7 @@ public sealed class ExposureView:Control,IDisposable static readonly SemaphoreSlim LoadGate=new(1); WriteableBitmap? bitmap; PreviewDisplay? frameDisplay,nebulaDisplay; + byte[] overlayMask=[]; CancellationTokenSource? request; string message="Select an exposure"; public Task Loading {get;private set;}=Task.CompletedTask; @@ -85,18 +86,18 @@ public sealed class ExposureView:Control,IDisposable public double Stretch {get;set;}=.18; public string Caption {get;set;}=""; public ExposureView(){RenderOptions.SetBitmapInterpolationMode(this,BitmapInterpolationMode.HighQuality);} - public void Load(string projectDirectory,Frame? f) + public void Load(string projectDirectory,Frame? f,IReadOnlyList? frames=null) { Dispose();Frame=f;message=f==null?"Select an exposure":"Loading preview…";InvalidateVisual(); if(f==null){Loading=Task.CompletedTask;return;} - request=new();Loading=LoadCore(projectDirectory,f,request.Token); + request=new();Loading=LoadCore(projectDirectory,f,frames??[],request.Token); } - async Task LoadCore(string directory,Frame f,CancellationToken token) + async Task LoadCore(string directory,Frame f,IReadOnlyList frames,CancellationToken token) { try { await LoadGate.WaitAsync(token); - (PreviewDisplay Frame,PreviewDisplay Nebula) prepared; + (PreviewDisplay Frame,PreviewDisplay Nebula,byte[] Overlay) prepared; try { prepared=await Task.Run(async()=> @@ -109,11 +110,11 @@ public sealed class ExposureView:Control,IDisposable await ResourcePolicy.WaitForHeadroom(ResourcePolicy.EstimateFrameBytes(f.Width,f.Height,f.Bayer!=""?2:1),token); var image=Fits.Read(f.Path,token);token.ThrowIfCancellationRequested();Fits.Preview(image,path,f);plane=PreviewRenderer.Read(path,f); } - token.ThrowIfCancellationRequested();return(PreviewRenderer.Prepare(plane),PreviewRenderer.Prepare(plane,true)); + token.ThrowIfCancellationRequested();return(PreviewRenderer.Prepare(plane),PreviewRenderer.Prepare(plane,true),SkyOverlay.LoadMask(directory,f,frames,token)); },token); } finally{LoadGate.Release();} - token.ThrowIfCancellationRequested();frameDisplay=prepared.Frame;nebulaDisplay=prepared.Nebula;RefreshDisplay(); + token.ThrowIfCancellationRequested();frameDisplay=prepared.Frame;nebulaDisplay=prepared.Nebula;overlayMask=prepared.Overlay;RefreshDisplay(); } catch(OperationCanceledException){} catch(Exception e){if(!token.IsCancellationRequested){message="Preview unavailable: "+e.Message;InvalidateVisual();}} @@ -129,8 +130,9 @@ public sealed class ExposureView:Control,IDisposable { base.Render(c);c.FillRectangle(Palette.Background,new Rect(Bounds.Size)); if(bitmap==null){c.DrawText(new FormattedText(message,System.Globalization.CultureInfo.CurrentCulture,FlowDirection.LeftToRight,new Typeface("Inter"),13,Palette.Muted){MaxTextWidth=Math.Max(100,Bounds.Width-32)},new(16,20));return;} - double header=Caption!=""?26:0; - if(header>0)c.DrawText(new FormattedText(Caption+" · "+Frame?.Time,System.Globalization.CultureInfo.CurrentCulture,FlowDirection.LeftToRight,new Typeface("Inter"),10,Palette.Muted),new(8,7)); + double captionHeight=Caption!=""?26:0,header=captionHeight+(Spatial?22:0); + if(captionHeight>0)c.DrawText(new FormattedText(Caption+" · "+Frame?.Time,System.Globalization.CultureInfo.CurrentCulture,FlowDirection.LeftToRight,new Typeface("Inter"),10,Palette.Muted),new(8,7)); + if(Spatial)c.DrawText(new FormattedText(overlayMask.Length==SkyModel.Count?"Pink: excess sky · Grid: stellar flux":"Sky overlay unavailable · cached reference required",System.Globalization.CultureInfo.CurrentCulture,FlowDirection.LeftToRight,new Typeface("Inter"),10,Palette.Muted){MaxTextWidth=Math.Max(1,Bounds.Width-16)},new(8,captionHeight+5)); double scale=Math.Min(Bounds.Width/bitmap.PixelSize.Width,Math.Max(1,Bounds.Height-header)/bitmap.PixelSize.Height),w=bitmap.PixelSize.Width*scale,h=bitmap.PixelSize.Height*scale;var rect=new Rect((Bounds.Width-w)/2,header+(Bounds.Height-header-h)/2,w,h);c.DrawImage(bitmap,new Rect(bitmap.Size),rect); if(Spatial&&Frame!=null&&Frame.Alignment.Length==4) { @@ -140,8 +142,8 @@ public sealed class ExposureView:Control,IDisposable { StreamGeometry Cell(double x,double y,double dx,double dy) {var geometry=new StreamGeometry();using(var g=geometry.Open()){g.BeginFigure(Map(x,y),true);g.LineTo(Map(x+dx,y));g.LineTo(Map(x+dx,y+dy));g.LineTo(Map(x,y+dy));g.EndFigure(true);}return geometry;} - if(f.CloudMask.Length==SkyModel.Count)for(int i=0;i0) - c.DrawGeometry(new SolidColorBrush(Color.FromArgb(85,245,142,155)),null,Cell((double)(i%SkyModel.Columns)/SkyModel.Columns,(double)(i/SkyModel.Columns)/SkyModel.Rows,1.0/SkyModel.Columns,1.0/SkyModel.Rows)); + if(overlayMask.Length==SkyModel.Count)for(int i=0;i0) + c.DrawGeometry(new SolidColorBrush(Color.FromArgb((byte)Math.Round(105*overlayMask[i]/255.0),245,142,155)),null,Cell((double)(i%SkyModel.Columns)/SkyModel.Columns,(double)(i/SkyModel.Columns)/SkyModel.Rows,1.0/SkyModel.Columns,1.0/SkyModel.Rows)); for(int i=0;i<12;i++) { double baseline=f.Baselines.GetValueOrDefault($"Region {i+1}"),ratio=baseline>0?f.RegionFlux[i]/baseline:1; @@ -151,5 +153,5 @@ public sealed class ExposureView:Control,IDisposable } } } - public void Dispose(){request?.Cancel();request?.Dispose();request=null;bitmap?.Dispose();bitmap=null;frameDisplay=nebulaDisplay=null;} + public void Dispose(){request?.Cancel();request?.Dispose();request=null;bitmap?.Dispose();bitmap=null;frameDisplay=nebulaDisplay=null;overlayMask=[];} } diff --git a/src/AstroFrame.Engine/Models.cs b/src/AstroFrame.Engine/Models.cs index 078c365..8656e19 100644 --- a/src/AstroFrame.Engine/Models.cs +++ b/src/AstroFrame.Engine/Models.cs @@ -35,6 +35,8 @@ public sealed class Frame public double CloudSignificance {get;set;} public double ReferenceConfidence {get;set;} public byte[] CloudMask {get;set;}=[]; + // Pink overlay strength (0–255); independent of the two-sided classification mask. + public byte[] ExcessSkyMask {get;set;}=[]; [System.Text.Json.Serialization.JsonIgnore] public float[] SkyMap {get;set;}=[]; [System.Text.Json.Serialization.JsonIgnore] public float[] SkyNoise {get;set;}=[]; [System.Text.Json.Serialization.JsonIgnore] public double[] ForcedFlux {get;set;}=[]; diff --git a/src/AstroFrame.Engine/SkyModel.cs b/src/AstroFrame.Engine/SkyModel.cs index eac5e41..5ac1210 100644 --- a/src/AstroFrame.Engine/SkyModel.cs +++ b/src/AstroFrame.Engine/SkyModel.cs @@ -25,7 +25,8 @@ public static class SkyModel int col=Math.Min((int)u,Columns-2),row=Math.Min((int)v,Rows-2);double dx=u-col,dy=v-row; return (map[row*Columns+col]*(1-dx)+map[row*Columns+col+1]*dx)*(1-dy)+(map[(row+1)*Columns+col]*(1-dx)+map[(row+1)*Columns+col+1]*dx)*dy; } - public static double[] Aligned(Frame f) + public static double[] Aligned(Frame f)=>Detrend(AlignedBackground(f)); + public static double[] AlignedBackground(Frame f) { double[] map=Enumerable.Repeat(double.NaN,Count).ToArray();if(f.Alignment.Length!=4||f.SkyMap.Length!=Count)return map; var a=f.Alignment;double aspect=(double)f.Height/f.Width; @@ -35,7 +36,7 @@ public static class SkyModel double u=a[0]*x-a[1]*y*aspect+a[2],v=(a[1]*x+a[0]*y*aspect+a[3])/aspect; if(u>.025&&u<.975&&v>.025&&v<.975)map[i]=Sample(f.SkyMap,u,v); } - return Detrend(map); + return map; } public static double[] Detrend(double[] values) { @@ -56,7 +57,7 @@ public static class SkyModel } return residual; } - static double[] Solve(double[,] m) + internal static double[] Solve(double[,] m) { for(int k=0;k<3;k++) { diff --git a/src/AstroFrame.Engine/SkyOverlay.cs b/src/AstroFrame.Engine/SkyOverlay.cs new file mode 100644 index 0000000..94d0edd --- /dev/null +++ b/src/AstroFrame.Engine/SkyOverlay.cs @@ -0,0 +1,88 @@ +namespace AstroFrame.Engine; + +/// Display excess sky brightness without calling darker residuals cloud glow. +public static class SkyOverlay +{ + public sealed class Reference(double[] background,double[] scatter,double noise) + { + public byte[] Measure(Frame frame)=>ExcessMask(Residual(SkyModel.AlignedBackground(frame).Select((v,j)=>v-background[j]).ToArray(),noise),scatter); + } + + // Cloud glow is one-sided contamination of the local sky. An asymmetric fit + // gives clear cells more influence than bright patches when removing the + // offset/gradient, instead of introducing positive residuals in dark corners. + static double[] Residual(double[] values,double noise) + { + if(values.Count(double.IsFinite)<12)return Enumerable.Repeat(double.NaN,SkyModel.Count).ToArray(); + double[] coefficients=[Robust.Median(values),0,0];noise=Math.Max(.1,noise); + for(int iteration=0;iteration<80;iteration++) + { + double[,] system=new double[3,4]; + for(int i=0;i=0?.15:.85)/Math.Max(noise,Math.Abs(residual)); + for(int r=0;r<3;r++){for(int c=0;c<3;c++)system[r,c]+=weight*v[r]*v[c];system[r,3]+=weight*v[r]*values[i];} + } + var fitted=SkyModel.Solve(system);double change=fitted.Zip(coefficients,(a,b)=>Math.Abs(a-b)).Max();coefficients=fitted; + if(change<.01)break; + } + return values.Select((v,i)=>v-coefficients[0]-coefficients[1]*((i%SkyModel.Columns+.5)/SkyModel.Columns-.5)-coefficients[2]*((i/SkyModel.Columns+.5)/SkyModel.Rows-.5)).ToArray(); + } + + public static Reference? CreateReference(IEnumerable frames,CancellationToken ct) + { + var clean=frames.ToArray();if(clean.Length==0)return null; + List maps=[];foreach(var f in clean){ct.ThrowIfCancellationRequested();maps.Add(SkyModel.AlignedBackground(f));} + double[] median=Enumerable.Range(0,SkyModel.Count).Select(j=>maps.Any(m=>double.IsFinite(m[j]))?Robust.Median(maps.Select(m=>m[j])):double.NaN).ToArray(); + double floor=Math.Max(.1,Robust.Median(clean.Select(f=>f.Noise))*.08); + List residuals=[];foreach(var map in maps){ct.ThrowIfCancellationRequested();residuals.Add(Residual(map.Select((v,j)=>v-median[j]).ToArray(),floor));} + double[] scatter=Enumerable.Range(0,SkyModel.Count).Select(j=>Math.Max(floor,Robust.Mad(residuals.Select(m=>m[j])))).ToArray(); + return new(median,scatter,floor); + } + + public static byte[] ExcessMask(double[] residual,double[] scatter) + { + if(residual.Length!=SkyModel.Count||scatter.Length!=SkyModel.Count)return []; + // Use both reference scatter and the structure's dynamic range to exclude + // weak background-fit residuals. Saturate locally significant structure + // quickly so a bright cloud cannot wash out a second, fainter cloud. + double scale=Math.Max(.1,Robust.Quantile(residual.Where(v=>v>0),.95)); + return residual.Select((v,j)=> + { + double threshold=Math.Max(5*scatter[j],scale*.15); + if(!double.IsFinite(v)||!double.IsFinite(threshold)||threshold<=0||v<=threshold)return (byte)0; + double strength=v/(2*threshold); + return (byte)Math.Clamp(Math.Round(255*strength),1,255); + }).ToArray(); + } + + // Older projects have only the two-sided classification mask. Reconstruct the + // display from their catalogs without saving or changing any measurements. + public static byte[] LoadMask(string directory,Frame frame,IReadOnlyList frames,CancellationToken ct) + { + if(frame.ExcessSkyMask.Length==SkyModel.Count)return frame.ExcessSkyMask; + if(frame.Alignment.Length!=4)return []; + Frame? Read(Frame source) + { + ct.ThrowIfCancellationRequested(); + var copy=new Frame{Id=source.Id,Length=source.Length,Modified=source.Modified,Width=source.Width,Height=source.Height,Alignment=source.Alignment,Noise=source.Noise}; + return ProjectStore.LoadCatalog(directory,copy)&©.SkyMap.Length==SkyModel.Count?copy:null; + } + var selected=Read(frame);if(selected==null)return []; + var clean=frames.Where(f=>f.Session==frame.Session&&f.Measured&&f.Error==""&&f.Alignment.Length==4&&f.AdditionalMeasurements.GetValueOrDefault("Clear reference member")>0).ToArray(); + if(clean.Length==0)return []; + List references=[]; + foreach(var referenceFrame in clean) + { + var reference=Read(referenceFrame); + // An incomplete reference would produce a different mask; show unavailable instead. + if(reference==null)return []; + references.Add(reference); + } + ct.ThrowIfCancellationRequested(); + var overlay=CreateReference(references,ct); + ct.ThrowIfCancellationRequested();return overlay?.Measure(selected)??[]; + } +} diff --git a/src/AstroFrame.Engine/SpatialReference.cs b/src/AstroFrame.Engine/SpatialReference.cs index 960caf1..e11ebdd 100644 --- a/src/AstroFrame.Engine/SpatialReference.cs +++ b/src/AstroFrame.Engine/SpatialReference.cs @@ -62,10 +62,14 @@ public static class SpatialReference double stability=Math.Min(1,referenceNoise*.5/Math.Max(referenceResidual,.1)); double floor=Math.Max(.1,referenceNoise*.08); double[] scatter=Enumerable.Range(0,SkyModel.Count).Select(j=>Math.Max(floor,Robust.Mad(residuals.Select(m=>m[j])))).ToArray(); + var overlay=SkyOverlay.CreateReference(clean.Select(i=>a[i]),ct); for(int i=0;iMath.Abs(v)/scatter[j]).ToArray();bool[] mask=z.Select(v=>double.IsFinite(v)&&v>5).ToArray(); + // The two-sided residual remains classification evidence. Pink display + // cells identify excess sky brightness, not the compensating dark residual. + f.ExcessSkyMask=overlay?.Measure(f)??[]; f.CloudMask=mask.Select(v=>(byte)(v?1:0)).ToArray();f.CloudCoverage=(double)mask.Count(v=>v)/Math.Max(valid,1);f.CloudSignificance=Robust.Quantile(z,.95); f.ReferenceConfidence=stability*Math.Min(1,clean.Length/20.0)*(double)valid/SkyModel.Count; f.AdditionalMeasurements["Cloud connected coverage"]=(double)SkyModel.LargestComponent(mask)/Math.Max(valid,1); diff --git a/tests/AstroFrame.Validation/AstroFrame.Validation.csproj b/tests/AstroFrame.Validation/AstroFrame.Validation.csproj index 3beace0..6b5272b 100644 --- a/tests/AstroFrame.Validation/AstroFrame.Validation.csproj +++ b/tests/AstroFrame.Validation/AstroFrame.Validation.csproj @@ -7,6 +7,7 @@ enable + diff --git a/tests/AstroFrame.Validation/Fixtures/overlay-backgrounds.json b/tests/AstroFrame.Validation/Fixtures/overlay-backgrounds.json new file mode 100644 index 0000000..a9bc4b7 --- /dev/null +++ b/tests/AstroFrame.Validation/Fixtures/overlay-backgrounds.json @@ -0,0 +1 @@ +{"Description":"Read-only coarse background measurements from the three reported NGC 1432 frames; regions follow the user\u0027s visible cloud examples. These are localization regressions, not a cloud-detection accuracy estimate.","ReferenceBackground":[1841.289,1849.98,1847.453,1843.624,1840.652,1843.383,1840.534,1840.019,1840.29,1839.723,1838.116,1843.797,1838.78,1836.721,1838.88,1837.647,1836.926,1836.918,1836.719,1837.084,1836.176,1834.505,1835.25,1865.587,1810.961,1828.064,1826.731,1825.669,1824.235,1825.226,1825.77,1822.547,1823.473,1822.823,1824.543,1825.236,1822.382,1822.676,1822.657,1823.696,1823.716,1821.833,1821.562,1815.821,1817.201,1819.421,1819.849,1827.821,1810.998,1828.131,1828.742,1828.122,1827.142,1824.685,1824.946,1824.355,1825.927,1823.809,1823.388,1820.912,1821.849,1821.04,1824.382,1820.92,1820.222,1820.677,1820.107,1817.841,1816.048,1816.251,1818.915,1824.211,1811.658,1829.359,1827.541,1829.906,1828.699,1828.902,1829.022,1825.175,1824.26,1822.127,1822.777,1822.619,1822.086,1819.433,1821.024,1822.007,1821.701,1822.352,1823.426,1822.996,1819.477,1819.952,1818.393,1821.811,1815.916,1834.064,1831.969,1832.839,1829.709,1828.985,1827.533,1825.984,1825.005,1827.35,1823.404,1822.054,1823.89,1820.858,1820.587,1823.255,1820.146,1819.133,1818.87,1817.796,1816.161,1818.709,1815.702,1822.791,1818.894,1841.799,1832.896,1830.896,1827.991,1826.701,1825.421,1825.794,1827.478,1825.003,1824.529,1825.237,1823.508,1821.44,1819.937,1817.715,1821.304,1820.219,1820.934,1819.164,1818.854,1819.517,1817.359,1821.648,1813.162,1830.564,1832.082,1829.773,1824.835,1826.655,1824.72,1826.187,1827.223,1824.163,1823.174,1825.535,1824.418,1821.411,1822.479,1820.656,1820.938,1821.675,1819.021,1815.497,1816.486,1817.91,1821.738,1825.668,1811.645,1828.709,1830.182,1828.655,1824.009,1831.518,1829.338,1829.745,1827.36,1827.907,1825.489,1824.013,1822.826,1824.158,1822.807,1820.404,1821.511,1823.665,1823.385,1821.074,1815.152,1817.023,1819.614,1824.991,1810.968,1828.065,1827.812,1827.723,1828.437,1827.738,1829.079,1828.385,1826.878,1825.586,1826.297,1823.709,1823.435,1824.584,1822.4,1821.239,1823.596,1824.597,1822.181,1821.29,1818.695,1816.006,1816.81,1827.018,1813.393,1831.821,1831.051,1829.596,1827.166,1828.098,1830.076,1830.894,1829.305,1826.939,1827.681,1826.721,1822.113,1823.256,1822.634,1822.663,1821.639,1824.474,1824.644,1822.089,1821.032,1819.291,1817.366,1825.544,1814.57,1831.675,1829.389,1829.204,1829.325,1829.133,1835.021,1834.035,1828.788,1827.375,1829.643,1830.194,1826.695,1825.198,1823.349,1825.395,1824.287,1829.338,1825.868,1822.5,1819.05,1814.911,1815.998,1829.846,1813.159,1832.916,1830.644,1831.432,1828.047,1829.728,1835.682,1830.635,1828.503,1829.304,1829.574,1828.803,1831.013,1831.9,1826.6,1825.663,1826.241,1828.464,1824.767,1818.498,1818.789,1818.383,1819.256,1829.959,1815.366,1831.32,1831.205,1830.3,1828.824,1830.287,1831.211,1829.694,1828.677,1831.922,1832.397,1832.143,1831.387,1845.337,1840.334,1831.75,1829.21,1824.562,1821.713,1820.785,1820.036,1820.09,1818.384,1826.981,1814.828,1832.685,1830.209,1828.125,1828.931,1827.442,1830.361,1831.189,1828.965,1832.971,1834.505,1832.543,1830.881,1832.628,1833.659,1831.352,1826.361,1823.635,1822.046,1821.523,1820.422,1819.234,1821.049,1825.016,1814.288,1834.234,1832.212,1830.028,1833.467,1831.866,1829.01,1831.139,1836.769,1836.596,1834.888,1837.262,1840.907,1837.165,1832.079,1830.633,1826.437,1824.73,1824.378,1821.532,1822.931,1820.622,1817.484,1826.071,1815.109,1830.629,1831.869,1830.17,1831.317,1832.022,1829.551,1834.312,1844.012,1845.703,1843.172,1861.298,1862.945,1849.173,1841.19,1835.566,1834.517,1829.678,1825.877,1824.908,1825.072,1821.955,1820.478,1828.946,1815.975,1834.113,1833.974,1832.508,1831.583,1833.175,1832.718,1834.116,1835.659,1842.6,1847.458,1863.538,1885.381,1892.365,1868.673,1844.382,1834.037,1830.185,1826.573,1825.564,1822.88,1821.251,1819.041,1828.645,1816.483,1833.968,1836.032,1843.839,1840.247,1842.222,1842.794,1837.433,1835.934,1839.274,1849.941,1879.974,1935.943,1915.269,1863.963,1849.82,1839.56,1835.774,1830.08,1825.186,1822.401,1821.044,1820.62,1823.475,1814.615,1832.776,1836.9,1843.472,1841.225,1838.93,1844.55,1846.688,1849.056,1845.214,1850.147,1856.151,1879.235,1868.587,1867.098,1856.96,1844.047,1836.836,1830.015,1827.035,1824.346,1823.498,1822.827,1830.819,1816.985,1837.106,1836.154,1847.079,1848.987,1844.154,1845.855,1862.173,1883.913,1864.927,1847.677,1852.831,1855.194,1857.654,1886.198,1873.185,1846.577,1836.461,1829.567,1827.472,1824.549,1823.552,1823.531,1826.436,1815.764,1835.456,1836.474,1859.271,1873.723,1849.49,1844.481,1867.064,1893.11,1875.189,1854.524,1860.318,1862.174,1864.509,1885.607,1871.204,1848.015,1836.213,1829.306,1824.525,1823.402,1823.371,1822.127,1832.52,1819.924,1835.986,1835.874,1842.505,1847.398,1840.167,1838.569,1839.991,1849.958,1852.305,1887.672,1918.278,1882.768,1860.049,1853.21,1846.166,1838.144,1834.442,1832.334,1827.361,1827.431,1827.673,1826.407,1832.457,1820.448,1838.12,1838.804,1838.487,1846.094,1841.452,1837.176,1835.43,1843.344,1845.354,1881.936,1912.083,1887.982,1865.824,1850.85,1841.654,1837.77,1831.922,1829.736,1830.81,1826.834,1825.086,1822.279,1830.545,1817.859,1836.386,1839.55,1838.024,1836.567,1836.825,1833.675,1833.738,1846.404,1845.838,1865.288,1895.47,1888.34,1865.781,1846.649,1838.055,1832.468,1830.693,1830.872,1828.579,1825.675,1823.759,1822.583,1829.919,1816.131,1836.468,1845.702,1841.008,1833.887,1831.187,1833.002,1836.973,1846.598,1846.858,1858.591,1867.839,1862.426,1846.578,1842.856,1837.262,1833.54,1834.41,1829.582,1827.759,1823.72,1823.665,1824.802,1831.72,1815.838,1837.987,1835.255,1835.328,1833.741,1833.514,1834.244,1840.591,1843.033,1843.808,1850.392,1850.064,1844.589,1838.926,1835.285,1834.57,1832.523,1833.641,1832.76,1828.102,1824.591,1826.394,1826.535,1831.69,1818.406,1836.963,1837.138,1837.89,1835.202,1838.312,1841.113,1837.349,1837.521,1840.251,1841.331,1841.994,1842.728,1836.587,1836.296,1832.411,1830.379,1827.731,1828.126,1826.834,1826.218,1824.867,1825.938,1832.024,1822.501,1839.38,1840.592,1841.649,1838.493,1840.553,1846.261,1837.745,1835.079,1835.087,1839.942,1838.165,1833.632,1831.627,1833.548,1832.472,1831.76,1830.383,1826.28,1827.982,1827.451,1826.209,1825.058,1828.576,1821.865,1841.508,1841.768,1840.506,1837.498,1838.806,1837.767,1834.346,1834.17,1836.045,1834.46,1835.876,1834.014,1833.875,1835.689,1832.118,1831.747,1830.886,1831.62,1825.831,1826.864,1825.098,1826.207,1831.122,1819.756,1841.192,1839.095,1836.508,1835.569,1837.104,1834.827,1836.825,1832.687,1831.979,1831.669,1834.178,1836.695,1835.249,1835.889,1831.061,1831.196,1832.367,1830.77,1827.759,1828.007,1826.737,1825.758,1832.594,1821.13,1841.645,1841.491,1839.274,1836.971,1836.879,1835.384,1833.513,1832,1832.177,1836.546,1834.336,1833.167,1832.338,1831.691,1832.717,1832.784,1831.649,1831.332,1827.837,1826.266,1827.465,1827.844,1834.224,1821.601,1840.223,1839.519,1837.49,1835.565,1834.922,1837.268,1834.576,1835.085,1833.526,1831.564,1833.296,1834.168,1831.81,1831.654,1832.366,1831.948,1829.321,1827.205,1828.614,1827.664,1828.113,1826.604,1830.411,1823.732,1840.06,1840.052,1839.07,1837.603,1835.961,1836.397,1836.774,1837.929,1835.319,1836.242,1834.471,1834.519,1833.017,1831.441,1832.729,1830.43,1829.182,1828.997,1831.652,1830.58,1829.96,1830.895,1832.62,1822.716,1843.25,1844.419,1840.338,1840.167,1839.446,1836.381,1838.133,1836.149,1834.596,1834.803,1836.41,1832.479,1832.118,1833.718,1831.007,1831.169,1830.993,1831.609,1831.256,1829.687,1836.291,1829.132,1830.753,1824.881,1845.986,1844.936,1842.55,1840.918,1837.643,1837.529,1837.46,1835.047,1835.535,1834.734,1836.123,1836.675,1835.015,1835.797,1835.334,1832.556,1832.889,1830.568,1828.877,1830.189,1831.175,1827.51,1833.321,1823.608,1849.856,1844.085,1842.274,1842.184,1840.924,1840.522,1836.515,1838.184,1837.081,1835.857,1833.523,1835.976,1835.767,1838.128,1835.834,1832.173,1830.499,1828.259,1828.379,1828.961,1830.097,1828.446,1834.574,1825.133,1846.976,1846.835,1845.634,1841.924,1839.47,1838.367,1838.847,1838.101,1837.161,1838.426,1837.058,1835.486,1835.061,1833.377,1831.717,1830.434,1828.685,1830.015,1830.192,1831.652,1832.106,1832.701,1837.66,1825.566,1836.692,1835.035,1835.029,1832.91,1833.104,1835.471,1831.371,1829.288,1828.358,1828.029,1830.673,1828.951,1826.204,1824.706,1826.544,1827.767,1825.655,1826.751,1825.252,1824.062,1823.503,1824.461,1828.928,1807.474,1820.877,1826.033,1821.761,1818.493,1818.739,1817.647,1814.11,1812.917,1810.826,1809.281,1812.34,1811.546,1811.542,1812.235,1810.859,1812.22,1811.719,1809.552,1807.009,1809.555,1808.344,1807.462,1820.811,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"ReferenceScatter":[6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.34,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,18.892,7.624,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,7.439,6.08,6.08,6.08,6.08,6.08,7.717,9.221,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,11.168,6.08,6.08,6.08,14.549,6.08,6.08,6.08,6.08,6.08,8.378,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.719,11.434,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,7.246,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08,6.08],"Noise":6.080480399885938,"Samples":[{"Name":"Light_NGC 1432_30.0s_IRCUT_20260919-235115.fit","Width":2160,"Height":3840,"Alignment":[0.999960370350423,-0.0008326142501781894,-0.001310402993159156,0.03914151966977375],"SkyMap":[4035.75,4225,4352.5,4449,4465.125,4430,4336.5,4270.5,4208,4164,4137.5,4121.5,4075.375,3985.375,3934,3916.625,3940.25,4027,4160.25,4273.25,4326.375,4397.75,4454.125,4452.5,3827.25,3940.25,4044.75,4156,4179,4197.25,4158,4131.375,4105.5,4108,4105,4120.875,4123.875,4115.75,4131.75,4137.5,4161.75,4192.75,4257.5,4323.5,4383.5,4455,4464.75,4433,3679.5,3802.75,3885,3972.625,4017.125,4013.625,4023.5,4027.5,3982.25,3972.125,3980.125,4001.25,4030.5,4074.5,4140.75,4160.75,4175,4191.875,4227.75,4267,4342.25,4422.75,4436.75,4403.25,3208.25,3278.5,3397.75,3486.75,3580,3640.75,3696.625,3744.25,3720,3752.5,3769.75,3777,3817.875,3849.5,3909.75,3981.125,4008.5,4028,4075,4117.75,4173.5,4257.25,4287.75,4303.25,2896.625,2944.5,2997.5,3055.125,3138.25,3195,3249.25,3324,3336.5,3381.5,3410.125,3438,3462.25,3481.75,3517.75,3583.5,3617.25,3651,3708.75,3763.25,3828.625,3952.75,4061.5,4118.875,2813.5,2838,2853.5,2888.625,2945.25,2989.5,3018.25,3059.5,3089.5,3128,3169.25,3184.75,3223.375,3252.75,3268.75,3306.75,3342.75,3382.25,3457,3519.125,3601.75,3686.25,3758.5,3822,2805.75,2799.5,2807,2838.875,2889.5,2899.75,2924.625,2925.125,2924.75,2939.625,2926.25,2947.5,2946.25,2981.25,3018.875,3070,3128.25,3192.625,3242.625,3338.75,3429,3508.75,3575,3637.75,2788,2774.25,2764.25,2764.5,2789.375,2805.875,2819.875,2826,2821.75,2846.75,2836,2853.25,2902.125,2916.25,2951.125,3008.5,3050.125,3090.875,3171.5,3270.25,3372.75,3476.625,3569.125,3634.5,2868.25,2783.625,2775,2772.375,2798.875,2813.25,2813.5,2813.75,2820.5,2831.25,2847.5,2864.875,2907.25,2923.625,2953.5,2983.75,3028.375,3100.75,3152.875,3225.5,3290,3389.5,3494.875,3585.75,2905,2794.25,2775.5,2794.625,2817.25,2821,2836.375,2834.25,2841.5,2832,2844.25,2838.75,2849.125,2860.875,2856,2888.625,2930,3014.25,3090.375,3175.875,3243,3320.75,3410.625,3488.25,2944.75,2836.25,2784.5,2796.125,2781.25,2791.25,2805,2795.375,2801.25,2807.25,2796.25,2814,2810.25,2802,2787,2819.75,2855.5,2919.75,2992.75,3058.125,3111.5,3155,3220.75,3298.75,3024,2924,2827.375,2800.75,2790.875,2806.25,2806.75,2795.75,2803.5,2798.25,2803.125,2793.75,2797.25,2782.125,2788.125,2784,2786,2812.25,2877.375,2930.125,2978.125,3008.125,3049.5,3119.25,3109.5,2995.375,2915.25,2870,2859,2845.875,2836,2818.75,2809.75,2789.25,2793.75,2801,2813.25,2806.75,2783.5,2781.75,2767,2746.75,2772.875,2800.75,2829.75,2854.25,2880.75,2900.375,3299,3181.75,3094.75,3074.625,3040.25,3027.25,2987.625,2952.375,2907.5,2877.5,2821.5,2776.625,2779.75,2794.5,2788.5,2771,2762.25,2739.375,2740.5,2749.75,2758.375,2769,2774.5,2779.25,3489,3440.5,3343.875,3303.75,3283,3259,3219.25,3191.25,3106.75,3027,2923.375,2837.5,2797,2788.375,2785.5,2773.875,2763.5,2745.75,2735.5,2739.75,2748.875,2752.5,2750,2759.375,3484.75,3489,3501,3490.25,3482.25,3438.875,3431.5,3402.5,3340.75,3240.5,3115.25,2973.75,2875.375,2806.875,2768.75,2754.75,2766.125,2752.75,2749.375,2738.125,2735,2735.625,2742.5,2738.875,3553.375,3523.25,3540.5,3573.5,3605.875,3606.25,3596,3582.25,3537.25,3417.25,3293.625,3182.125,3061.75,2906.25,2799.5,2761,2750.625,2739,2737.25,2740.75,2729.625,2735.25,2735.375,2739.375,3533.375,3590.5,3618,3644.375,3654,3663,3648,3642.75,3587.375,3495.25,3394.375,3290.75,3188.75,3070.75,2940.875,2805.75,2762.75,2745,2753.75,2734.5,2745.25,2733.625,2717.5,2729.75,3416.25,3479.5,3548.75,3577.5,3563.25,3581.5,3608.75,3596,3567,3479.75,3395.875,3291.5,3279.5,3115.375,2980,2867.5,2784.5,2758.375,2747.75,2741.875,2733.125,2735.75,2739.75,2744.375,3272.25,3376.75,3453,3450.875,3436.5,3419,3416,3439.75,3427.5,3375.75,3302.75,3207.25,3119.5,3006.25,2916.625,2820.25,2780.75,2762.25,2747.5,2740,2737,2733.75,2745.625,2734.75,3093.5,3225.625,3337.875,3387.25,3397.75,3355.75,3334,3350.25,3398.875,3312.5,3241.75,3149.5,3054.375,2966.25,2914.875,2828.75,2776,2759.75,2753.625,2751.375,2750,2745.875,2744,2740,3107.125,3216.625,3323.625,3406.5,3485.5,3411.75,3401.25,3375.25,3414.375,3334,3274.25,3216.125,3116.25,3001.25,2881.75,2810.5,2769,2764.5,2753.5,2746.625,2736,2736.5,2736.25,2749.5,3170.75,3297.875,3398,3496.125,3541.25,3511.5,3500.75,3480.25,3425.5,3388.625,3340.5,3374,3208.5,3081.125,2943.25,2842.25,2793,2774.75,2767.75,2760.25,2756.875,2744.625,2748.75,2745.75,3144.25,3262.625,3380.25,3474,3513.5,3532.625,3531.5,3510.75,3472.5,3428.5,3389.75,3328.25,3192.5,3088.25,2975,2868.5,2791,2773.25,2767,2768.75,2773.5,2757,2739.125,2755.5,3086.125,3172,3256,3316.625,3354.125,3398,3414.5,3424.75,3415.25,3414.5,3357.375,3308.125,3198,3073.75,2946.375,2852.5,2781.75,2765,2765.375,2759.625,2756.75,2756.75,2756,2758.875,3029.75,3071.5,3116,3135.5,3134.75,3150,3189.25,3230.75,3265.5,3259.375,3247.75,3184.375,3085,2985.75,2888.75,2836.75,2795.5,2781.25,2779.25,2756.75,2760.5,2765.875,2756,2764,3081,3093.75,3091.125,3085.875,3080.75,3062.5,3051.5,3073.5,3089.5,3086.25,3052,3007.75,2935.125,2875.125,2814.25,2812,2776.75,2788.5,2772.5,2779,2779.5,2765,2769.5,2776.75,3071.125,3106.75,3125,3131,3137.25,3100.125,3083.875,3074.5,3053.25,3038,2978.375,2913.875,2857.125,2809.875,2787,2786.125,2778.75,2774.25,2777.125,2775,2778.75,2768.125,2766.25,2783.25,2986,3026.5,3044.875,3077.25,3085.25,3082.75,3105.5,3113,3089.75,3072.875,2994.5,2927,2856.75,2801.25,2789.375,2799,2793,2787.625,2789.375,2780.25,2759,2765.75,2762,2761.25,2912.25,2915.75,2928.625,2968.125,2962.375,2973,2973,2989,2981.25,2970.25,2931,2888.75,2835.875,2807,2799.25,2803,2805.375,2802.375,2801,2796.625,2773.75,2769.375,2759.25,2764,2860,2865.75,2862.5,2886.125,2884.25,2909.25,2903.75,2915.625,2883,2859.25,2845.25,2837.25,2829.75,2813.25,2789.875,2788.75,2788.5,2794.5,2782.25,2784.75,2776.75,2772.25,2770,2758.25,2842,2834.625,2835,2821,2840.5,2839.25,2835,2842.375,2833.625,2820.75,2815.5,2809.5,2803.5,2793,2801.875,2782.5,2792,2787.75,2789.25,2780,2773.5,2779.5,2774,2774.75,2824.5,2818.125,2827,2824.5,2816.875,2820.75,2820.875,2827,2806.25,2811.5,2795.125,2799.25,2799.625,2787.375,2791.875,2781.75,2786.25,2800.125,2783.25,2772.25,2775,2777.5,2775,2777.25,2832.75,2833.25,2833.125,2834.25,2815.5,2819,2816.75,2810.5,2815.5,2805,2805.25,2799,2797.375,2799.25,2789.125,2788.75,2800.5,2787,2796,2786.75,2780.625,2780.5,2774.75,2770,2845,2831.5,2829.375,2823.375,2825,2825.125,2821.5,2819.75,2809.75,2812.5,2807.375,2805,2788.5,2814.625,2809.75,2792.25,2796.25,2797.75,2791,2786.75,2789.25,2796.125,2784.875,2776,2842.75,2853.375,2828.75,2829.875,2833.75,2831.5,2825.125,2818.875,2812,2809.375,2808.875,2800.75,2804.625,2807,2803.25,2794.625,2798.25,2790.75,2794.5,2796.25,2798.625,2791.25,2785.25,2793.5,2851.75,2854,2848,2846,2834.25,2838.5,2826.5,2817,2827.75,2821.25,2817.75,2815.375,2809.75,2796.25,2817,2796.5,2801,2792.875,2798.75,2802,2789.875,2800.75,2795,2800.25,2855,2862,2848,2852.125,2845.5,2836.75,2833.75,2833,2828,2822.75,2819.25,2812,2810.875,2798,2805.5,2798,2806.375,2798.25,2804.25,2794.75,2796.25,2811.125,2804.125,2790,2861.75,2862.5,2847.5,2854,2846.75,2850.75,2846.25,2830,2829.75,2821.5,2831.375,2818.125,2817.375,2815.5,2809,2809.25,2823.25,2813,2808.25,2801.5,2808.5,2806.25,2810.625,2792.5,2897.125,2888.625,2891,2869,2854.5,2854,2847,2831.375,2827.375,2832,2833.75,2826,2828.75,2820.5,2828.25,2824.75,2814.875,2812.25,2821.875,2820.5,2805.25,2799.75,2800.5,2817.625],"CloudRegions":[[0.15,0.35,0.42,0.55],[0.3,0.65,0.05,0.12]],"ClearRegions":[[0.7,0.95,0.35,0.6],[0.1,0.9,0.8,0.94]]},{"Name":"Light_NGC 1432_30.0s_IRCUT_20260919-235146.fit","Width":2160,"Height":3840,"Alignment":[0.9999028729897927,-0.0008330928776873052,-0.0014056605093887317,0.03899792706050775],"SkyMap":[3713.75,3680.75,3717.75,3833.875,3993.125,4146.5,4287.875,4428,4506.5,4501.5,4482,4441.75,4424.5,4429.375,4447.625,4393.875,4326.75,4227,4134.75,4037.625,3914.75,3791,3717.25,3657.5,3765.25,3819.75,3849.625,3959.75,4090.25,4232.75,4349.625,4451.25,4484.25,4442.25,4380.75,4322.75,4274.25,4239.5,4211.875,4122.5,4016.125,3926,3838,3735.75,3638.5,3537,3478,3441.125,3690.5,3763.75,3834.875,3915.75,4018.75,4124.5,4235,4340.875,4379.5,4363,4312.625,4228.5,4172.25,4112.25,4033.75,3915.75,3832.5,3740,3648,3578.5,3472.5,3402.5,3360.375,3344.625,3612.875,3661.75,3709.375,3732,3813.25,3855.625,3949.875,4016,4115.25,4169.125,4154,4116.5,4062,4007.75,3936.875,3828.125,3722.5,3627.75,3528.5,3447.75,3336.75,3249.5,3218,3168,3249.75,3328.25,3386,3407.75,3458,3527.75,3592.5,3690.625,3788.875,3898.625,3920.875,3953.25,3927.5,3892.25,3822.25,3756.5,3679,3569.5,3512.5,3423.75,3312.25,3208.25,3129.625,3070.75,3077,3120,3162,3175,3211.25,3280,3362,3463.75,3553.5,3604.5,3658.625,3695.375,3734.375,3724.75,3695.25,3652.75,3585.5,3486.625,3422.5,3313.25,3232.5,3138.25,3090.25,3018.75,3015.25,3064,3090.875,3105.75,3163.375,3221.5,3306.5,3424,3516.125,3592.5,3648,3692.25,3705.875,3756,3732.375,3681,3611,3528.875,3423.25,3328,3231.5,3132.375,3075.5,3007.75,2914.625,2942,3015.5,3058.25,3129.75,3226,3298.125,3394,3476.5,3527,3573.875,3606.25,3629.5,3677.875,3700,3665.375,3600,3532.75,3428.25,3330.75,3241.5,3146.5,3070.25,3009.875,2852.75,2862.5,2899,2970.75,3074.875,3202.5,3300.5,3394.25,3476,3547.75,3595.5,3618.75,3631.75,3636.875,3642.5,3594.75,3528,3468.5,3378.75,3320,3248,3145.5,3057,2997.125,2814.125,2808.25,2818.75,2843.75,2932.75,3033.75,3121.5,3185.25,3266,3353.875,3406,3456,3472.25,3498,3514.5,3469.75,3425,3329.75,3238.125,3168.25,3110.875,3028.125,2958,2897.75,2774.75,2786.5,2760.75,2785.5,2809.25,2886.5,2908.5,2966.25,3012.75,3072.375,3126,3173.25,3179.75,3220.25,3233.5,3232.125,3175.5,3101.875,3037.375,2981.375,2954.75,2911.125,2854.75,2801.5,2777,2777.75,2768.25,2762.5,2762.875,2785.5,2812.25,2831.125,2839.75,2860.875,2894.75,2949.25,2980,2984.5,3008.875,2994.5,2997.875,2971.5,2900.25,2880.375,2862.25,2830.25,2803.5,2780.25,2774,2773.5,2760.5,2767.125,2754.5,2756.875,2766.375,2756,2763.375,2770,2789.25,2816.75,2838.625,2841.5,2845.75,2852,2856.625,2845.5,2824.5,2810.875,2806,2808,2789.75,2773.75,2782.25,2761.25,2762.75,2773,2749,2760,2747,2755.875,2754.625,2786.25,2779.75,2782,2789,2805.875,2804.125,2797.5,2794.25,2787,2766.25,2775.75,2753.25,2753,2756.75,2743.5,2816.375,2774.375,2754,2766.875,2749.5,2751.625,2757.5,2754.75,2747.375,2762,2761,2761,2762.75,2774.875,2762.75,2755.5,2780.875,2770.25,2749,2746.75,2750.75,2740.75,2732.5,2729,2939,2853.75,2785.25,2764.625,2764,2753.75,2758.5,2758.25,2768.875,2764.875,2766.375,2780.75,2753.75,2761,2759.75,2748,2743.875,2751.5,2737,2745.75,2740.875,2742.625,2733,2722.125,3001,2933,2836,2772.625,2761.5,2757.125,2760.25,2762,2783.125,2791.5,2781,2801.875,2803.25,2783.75,2775.75,2765.25,2756.5,2752.75,2736.875,2744.25,2732.875,2729.5,2743,2748.25,2941.5,2869.25,2797.5,2783.25,2774.5,2765.5,2751.125,2762.5,2774.125,2764.875,2768,2788.75,2813.5,2813.625,2800.25,2771.125,2765.75,2765.625,2749,2748,2731.75,2736.5,2739.25,2725.875,2874,2819.25,2779.625,2785.5,2781.5,2768.25,2772.75,2770.75,2767.25,2767.125,2768.625,2807,2932.875,2838,2783,2788.75,2761.5,2755.25,2746,2754.625,2736.125,2744.5,2734,2733,2886,2817.25,2788,2802.75,2786.375,2783.125,2781.875,2770.5,2787.25,2766.75,2777.5,2793.75,2804.5,2799.75,2801.5,2803.125,2777.25,2769.75,2748,2757.5,2757.125,2746,2756.5,2741.375,3017.25,2893.625,2811,2790,2815.25,2794.75,2806.125,2823,2868.375,2802.25,2801.5,2802,2784.5,2788.25,2839.75,2838.625,2801.25,2787.75,2780.25,2782,2776.75,2767.375,2761.75,2761,3054.25,2963.25,2842.625,2811.5,2852,2785.25,2784.25,2797.375,2844,2807.75,2806.75,2812.75,2818.25,2827.875,2827.25,2813.25,2797,2801.75,2799,2791.375,2790.75,2794.5,2782,2775,3072.375,2956.625,2855.75,2785,2793,2783.625,2784.75,2791.125,2783.5,2800.75,2818.125,2913.75,2824.5,2800,2806.25,2800,2808.375,2803.25,2809,2816.375,2813.5,2811,2810,2808.5,3018,2915.75,2837.375,2789.25,2801,2785.875,2783.375,2785,2783,2784.625,2819,2848.5,2816.25,2814.5,2807.25,2810.5,2842.875,2850,2862,2861.375,2856.75,2849.625,2845.75,2833.75,2892.75,2846.125,2819.5,2796.25,2799.625,2796,2784.375,2781.75,2799,2797.25,2813.375,2850.75,2845.625,2821.25,2828.5,2849.25,2863.5,2866.75,2877.625,2883.875,2879,2860.625,2864,2856.75,2830.75,2812,2794.25,2803.375,2798.625,2788.75,2803.875,2778.125,2806,2802.125,2833.75,2847,2829.25,2825.5,2849.25,2860,2869.25,2872.75,2862.5,2855.375,2869.75,2857,2863.5,2839.75,2812.75,2803.25,2816.75,2792.75,2799.625,2787.5,2786.75,2783.25,2801,2794.875,2806.25,2820.5,2814.5,2812.5,2816.125,2823,2824.25,2828.375,2835.75,2824.25,2830.125,2830.25,2821.375,2814.25,2834.75,2815.5,2798.5,2808.875,2812.5,2803.875,2809.75,2803.75,2787.5,2791.5,2796,2796.125,2790.25,2792.25,2788.5,2794.75,2793.125,2789.25,2796,2791.875,2799.5,2790.375,2784.5,2782.75,2816.75,2808.5,2809,2812,2808.125,2798.75,2815,2797.75,2788,2793,2778.125,2791.5,2786.625,2787.25,2781.875,2775.25,2780.5,2760.25,2778,2770.5,2784.875,2774,2762,2763,2827,2805.25,2795.125,2814.75,2797,2795.5,2788.5,2801.75,2787.25,2786.75,2793.25,2787.75,2781,2785.5,2779.875,2775.25,2765,2765.875,2773.75,2758.5,2764,2755.5,2754.875,2758.75,2807.5,2807.5,2804,2811.5,2791,2804.75,2787.125,2803.75,2783.375,2785,2790.25,2790.75,2785.625,2780.25,2781.75,2768.5,2782.5,2776.75,2774.5,2764.75,2760.5,2775.25,2765.25,2751.625,2824.5,2823.5,2821.75,2806,2804,2803,2806.25,2791.75,2791.25,2787.5,2798.5,2779.75,2794.125,2787.875,2785.75,2778,2787,2767.375,2785.375,2774.75,2778,2769.25,2764.125,2762.875,2813.25,2826.25,2820.125,2809.75,2807.75,2811,2804,2807.75,2799.25,2803.5,2782,2791.5,2792.5,2775.5,2779,2784,2776.5,2778.875,2783,2773.375,2773,2777.375,2754.75,2762.875,2836.25,2832,2829.5,2812.75,2828.125,2811.75,2816,2806.625,2806.625,2814.25,2801,2801.75,2783.5,2788,2783.25,2784.5,2795.625,2785.5,2781,2777.25,2775.375,2774.25,2767.375,2768.875,2831,2824.25,2821.75,2817,2813.25,2814.125,2807.875,2809.75,2798,2803.875,2793.125,2803.25,2786,2798,2788.5,2798.375,2791,2781.75,2785.75,2778,2779.5,2795.625,2772.25,2767.125,2842,2836.25,2828.25,2831.375,2821.75,2807.25,2812,2812.375,2814.875,2798.25,2798,2802,2789.875,2804.125,2801.75,2787.25,2790.25,2785.75,2788.375,2788.25,2773.25,2765.625,2778.25,2781.25,2842.375,2841.875,2850.875,2826.25,2832.25,2819.75,2821,2820.25,2804.625,2805,2806.25,2807.375,2799.75,2798.125,2801.875,2795.375,2793,2799.25,2788.25,2786.375,2778.5,2789.625,2784.5,2777.5,2863.25,2844,2842.25,2833.375,2817.5,2834,2827.75,2817.25,2805.5,2817.125,2815.125,2801.25,2804,2806,2800.75,2804.5,2807.25,2807.75,2790.625,2790,2779.375,2785.75,2786.25,2786.125,2851.75,2848,2846,2842.375,2839.375,2838.5,2842,2830,2817.875,2828,2814.25,2825.5,2806,2826.375,2805,2814.25,2811.875,2800.25,2801.25,2795.25,2797.75,2798.375,2786.75,2791.25,2864,2851.75,2864.5,2851.625,2856.75,2835.625,2842.75,2837.875,2838.25,2818.75,2829.25,2811,2818.25,2805.75,2832.5,2829.75,2823.75,2818,2813.375,2807.5,2809.625,2799.875,2794.5,2795.5],"CloudRegions":[[0.3,0.65,0.05,0.15]],"ClearRegions":[[0.15,0.8,0.4,0.6],[0.1,0.9,0.85,0.94]]},{"Name":"Light_NGC 1432_30.0s_IRCUT_20260919-235248.fit","Width":2160,"Height":3840,"Alignment":[0.9999015835347815,-0.0008623419287069971,0.0004188076679352774,0.038266122741835495],"SkyMap":[2980.5,2907.75,2854.5,2808.125,2790.5,2797.25,2807.5,2835.5,2898.75,2985.875,3071,3202,3347,3496.5,3621,3722.75,3820.5,3864.625,3846.375,3818.25,3747.75,3708,3607.25,3540.5,2935,2910.5,2897.25,2857.375,2840,2829.875,2816.75,2815,2823,2856.75,2920.75,3027,3127,3254.25,3351.25,3461.25,3569.75,3598.125,3613.5,3625.25,3606.75,3585.75,3528.25,3468.75,2877.75,2880.625,2875.125,2868.75,2848,2847,2826.75,2821,2815.25,2832.375,2853.375,2919.375,2996,3101,3207.5,3294.5,3401.25,3457.75,3494.75,3495.25,3513,3508.5,3477.25,3434.75,2791.75,2790,2791.5,2803.75,2797.75,2803,2796.5,2806.25,2814.875,2833.5,2864.25,2890.75,2964.5,3054.75,3149.5,3238.125,3302.125,3378.25,3409.25,3430.875,3439.25,3421,3410.75,3369.25,2749.25,2751.25,2744.25,2745.75,2738,2746.25,2772.75,2780,2807.375,2840,2900.5,2937.875,2981.25,3057.5,3143.25,3218.625,3284.75,3324.25,3337.5,3342.125,3333,3343.75,3300.75,3295.25,2753.875,2764,2747.5,2737.25,2746.375,2752.125,2775.625,2802.5,2825,2886.125,2933.5,2994.25,3076.375,3127.75,3171.5,3221.5,3265.25,3284.25,3289.625,3264.75,3243.5,3207,3175.5,3143,2753.75,2755,2756.25,2754.75,2763,2767.75,2812.25,2834.25,2873.75,2917.5,2987.5,3066.125,3115.25,3176,3218.25,3281.125,3308,3339.5,3337,3284,3249.875,3229.75,3187.375,3134.5,2782.375,2759.5,2770.75,2758.75,2770.25,2817.25,2832.75,2856.25,2893.875,2948.5,3002.75,3085.75,3162,3219.5,3294.75,3367.5,3397.5,3408.75,3405.25,3353,3330.75,3286.25,3250.875,3209.25,2808.125,2802.75,2809.75,2806.5,2831,2849.5,2870.75,2866.25,2889.75,2925.375,3001.875,3086.5,3155.75,3216.25,3253.625,3320.25,3364.25,3375.5,3359,3325.5,3302,3274.875,3232.5,3181.625,2819,2837.5,2841.75,2857.375,2883.625,2890.5,2901,2897.75,2926.25,2962.5,3034.25,3084.75,3110.25,3120.875,3129,3161.75,3208,3208.5,3198.75,3195.25,3197.125,3178,3136.375,3102.5,2828.75,2854,2859,2869.75,2894.5,2892.375,2911.875,2916.375,2943,2978.25,3019,3076.25,3100.5,3076,3066.5,3058.5,3077.375,3096.75,3082.375,3082,3074,3057.75,3024,2981.25,2875.625,2891.5,2889,2877.75,2911.75,2924.75,2951,2978.5,2974.25,3004.25,3024.375,3067.625,3107.125,3101.25,3107.5,3129.875,3126.25,3119.25,3125.875,3121,3100.5,3092.375,3047,3017.375,2866.5,2869.25,2882.75,2896,2903,2939,2980,3020.125,3040.75,3073.25,3090,3072.625,3050.5,3081.25,3122.5,3143.25,3145.25,3127.25,3123,3117.5,3102.75,3098.25,3064.5,3044.75,2804.5,2816.125,2827,2854.75,2855.75,2877,2919.5,2950.25,2989,3034.25,3049.25,3043.75,3009.125,3032,3081,3105,3128.75,3133.75,3119.75,3083,3066.5,3036.25,3027.75,3005.25,2824.875,2838.5,2854.75,2885.5,2899.75,2891,2922.25,2953.75,2984.25,3002.25,3018.5,3027.125,3017.75,3022.75,3030,3045.625,3019.75,3004.5,2999.5,2966.875,2939.75,2912.25,2918.75,2904.75,2849,2880.75,2929.25,2965.25,2990.25,2974.625,2996.25,3004.25,3043.375,3047,3049.625,3031,3012.375,2999.5,2989.875,2991.5,2947.625,2908.75,2917.25,2894.875,2856.75,2838.5,2812.625,2811.375,2839.875,2874.25,2891,2911.5,2925.25,2936.5,2955,2971.625,3016.625,3041.75,3050.5,3023.75,3047.5,2994.125,2953.25,2914.625,2873,2879.875,2859.25,2848.25,2828,2805.875,2805.75,2788.25,2828.5,2863.25,2896,2920,2922.25,2921,2924.875,2926.5,2943.25,2961,2972,2985.875,2991.75,2981.25,2922.75,2867.75,2854.25,2859.5,2843.25,2844.5,2808.5,2794.625,2775.125,2799.25,2798.125,2826.5,2878.5,2918.375,2935.125,2955.25,2960.75,2960,2957.75,2975.5,2977.375,2998.5,3086,2984,2896.25,2855.5,2825.5,2826.25,2816,2804,2790,2771.5,2754,2763.25,2785.25,2809.75,2843.25,2890.25,2907.25,2951.75,2966.75,2968.625,2982.125,2979,2988.25,3012.25,3006.375,2976,2930,2872.25,2815.75,2793.5,2775.5,2764.875,2774.75,2750.25,2747,2740.75,2797.125,2822.25,2843.75,2909.75,2985.125,2994,3024,3040.25,3092.5,3043.75,3052,3040.25,3045,3043.25,3042.25,2995.125,2916.25,2853.25,2810.75,2771.125,2746,2748.5,2733.75,2733,2817.5,2837.125,2844.75,2910.5,2993,2957.25,3018.75,3074.75,3170.25,3125.25,3119.75,3128.5,3128.125,3127.75,3112,3069.5,2992.75,2923.125,2865.25,2816.5,2768,2759.25,2741,2732.875,2839,2839,2841.75,2856.5,2884.25,2911.625,2950.625,2988.875,3046.125,3069,3089,3175.5,3110.75,3107.25,3087.5,3062.25,3036.75,2983,2941.75,2892.75,2842.25,2784.75,2744.5,2742,2838,2822.375,2812.75,2813.75,2855.25,2859.5,2887.25,2938.25,2962.5,2970.375,2991.25,3037.5,3037.5,3038.375,3015.25,2994.875,2950.25,2946.125,2896.25,2889.5,2844.25,2786.375,2758,2728.125,2829.25,2808.5,2780.75,2800,2811,2833.5,2847.875,2875.625,2914.75,2927.5,2925.75,2961.25,2959.125,2955.75,2945.25,2932.25,2910.375,2883.5,2883,2846.375,2803.75,2768.75,2747.25,2731.5,2808.125,2783.75,2789,2799,2788.5,2800,2828.5,2848,2879.25,2888.5,2917.5,2910.5,2914.25,2906.375,2917,2909,2907.25,2885.25,2875.5,2837.25,2796.125,2764.75,2734.875,2733.875,2796.25,2790,2792,2784.75,2786.75,2801.5,2805.75,2830.875,2851.75,2863.25,2870.875,2873.75,2868.125,2868.5,2876.625,2879.5,2877.75,2872.75,2879.25,2852.5,2824.625,2778,2753.5,2741.75,2803.75,2793.75,2777.875,2790.5,2784.75,2805.25,2818.25,2815.5,2810.25,2817,2827,2819.625,2809,2823,2825,2818.125,2808.75,2820.625,2807.625,2798.25,2772.125,2756.25,2757,2746,2801.875,2797.625,2795,2797,2794.25,2785.875,2795.5,2795,2784.125,2791.25,2788.875,2802,2787,2793,2775.5,2790.75,2797,2778.75,2779.75,2764.5,2763,2760.5,2749.875,2742.5,2802.875,2805.875,2796.5,2800.5,2792.75,2791,2793.25,2784.75,2789.5,2792.25,2788.875,2793.25,2778,2778,2775.125,2777.5,2772,2776.5,2763.125,2756.5,2750,2746.125,2745,2747.125,2802.25,2794,2803.25,2802.25,2792.25,2783,2784.75,2786.625,2775.5,2777.75,2775.375,2774.5,2776.25,2779.5,2774.75,2760.125,2774.75,2769,2761.25,2760.25,2751,2754.25,2749.75,2743.625,2801.75,2814.125,2797.625,2800.125,2793.5,2797,2786.375,2773.5,2778,2780.25,2780,2775,2770.5,2772.75,2774.25,2756.625,2763.75,2767.75,2771,2764.5,2756,2762,2752,2743.75,2811.75,2806.25,2805,2807.625,2795,2798.375,2795,2788.375,2775.5,2777.25,2777.75,2777.75,2782.25,2771.125,2772.75,2764,2763.25,2767.25,2754,2756.375,2755.5,2760.5,2760,2750.375,2818.5,2816,2800.75,2803.75,2794.875,2797.5,2805.25,2792.5,2777.125,2783,2783.875,2780.5,2767.375,2776.375,2771.875,2773.125,2773.25,2764.75,2781.25,2772.75,2767.125,2767.5,2767.25,2747.5,2820.75,2817,2812.5,2803.25,2808,2817.5,2804.625,2792,2796,2782.75,2794,2774,2779.625,2783.75,2793.5,2766.375,2775,2779.375,2768.75,2769.5,2767.5,2752.625,2764,2768.75,2824.5,2817.875,2810.25,2808.5,2810.125,2805.5,2798.75,2795,2793.125,2791.25,2792.875,2799,2781.75,2797.75,2781.5,2775.75,2777,2766,2776.875,2774.25,2775.5,2778.5,2760.5,2771.5,2831.5,2840.125,2826.5,2814.75,2820.5,2808.75,2810,2801,2785.875,2806.5,2797.625,2785.5,2797.75,2792.75,2786.25,2788.25,2776,2776.75,2784.5,2780.25,2769,2772.75,2766.25,2761.25,2842.625,2822.375,2812.125,2825.5,2809,2815.625,2823.75,2805,2810.875,2790.125,2800.5,2791.625,2802,2787.125,2792.625,2786.25,2786,2780.75,2774,2775.75,2791.875,2787.625,2775.25,2776.875,2834.5,2841.75,2837.75,2818.25,2830.25,2815.875,2825.625,2801,2808.75,2799.5,2803.75,2802.75,2804.5,2813.625,2798,2807.25,2805.5,2803.625,2791.625,2799.5,2789.25,2799.125,2784.75,2790.5,2838.75,2843,2840.875,2833,2824.25,2826.25,2829.625,2819,2809.5,2812.125,2809.625,2819.5,2810.75,2813.75,2800.25,2802.25,2795,2806.125,2795.25,2795.625,2807,2797.625,2785.25,2790.625],"CloudRegions":[[0.68,0.87,0.08,0.2],[0.25,0.45,0.48,0.55]],"ClearRegions":[[0.85,0.95,0.45,0.6],[0.1,0.9,0.8,0.94]]}]} \ No newline at end of file diff --git a/tests/AstroFrame.Validation/ImageRegression.cs b/tests/AstroFrame.Validation/ImageRegression.cs index d8064cd..fff92f1 100644 --- a/tests/AstroFrame.Validation/ImageRegression.cs +++ b/tests/AstroFrame.Validation/ImageRegression.cs @@ -38,6 +38,18 @@ static class ImageRegression check(clear.All(f=>f.Automatic==Verdict.Keep),"persistent nebulosity and gradual sky/flux trends remain KEEP in image pipeline"); check(cloud.All(f=>f.Automatic==Verdict.Reject),"prolonged moving cloud does not become the local baseline"); check(cloud.All(f=>f.CloudMask.Any(v=>v>0)&&f.Evidence.Any(e=>e.Metric=="Cloud structure")),"cloud masks and spatial explanations survive the full image pipeline"); + bool Localized(Frame f) + { + int n=frames.IndexOf(f);double center=.22+(n%9)*.045,aspect=(double)f.Height/f.Width;var a=f.Alignment; + var cells=Enumerable.Range(0,SkyModel.Count).Select(i=> + { + double x=(i%SkyModel.Columns+.5)/SkyModel.Columns,y=(i/SkyModel.Columns+.5)/SkyModel.Rows; + return(i,Y:(a[1]*x+a[0]*y*aspect+a[3])/aspect); + }).Where(c=>c.Y>.05&&c.Y<.95).ToArray(); + var core=cells.Where(c=>Math.Abs(c.Y-center)<.05).ToArray();var clearSky=cells.Where(c=>Math.Abs(c.Y-center)>.24).ToArray(); + return f.ExcessSkyMask.Length==SkyModel.Count&&core.Length>0&&core.Count(c=>f.ExcessSkyMask[c.i]>=128)>=core.Length*.85&&clearSky.Length>0&&clearSky.Count(c=>f.ExcessSkyMask[c.i]>0)<=clearSky.Length*.1; + } + check(cloud.All(Localized),"image pipeline highlights physical cloud cores while leaving distant clear sky unshaded"); check(frames[18].Automatic==Verdict.Review,"modest transient sky structure without stellar loss routes to REVIEW, preserving conservative rejection"); var reference=frames.First(f=>f.Id==cloud[0].ReferenceId);var image=Fits.Read(cloud[0].Path); var vanished=reference.Stars[0] with{Flux=1};reference.Stars=[vanished];var forced=Matching.ForcedFlux(reference,cloud[0],image); diff --git a/tests/AstroFrame.Validation/OverlayRegression.cs b/tests/AstroFrame.Validation/OverlayRegression.cs new file mode 100644 index 0000000..81dfa84 --- /dev/null +++ b/tests/AstroFrame.Validation/OverlayRegression.cs @@ -0,0 +1,77 @@ +using AstroFrame.Engine; +using System.Security.Cryptography; +using System.Text.Json; + +static class OverlayRegression +{ + public static void Run(Action check) + { + var residual=new double[SkyModel.Count];var scatter=Enumerable.Repeat(2.0,SkyModel.Count).ToArray(); + for(int i=0;i<100;i++)residual[i]=500; + residual[100]=100;residual[101]=-500;residual[102]=9;residual[103]=double.NaN;residual[104]=50; + var strengths=SkyOverlay.ExcessMask(residual,scatter); + check(strengths[0]==255&&strengths[100]>=128&&strengths[101]==0&&strengths[102]==0&&strengths[103]==0&&strengths[104]==0,"fainter cloud structure stays visible while weak, dark and invalid residuals are unshaded"); + RealFrames(check); + string directory=Path.Combine(Path.GetTempPath(),"AstroFrame-overlay-"+Guid.NewGuid()); + try + { + float[] Map(bool cloud)=>Enumerable.Range(0,SkyModel.Count).Select(i=> + { + double x=(i%SkyModel.Columns+.5)/SkyModel.Columns,y=(i/SkyModel.Columns+.5)/SkyModel.Rows; + double nebula=80*Math.Exp(-((x-.45)*(x-.45)+(y-.55)*(y-.55))*35); + double glow=cloud?450*Math.Exp(-Math.Pow(y/.18,2))+400*Math.Exp(-Math.Pow((x-.25)/.23,2)-Math.Pow((y-.42)/.16,2)):0; + return (float)(1000+75*x+30*y+nebula+glow); + }).ToArray(); + Frame Make(int n,bool cloud=false)=>new() + { + Id=n.ToString(),Length=100,Modified=200,Width=240,Height=400,Session="same night",Measured=true, + SkyMap=Map(cloud),SkyNoise=Enumerable.Repeat(20f,SkyModel.Count).ToArray(),Noise=20,Alignment=[1,0,0,0], + Stars=[new(.4,.5,1000,3,.1)],AdditionalMeasurements=new(){{"Clear reference member",cloud?0:1}} + }; + var frames=Enumerable.Range(0,30).Select(n=>Make(n)).ToList();var selected=Make(30,true); + selected.CloudMask=Enumerable.Repeat((byte)1,SkyModel.Count).ToArray();selected.CloudCoverage=.9;selected.Automatic=Verdict.Reject;selected.Override=Verdict.Keep;selected.Note="Human decision"; + frames.Add(selected); + // Other sessions must not contribute to the reference, even without a readable catalog. + frames.Add(new(){Id="other",Session="other night",Measured=true,Alignment=[1,0,0,0],AdditionalMeasurements=new(){{"Clear reference member",1}}}); + var project=new Project{Frames=frames,Complete=true};ProjectStore.Save(project,directory); + var files=Directory.GetFiles(directory,"*",SearchOption.AllDirectories); + string Hash(string path)=>Convert.ToHexString(SHA256.HashData(File.ReadAllBytes(path))); + var before=files.ToDictionary(path=>path,Hash); + var restored=ProjectStore.Load(directory);selected=restored.Frames.Single(f=>f.Id=="30"); + var mask=SkyOverlay.LoadMask(directory,selected,restored.Frames,CancellationToken.None); + var clear=Enumerable.Range(0,SkyModel.Count).Where(i=>(i%SkyModel.Columns+.5)/SkyModel.Columns>.7&&(i/SkyModel.Columns+.5)/SkyModel.Rows>.35&&(i/SkyModel.Columns+.5)/SkyModel.Rows<.6).ToArray(); + var core=Enumerable.Range(0,SkyModel.Count).Where(i=>(i%SkyModel.Columns+.5)/SkyModel.Columns>.15&&(i%SkyModel.Columns+.5)/SkyModel.Columns<.35&&(i/SkyModel.Columns+.5)/SkyModel.Rows>.35&&(i/SkyModel.Columns+.5)/SkyModel.Rows<.45).ToArray(); + check(mask.Length==SkyModel.Count&&clear.All(i=>mask[i]==0)&&core.All(i=>mask[i]>0),"legacy overlay follows localized cloud glow instead of the compensating dark sky"); + check(selected.CloudMask.All(v=>v==1)&&selected.CloudCoverage==.9&&selected.Automatic==Verdict.Reject&&selected.Override==Verdict.Keep&&selected.Note=="Human decision","overlay reconstruction preserves classification evidence and human decisions"); + check(files.All(path=>before[path]==Hash(path)),"legacy overlay reconstruction leaves the saved project and catalogs byte-identical"); + selected.ExcessSkyMask=mask; + check(SkyOverlay.LoadMask("missing directory",selected,[],CancellationToken.None).SequenceEqual(mask),"newly measured overlays display without reopening reference catalogs"); + selected.ExcessSkyMask=[]; + File.Delete(Path.Combine(directory,"catalogs","0-v2.bin")); + check(SkyOverlay.LoadMask(directory,selected,restored.Frames,CancellationToken.None).Length==0,"incomplete legacy references never fall back to the misleading two-sided mask"); + } + finally{if(Directory.Exists(directory))Directory.Delete(directory,true);} + } + + sealed record Sample(string Name,int Width,int Height,double[] Alignment,float[] SkyMap,double[][] CloudRegions,double[][] ClearRegions); + sealed record Fixture(double?[] ReferenceBackground,double[] ReferenceScatter,double Noise,Sample[] Samples); + static void RealFrames(Action check) + { + var fixture=JsonSerializer.Deserialize(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"Fixtures","overlay-backgrounds.json")))!; + var reference=new SkyOverlay.Reference(fixture.ReferenceBackground.Select(v=>v??double.NaN).ToArray(),fixture.ReferenceScatter,fixture.Noise); + foreach(var sample in fixture.Samples) + { + var frame=new Frame{Width=sample.Width,Height=sample.Height,Alignment=sample.Alignment,SkyMap=sample.SkyMap}; + var mask=reference.Measure(frame);var a=sample.Alignment;double aspect=(double)sample.Height/sample.Width; + int[] Cells(double[] region)=>Enumerable.Range(0,SkyModel.Count).Where(i=> + { + double x=(i%SkyModel.Columns+.5)/SkyModel.Columns,y=(i/SkyModel.Columns+.5)/SkyModel.Rows; + double u=a[0]*x-a[1]*y*aspect+a[2],v=(a[1]*x+a[0]*y*aspect+a[3])/aspect; + return u>region[0]&&uregion[2]&&vcells.Length>0&&cells.Count(i=>mask[i]>=128)>=cells.Length*.85&&cells.Average(i=>(double)mask[i])>180),$"{sample.Name}: each reported cloud core has clearly visible overlay strength"); + check(clear.All(cells=>cells.Length>0&&cells.Count(i=>mask[i]>0)<=cells.Length*.1),$"{sample.Name}: dark comparison regions avoid the false corner overlay"); + } + } +} diff --git a/tests/AstroFrame.Validation/Program.cs b/tests/AstroFrame.Validation/Program.cs index 89e8460..04d0f25 100644 --- a/tests/AstroFrame.Validation/Program.cs +++ b/tests/AstroFrame.Validation/Program.cs @@ -105,5 +105,6 @@ try } finally{Directory.Delete(temp,true);} await ImageRegression.Run(Check); +OverlayRegression.Run(Check); PreviewRegression.Run(Check); Console.WriteLine($"{passed} checks passed. Synthetic tests validate mechanics, not astrophotography stack quality."); From a8e7a87b94d0f8046209e9c937bd83bf4b811f10 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 4 Oct 2026 09:33:44 -0700 Subject: [PATCH 05/12] Release 1.1.0 with adaptive RAM and interactive previews Replace fixed process, heap, frame and worker caps with physical RAM admission and CPU-scaled concurrency. Round Windows job budgets to native allocation boundaries. Add persistent cursor-centered zoom, drag and reset, fresh launches, cerulean update indicators and grey native startup backgrounds. Validate with isolated fixtures and a fake updater. --- Directory.Build.props | 2 +- README.md | 9 +-- docs/analysis-design.md | 2 +- docs/release-notes/1.1.0.md | 9 +++ .../AstroFrame.Desktop.csproj | 3 +- src/AstroFrame.Desktop/DesktopState.cs | 28 -------- .../DiagnosticUpdateBackend.cs | 11 +++ src/AstroFrame.Desktop/MainWindow.Updates.cs | 18 ++++- .../MainWindow.Verification.cs | 53 +++++++++++++++ src/AstroFrame.Desktop/MainWindow.cs | 12 +++- .../NativeWindowBackground.cs | 19 ++++++ src/AstroFrame.Desktop/PreviewViewport.cs | 33 +++++++++ src/AstroFrame.Desktop/Program.cs | 19 ++++-- src/AstroFrame.Desktop/StarInspector.cs | 2 +- src/AstroFrame.Desktop/Visuals.cs | 26 +++++-- src/AstroFrame.Engine/ProjectStore.cs | 4 +- src/AstroFrame.Engine/ResourcePolicy.cs | 68 +++++++++++++------ src/AstroFrame.Engine/SpatialReference.cs | 2 +- .../AstroFrame.Updates.Validation/Program.cs | 8 +++ .../AstroFrame.Validation.csproj | 3 +- tests/AstroFrame.Validation/Program.cs | 20 +++++- 21 files changed, 271 insertions(+), 80 deletions(-) create mode 100644 docs/release-notes/1.1.0.md delete mode 100644 src/AstroFrame.Desktop/DesktopState.cs create mode 100644 src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs create mode 100644 src/AstroFrame.Desktop/MainWindow.Verification.cs create mode 100644 src/AstroFrame.Desktop/NativeWindowBackground.cs create mode 100644 src/AstroFrame.Desktop/PreviewViewport.cs diff --git a/Directory.Build.props b/Directory.Build.props index 3c93a1e..548710a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.0.2 + 1.1.0 Elijah Kuntz AstroFrame diff --git a/README.md b/README.md index 3ac163a..a7a83a5 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ An independent Windows/Linux desktop application for selecting astrophotography For packaged installations, run `AstroFrame-win-x64-Setup.exe`. Linux users can use `AstroFrame-linux-x64.AppImage` and the accompanying `install-linux.sh` for an application-menu entry. Both target x64 PCs. See [installation and releases](docs/releases.md) for Debian/Arch prerequisites and package-building instructions. -**Settings → Updates** shows the installed version and update status, with automatic and manual checks. Installed packages check the [public repository releases](https://git.elijahkuntz.com/Elijah/AstroFrame/releases) on startup and every six hours. A newer stable release adds an update indicator to Settings. **Install update and restart** downloads the release package and restarts after saving; active analysis/export must finish first. Preferences and projects survive updates. Git pushes become app updates only after a versioned release and its packages are published. +**Settings → Updates** shows the installed version and update status, with automatic and manual checks. Installed packages check the [public repository releases](https://git.elijahkuntz.com/Elijah/AstroFrame/releases) on startup and every six hours. A newer stable release turns Settings cerulean blue and adds an update indicator. **Install update and restart** downloads the release package and restarts after saving; active analysis/export must finish first. Preferences and projects survive updates. Git pushes become app updates only after a versioned release and its packages are published. Open `artifacts/AstroFrame/AstroFrame.Desktop.exe`. This self-contained build does not require Python, a GPU, or a separate .NET installation. Keep the entire application folder together. -Windows enforces a **6 GiB process allocation limit** and a **3 GiB managed-heap limit**. Only one desktop instance can run at a time. Analysis uses up to four workers, leaving at least two logical processors unused where available. It rejects images exceeding a 256 MiB per-frame budget and pauses when it cannot leave roughly 25% of physical RAM free (up to 8 GiB). If pressure persists for 20 seconds, completed measurements are saved for resuming. The page file is not counted as available physical RAM. Windows software rendering is used during this release. The larger limit provides headroom; it does not allocate 6 GiB in advance. +Analysis scales its memory budget with physical RAM and samples available headroom before admitting each frame. It reserves one quarter of RAM (up to 8 GiB) for the OS and other applications, counts concurrent frame reservations atomically, and stops safely after 20 seconds of sustained pressure once active frames finish. Windows enforces a process ceiling of physical RAM minus that reserve; the old fixed process, heap and per-frame caps have been removed. Per-frame estimates include working buffers and are bounded by half the machine budget, with the existing 100 MP FITS limit retained. Up to 16 workers are selected from CPU capacity, leaving two logical processors unused where possible. Only one ordinary desktop instance runs at a time. The page file is not treated as available physical RAM. Windows uses software rendering. -`Open Sample Survey.cmd` opens all supplied datasets, including NGC 7000. `Open NGC 7000.cmd` opens its separate project. Normal launches reopen the last project automatically. Reopening a completed project uses saved measurements. New display caches are generated on demand for older projects without recomputing classifications; subsequent previews use cached linear thumbnails. An explicit project can also be opened with `AstroFrame.Desktop.exe --project "project folder"`. +`Open Sample Survey.cmd` opens all supplied datasets, including NGC 7000. `Open NGC 7000.cmd` opens its separate project. Normal launches start with an empty session. Saved projects and decisions remain available when explicitly reopened or when their source folder is selected again. Reopening a completed project uses saved measurements. New display caches are generated on demand for older projects without recomputing classifications; subsequent previews use cached linear thumbnails. An explicit project can also be opened with `AstroFrame.Desktop.exe --project "project folder"`. To analyze another dataset, choose **Analyze lights**, select the folder containing original `.fit`, `.fits`, or `.fts` files, and wait for analysis. Subfolders are included. New projects are saved separately under `%LOCALAPPDATA%/AstroFrame/Projects/` on Windows (the equivalent local application-data location on Linux). The input folder is not used for project storage. @@ -23,6 +23,7 @@ To analyze another dataset, choose **Analyze lights**, select the folder contain - Filter **REVIEW** or **REJECT**, and sort by concern, star count, stellar flux, or FWHM. - Toggle **Compare nearby** and **Spatial overlay**. Red fill shows transient sky structure in the aligned reference grid. Region outlines show forced stellar flux loss. Previews have independent display stretches; use measured flux to compare transparency. - Use **Frame view** for an area-averaged exposure preview, or **Nebula view** for additional averaging of faint diffuse structure. Adjust **Stretch** to brighten the display. These controls never affect measurements, classifications or original files. +- Scroll the mouse wheel over either preview to zoom around the cursor, and hold the left mouse button to drag. Zoom and image position persist across frames and are shared with the nearby comparison. **Reset view** restores the fitted, centered image. These display controls do not alter source pixels or analysis. - Press **1**, **2**, **3** for KEEP, REVIEW, REJECT. Decisions save and advance. **J/K** navigates. **Reset** restores the automatic decision. **Ctrl+Z** undoes a manual decision. - Decision evidence and measurements remain visible below the quality graph. Hover over an evidence line to read its full technical detail, and scroll the panel for additional measurements. Preview stretch and manual decisions sit below the image. Existing notes remain in saved projects and exports; the note editor has been removed. Automatic decisions and human overrides remain separate. @@ -62,7 +63,7 @@ dotnet publish src/AstroFrame.Desktop -c Release -r linux-x64 --self-contained t The Windows build and rendered layout were tested here. Linux uses Avalonia's X11 backend and bundled Skia/Harfbuzz binaries; packaged Linux startup, settings rendering, installation and self-updates were also exercised under Ubuntu WSL. Debian/Arch desktop acceptance remains to be checked directly. A Linux desktop with the usual X11/font/ICU libraries is required; see [installation and releases](docs/releases.md). -Prebuilt Linux files are in `artifacts/AstroFrame-linux`. On Linux, run `chmod +x AstroFrame.Desktop` before launching if executable permissions were lost during transfer. The managed-heap limit and RAM-pressure monitoring also apply on Linux; the Windows kernel job limit does not. +Prebuilt Linux files are in `artifacts/AstroFrame-linux`. On Linux, run `chmod +x AstroFrame.Desktop` before launching if executable permissions were lost during transfer. RAM admission and physical headroom monitoring also apply on Linux; the Windows kernel job ceiling does not. Batch analysis and review-label summaries: diff --git a/docs/analysis-design.md b/docs/analysis-design.md index 544ffe7..b15106b 100644 --- a/docs/analysis-design.md +++ b/docs/analysis-design.md @@ -48,7 +48,7 @@ Small sessions and unreliable references cannot automatically reject. Reference ## Memory, caching and safety -Up to four workers are now selected automatically, leaving two logical processors unused where possible. A 48-frame NGC 7000 measurement benchmark took 9.04/4.99/2.94 seconds with one/two/four workers, with identical star counts and four-worker peak RAM of 250 MiB. This measures the stellar/background stage, not whole-project speedup. No full-resolution image collection or stack is held in RAM. Reference maps are only 960 values per frame. Windows enforces a verified 6 GiB process allocation cap; both executables use a 3 GiB managed-heap cap. A 256 MiB estimated per-frame budget rejects oversized allocations. Analysis checks physical memory before both image passes, reserving up to 8 GiB or one quarter of physical RAM. The page file does not satisfy this reserve. Sustained pressure stops safely and saves measurements. +Version 1.1.0 selects up to 16 workers from CPU capacity, leaving two logical processors unused where possible. A 48-frame measurement run on a 16-logical-processor machine took 2.93 seconds with four workers and 1.32 seconds with fourteen, with identical star counts (peak working sets 251 and 762 MiB). This measures stellar/background processing, not whole-project speedup. No full-resolution image collection or stack is held in RAM. Windows uses a verified process ceiling based on physical RAM minus its reserve, rounded to an allocation boundary. Fixed 6 GiB process, 3 GiB heap and 256 MiB frame caps have been removed. Per-frame estimates include a 64 MiB working margin and are limited to half the machine budget. Both image passes, previews and star detail acquire atomic memory reservations, sampling physical headroom for every frame. The OS/desktop reserve remains one quarter of RAM up to 8 GiB; page-file capacity does not satisfy it. Sustained external pressure stops safely after active frames finish and saves completed measurements. Small JSON metadata stores decisions, notes, evidence and compact masks. Binary versioned caches hold stars, sky maps and forced photometry, validated against source size and modification time and reference identity. A new engine version invalidates analysis without losing human labels. Repeated analysis uses cached measurements and forced apertures when valid. Project writes replace a temporary file atomically. Cancellation leaves analysis incomplete and export disabled. diff --git a/docs/release-notes/1.1.0.md b/docs/release-notes/1.1.0.md new file mode 100644 index 0000000..f83412d --- /dev/null +++ b/docs/release-notes/1.1.0.md @@ -0,0 +1,9 @@ +# AstroFrame 1.1.0 + +- Processing uses more available RAM and CPU capacity. Fixed memory caps have been replaced with a physical-RAM budget and atomic reservations for concurrent frames, retaining headroom for the operating system and other applications. Processing pauses under RAM pressure and preserves completed work if pressure persists. +- Scroll over a preview to zoom around the cursor and drag with the left mouse button to pan. Zoom and position carry across frames and the nearby comparison. **Reset view** fits and centers both previews. Overlays follow the transformed image. +- Ordinary launches begin with a fresh, empty session. Saved projects and decisions remain on disk; explicit project opening and update restarts still restore the requested project. +- **Settings · Update available** turns cerulean blue when an update is available. +- The native startup background matches the application's charcoal grey. + +Validation covers engine/resource policy, updater safety, mocked publication, routed mouse events, preview resets and frame switching, rendered layouts at normal and minimum size including 144 DPI, and Windows native window behavior. A 48-frame measurement benchmark on a 16-thread machine improved from 2.93 seconds with four workers to 1.32 seconds with fourteen workers, with identical star counts; this is not a whole-project speed guarantee. Development verification uses workspace fixtures and a fake updater, leaving installed copies untouched. diff --git a/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj b/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj index c54e997..f549a63 100644 --- a/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj +++ b/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj @@ -1,4 +1,4 @@ - + WinExe @@ -10,7 +10,6 @@ - diff --git a/src/AstroFrame.Desktop/DesktopState.cs b/src/AstroFrame.Desktop/DesktopState.cs deleted file mode 100644 index e5bca1c..0000000 --- a/src/AstroFrame.Desktop/DesktopState.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Text.Json; - -namespace AstroFrame.Desktop; - -internal static class DesktopState -{ - static string PathName=>System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),"AstroFrame","desktop.json"); - public static void Remember(string projectDirectory) - { - if(Program.Arguments.Any(a=>a.StartsWith("--capture",StringComparison.Ordinal)||a=="--smoke"))return; - try - { - Directory.CreateDirectory(System.IO.Path.GetDirectoryName(PathName)!); - File.WriteAllText(PathName+".tmp",JsonSerializer.Serialize(new Dictionary{{"LastProject",projectDirectory}}));File.Move(PathName+".tmp",PathName,true); - } - catch(IOException){}catch(UnauthorizedAccessException){} - } - public static string? LastProject() - { - try - { - if(!File.Exists(PathName)||new FileInfo(PathName).Length>4096)return null; - var state=JsonSerializer.Deserialize>(File.ReadAllText(PathName)); - string? directory=state?.GetValueOrDefault("LastProject");return directory!=null&&File.Exists(System.IO.Path.Combine(directory,"project.json"))?directory:null; - } - catch(IOException){return null;}catch(JsonException){return null;}catch(UnauthorizedAccessException){return null;} - } -} diff --git a/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs b/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs new file mode 100644 index 0000000..095b3d1 --- /dev/null +++ b/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs @@ -0,0 +1,11 @@ +namespace AstroFrame.Desktop; + +// Diagnostic rendering never initializes the installed update locator or reads preferences. +internal sealed class DiagnosticUpdateBackend : IUpdateBackend +{ + public bool IsInstalled=>true; + public string InstalledVersion=>typeof(MainWindow).Assembly.GetName().Version?.ToString(3)??"1.1.0"; + public Task Check()=>Task.FromResult("9.0.0"); + public Task Download(Action progress,CancellationToken cancellation)=>throw new InvalidOperationException("Rendering diagnostics cannot download updates."); + public void ApplyAndRestart(string[] arguments)=>throw new InvalidOperationException("Rendering diagnostics cannot install updates."); +} diff --git a/src/AstroFrame.Desktop/MainWindow.Updates.cs b/src/AstroFrame.Desktop/MainWindow.Updates.cs index e04dfa9..5aab934 100644 --- a/src/AstroFrame.Desktop/MainWindow.Updates.cs +++ b/src/AstroFrame.Desktop/MainWindow.Updates.cs @@ -1,25 +1,30 @@ using Avalonia.Controls; using Avalonia.Threading; using Avalonia.Controls.ApplicationLifetimes; +using Avalonia; +using Avalonia.Styling; +using Avalonia.Controls.Presenters; namespace AstroFrame.Desktop; public sealed partial class MainWindow { - readonly AppUpdates updates = new(); + readonly AppUpdates updates = Program.Diagnostic ? new(new DiagnosticUpdateBackend(),new AppSettings(),_=>{}) : new(); readonly Button settingsButton = Button("Settings"); readonly DispatcherTimer updateTimer = new() { Interval = TimeSpan.FromHours(6) }; SettingsWindow? settingsWindow; void InitializeUpdates() { + Styles.Add(new Style(x=>x.OfType