Compare commits

..

No commits in common. "main" and "v1.1.6" have entirely different histories.
main ... v1.1.6

7 changed files with 16 additions and 49 deletions

View file

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

View file

@ -27,7 +27,7 @@ To analyze another dataset, choose **Analyze lights**, select the folder contain
- 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. - 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. - 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.
KEEP means consistent measurements; it does not certify a perfect frame. REVIEW means a substantial deviation or measurement uncertainty. REJECT requires strong, coherent transient sky structure, agreement between cloud/flux/star-loss measurements, thin cloud texture on an already-flagged frame that dims the stars beneath it relative to the rest of the exposure, severe combined morphology degradation, stellar elongation confirmed on the same matched reference stars (the roundness outliers stacking filters discard), or catastrophic star disappearance. Small ellipticity variations alone do not trigger review. KEEP means consistent measurements; it does not certify a perfect frame. REVIEW means a substantial deviation or measurement uncertainty. REJECT requires strong, coherent transient sky structure, agreement between cloud/flux/star-loss measurements, thin cloud texture on an already-flagged frame that dims the stars beneath it relative to the rest of the exposure, severe combined morphology degradation, or catastrophic star disappearance. Small ellipticity variations alone do not trigger review.
The earlier engine missed obvious clouds and falsely reviewed a clear frame. Its rolling background baselines and detection-only flux measurements have been replaced. Analysis-version changes request reanalysis while preserving manual decisions. Display changes have their own cache version, so preview upgrades do not invalidate quality measurements. The earlier engine missed obvious clouds and falsely reviewed a clear frame. Its rolling background baselines and detection-only flux measurements have been replaced. Analysis-version changes request reanalysis while preserving manual decisions. Display changes have their own cache version, so preview upgrades do not invalidate quality measurements.

View file

@ -6,7 +6,7 @@ The supplied 1,920 originals cover four targets and five sessions, with 2160×38
The first algorithm failed real owner-reviewed examples: cloud structure inflated detected-star counts; flux only sampled surviving detections; rolling baselines absorbed prolonged cloud; a small ellipticity deviation reviewed a clear image. The v2 design replaces the cloud measurements, reference construction and classification policy. Rejection counts are not a target or a validation criterion. The first algorithm failed real owner-reviewed examples: cloud structure inflated detected-star counts; flux only sampled surviving detections; rolling baselines absorbed prolonged cloud; a small ellipticity deviation reviewed a clear image. The v2 design replaces the cloud measurements, reference construction and classification policy. Rejection counts are not a target or a validation criterion.
Version 1.1.1 refines this policy with geometric fit diagnostics, local cloud-aperture corroboration, and matched-star morphology checks. Version 1.1.6 adds thin-cloud texture with same-exposure differential photometry; 1.1.7 adds moderate-cloud corroboration and confirmed-elongation rejection. The original v2 results remain a baseline; see [the 1.1.1 comparison](algorithm-1.1.1-validation.md) for the measurements and limits of the new validation. Version 1.1.1 refines this policy with geometric fit diagnostics, local cloud-aperture corroboration, and matched-star morphology checks. Version 1.1.6 adds thin-cloud texture with same-exposure differential photometry. The original v2 results remain a baseline; see [the 1.1.1 comparison](algorithm-1.1.1-validation.md) for the measurements and limits of the new validation.
## Components ## Components
@ -38,10 +38,8 @@ REJECT evidence routes are explicit:
- Moderate coherent spatial structure plus substantial global flux loss, regional forced-flux loss or detected-star loss. - Moderate coherent spatial structure plus substantial global flux loss, regional forced-flux loss or detected-star loss.
- Coherent structure at least 8× reference scatter, at least 8% affected overlap, and a connected anomalous area of at least 3.5%, corroborated by positive excess-sky coverage of at least 8% and a positive connected area of at least 3.5%. At least 20 reference apertures in two regions inside that excess sky must show below 90% of nearby same-aperture flux, with at least three times the larger of reference scatter, a 3% floor, and propagated local photometry uncertainty. Affected-aperture comparisons use the nearest 40 reference members, excluding the tested exposure, and require at least 12 valid comparison frames. - Coherent structure at least 8× reference scatter, at least 8% affected overlap, and a connected anomalous area of at least 3.5%, corroborated by positive excess-sky coverage of at least 8% and a positive connected area of at least 3.5%. At least 20 reference apertures in two regions inside that excess sky must show below 90% of nearby same-aperture flux, with at least three times the larger of reference scatter, a 3% floor, and propagated local photometry uncertainty. Affected-aperture comparisons use the nearest 40 reference members, excluding the tested exposure, and require at least 12 valid comparison frames.
- Thin cloud on an exposure already routed to REVIEW by another measurement: texture significance at least 10, a connected textured area of at least 5%, at least 20 apertures both inside and outside the texture, and stars inside at most 98% of their clear-cell flux with a loss of at least 2.5 times nearby reference scatter. Applying real cloud masks to clear exposures put 0.4–0.6% of differential deviations at or above 2.5, and clear exposures do not reach the texture prerequisite. This route never rejects an otherwise clean KEEP. - Thin cloud on an exposure already routed to REVIEW by another measurement: texture significance at least 10, a connected textured area of at least 5%, at least 20 apertures both inside and outside the texture, and stars inside at most 98% of their clear-cell flux with a loss of at least 2.5 times nearby reference scatter. Applying real cloud masks to clear exposures put 0.4–0.6% of differential deviations at or above 2.5, and clear exposures do not reach the texture prerequisite. This route never rejects an otherwise clean KEEP.
- Moderate thin cloud on an exposure the planar structure detector already flags (at least 5× scatter over 2% of the overlap): texture significance at least 20 with the same connectivity and aperture requirements, inside/outside dimming of at least 1.5% and 1.5 times scatter, and independently at least 20 excess-sky apertures in two regions at or below 93% of nearby same-aperture flux with at least 2.5 times scatter.
- Severe global flux loss (below 60% of clear-frame baseline) with substantial detected-star loss. - Severe global flux loss (below 60% of clear-frame baseline) with substantial detected-star loss.
- Severe combined stellar width and ellipticity degradation, or almost complete star disappearance relative to a rich reference field. - Severe combined stellar width and ellipticity degradation, or almost complete star disappearance relative to a rich reference field.
- Confirmed elongation: an existing elongation flag (at least four scatters and 0.15 above the nearby ellipticity baseline) that the same matched reference stars confirm. This requires at least 50 matched stars and 12 nearby reference frames, uncertainty at most 0.025, and a median change whose lower three-standard-error bound is at least 0.10, the same limit below which a flag is dismissed. Changes between the two limits stay REVIEW. Stacking workflows discard such roundness outliers; for example, Siril's Seestar script applies `-filter-round=2.5k`. On both supplied NGC 1432 nights, 22 of 38 confirmed frames fall below Siril's own roundness cutoff and the rest lie near it. Every confirmed frame exceeds an eccentricity-equivalent of 0.6. Unconfirmed or imprecise flags remain REVIEW.
Automatic rejection requires enough comparable frames, valid time and adequate aligned overlap. Ordinary spatial rejection also requires verified geometry: at least 20 tight correspondences, at least 80% of correspondences within the width-scaled tight tolerance, three regions with at least three tight matches each, and a spread of at least 15% of the image width and height. The median residual must be at most the larger of 0.5 original pixels and 0.2× reference width; the 95th percentile must be at most the larger of one original pixel and 0.5× reference width. Transform scale must remain between 0.975 and 1.025. Missing stars alone no longer veto a cloud rejection when geometry and aperture coverage are verified; low star survival still cannot certify KEEP. Catalog-only classification retains its previous match-fraction safeguard. Automatic rejection requires enough comparable frames, valid time and adequate aligned overlap. Ordinary spatial rejection also requires verified geometry: at least 20 tight correspondences, at least 80% of correspondences within the width-scaled tight tolerance, three regions with at least three tight matches each, and a spread of at least 15% of the image width and height. The median residual must be at most the larger of 0.5 original pixels and 0.2× reference width; the 95th percentile must be at most the larger of one original pixel and 0.5× reference width. Transform scale must remain between 0.975 and 1.025. Missing stars alone no longer veto a cloud rejection when geometry and aperture coverage are verified; low star survival still cannot certify KEEP. Catalog-only classification retains its previous match-fraction safeguard.

View file

@ -1,10 +0,0 @@
# AstroFrame 1.1.7
Resolves the remaining moderately clouded exposures and trailed-star exposures automatically, so very few frames are left for manual review.
- **Moderate thin cloud.** An exposure the sky-structure detector already flags becomes Reject when strong cloud texture is backed by two independent, moderate signs of dimming: stars inside the texture are fainter than stars in clear parts of the same exposure, and the excess-sky apertures are fainter than in nearby frames. A light flash or other sky-only artifact that dims no stars still stays Review.
- **Confirmed star elongation.** Elongation is now rejected when the same matched reference stars confirm it well beyond measurement uncertainty. This follows common stacking practice: Siril's Seestar preprocessing script discards roundness outliers (`-filter-round=2.5k`), and PixInsight users commonly treat eccentricity above 0.6 as unusable. On both supplied NGC 1432 nights, 22 of 38 confirmed frames fall below Siril's own roundness cutoff and the rest sit near it; all exceed an eccentricity-equivalent of 0.6. Elongation that is imprecise or only marginally confirmed still stays Review.
In the supplied 1,053-frame NGC 1432 project, Review decreases from 36 (1.1.6) to 1, an exposure with a full-width light flash, and from 48 in 1.1.5. Reject increases to 147. Every Keep is unchanged. Across eleven other saved projects (about 5,000 exposures), Review decreases from 337 to 153; every change is Review to Reject, and no Keep changed. Changed frames were checked against previews and matched star crops. Most of the remaining Reviews in one M33 session are high-background (twilight or moonlit) exposures, which this release does not change.
Analysis time and memory use are unchanged. Old automatic measurements require reanalysis; manual decisions are retained. Engine (102) and updater (23) checks pass on the versioned source. Windows and Linux update channels are included.

View file

@ -40,7 +40,6 @@ public static class Classification
double countZ=Metric("Star count",x=>x.StarCount,true,.10),fluxZ=Metric("Stellar flux",x=>x.Transparency,true,.06),widthZ=Metric("FWHM",x=>x.Fwhm,false,.08),shapeZ=Metric("Ellipticity",x=>x.Ellipticity,false,.15),bgZ=Metric("Background",x=>x.Background,false,.06),noiseZ=Metric("Noise",x=>x.Noise,false,.08); double countZ=Metric("Star count",x=>x.StarCount,true,.10),fluxZ=Metric("Stellar flux",x=>x.Transparency,true,.06),widthZ=Metric("FWHM",x=>x.Fwhm,false,.08),shapeZ=Metric("Ellipticity",x=>x.Ellipticity,false,.15),bgZ=Metric("Background",x=>x.Background,false,.06),noiseZ=Metric("Noise",x=>x.Noise,false,.08);
Metric("Background variation",x=>x.BackgroundVariation,false,.20); Metric("Background variation",x=>x.BackgroundVariation,false,.20);
double Ratio(string key,double value)=>value/Math.Max(f.Baselines.GetValueOrDefault(key),.00001); double Ratio(string key,double value)=>value/Math.Max(f.Baselines.GetValueOrDefault(key),.00001);
double Measured(string key)=>f.AdditionalMeasurements.GetValueOrDefault(key);
double countRatio=Ratio("Star count",f.StarCount),fluxRatio=Ratio("Stellar flux",f.Transparency),widthRatio=Ratio("FWHM",f.Fwhm); double countRatio=Ratio("Star count",f.StarCount),fluxRatio=Ratio("Stellar flux",f.Transparency),widthRatio=Ratio("FWHM",f.Fwhm);
double connected=f.AdditionalMeasurements.GetValueOrDefault("Cloud connected coverage"); double connected=f.AdditionalMeasurements.GetValueOrDefault("Cloud connected coverage");
// A single sky detector must be overwhelming to discard integration on its own. // A single sky detector must be overwhelming to discard integration on its own.
@ -89,15 +88,7 @@ public static class Classification
} }
if(widthBad)f.Evidence.Add(new("FWHM",f.Fwhm,f.Baselines["FWHM"],widthZ,$"Stellar width {widthRatio:0.00} × clear-frame baseline")); if(widthBad)f.Evidence.Add(new("FWHM",f.Fwhm,f.Baselines["FWHM"],widthZ,$"Stellar width {widthRatio:0.00} × clear-frame baseline"));
if(shapeBad)f.Evidence.Add(new("Ellipticity",f.Ellipticity,f.Baselines["Ellipticity"],shapeZ,$"Substantial stellar elongation ({f.Ellipticity:0.00} vs {f.Baselines["Ellipticity"]:0.00})")); if(shapeBad)f.Evidence.Add(new("Ellipticity",f.Ellipticity,f.Baselines["Ellipticity"],shapeZ,$"Substantial stellar elongation ({f.Ellipticity:0.00} vs {f.Baselines["Ellipticity"]:0.00})"));
// Stacking workflows such as Siril's Seestar script discard roundness outliers rather than bool optics=widthBad&&shapeBad&&widthRatio>1.65;
// averaging trailed stars into the result. Reject elongation that the same matched reference
// stars confirm well beyond their measurement uncertainty; unconfirmed flags stay REVIEW.
bool confirmedElongation=shapeBad&&Measured("Matched shape samples")>=50&&Measured("Matched shape reference frames")>=12&&
Measured("Matched shape uncertainty")>0&&Measured("Matched shape uncertainty")<=.025&&
Measured("Matched shape change")-3*Measured("Matched shape uncertainty")>=.10;
if(confirmedElongation)f.Evidence.Add(new("Matched stellar shape",Measured("Matched shape change"),0,Measured("Matched shape change")/Measured("Matched shape uncertainty"),
$"The same {Measured("Matched shape samples"):0} reference stars are {Measured("Matched shape change"):0.00} more elongated than in nearby clear frames (±{Measured("Matched shape uncertainty"):0.000}); a roundness outlier that stacking filters discard"));
bool optics=widthBad&&shapeBad&&widthRatio>1.65||confirmedElongation;
bool catastrophic=f.StarCount<3&&f.Baselines["Star count"]>50; bool catastrophic=f.StarCount<3&&f.Baselines["Star count"]>50;
bool cloud=strongStructure||moderateStructure&&(fluxLoss||regionLoss||starLoss)||strongFlux||localCloudLoss; bool cloud=strongStructure||moderateStructure&&(fluxLoss||regionLoss||starLoss)||strongFlux||localCloudLoss;
bool lowMatches=f.MatchFraction<.35; bool lowMatches=f.MatchFraction<.35;
@ -110,15 +101,10 @@ public static class Classification
// removed and dims the stars beneath it relative to clear parts of the same exposure. // removed and dims the stars beneath it relative to clear parts of the same exposure.
// Requiring both keeps sky-only changes, such as gradients, out of this route. It only // Requiring both keeps sky-only changes, such as gradients, out of this route. It only
// resolves frames other measurements already flag; it never rejects an otherwise clean KEEP. // resolves frames other measurements already flag; it never rejects an otherwise clean KEEP.
bool texture=suspicious&&spatial&&Measured("Cloud texture significance")>=10&&Measured("Cloud texture connected coverage")>=.05&& double Measured(string key)=>f.AdditionalMeasurements.GetValueOrDefault(key);
Measured("Cloud texture differential samples")>=20&&Measured("Cloud texture differential flux ratio")>0; bool thinCloud=suspicious&&spatial&&Measured("Cloud texture significance")>=10&&Measured("Cloud texture connected coverage")>=.05&&
// Moderate dimming suffices when the plane-detrended structure detector also flags the frame, Measured("Cloud texture differential samples")>=20&&Measured("Cloud texture differential flux ratio")>0&&
// the texture is strong, and the excess-sky apertures independently lose flux against nearby frames. Measured("Cloud texture differential flux ratio")<=.98&&Measured("Cloud texture differential flux deviation")>=2.5;
bool thinCloud=texture&&(Measured("Cloud texture differential flux ratio")<=.98&&Measured("Cloud texture differential flux deviation")>=2.5||
moderateStructure&&Measured("Cloud texture significance")>=20&&
Measured("Cloud texture differential flux ratio")<=.985&&Measured("Cloud texture differential flux deviation")>=1.5&&
Measured("Cloud aperture samples")>=20&&Measured("Cloud aperture regions")>=2&&
Measured("Cloud aperture flux ratio")>0&&Measured("Cloud aperture flux ratio")<=.93&&Measured("Cloud aperture flux deviation")>=2.5);
if(thinCloud)f.Evidence.Add(new("Cloud texture",Measured("Cloud texture differential flux ratio"),1,Measured("Cloud texture differential flux deviation"), if(thinCloud)f.Evidence.Add(new("Cloud texture",Measured("Cloud texture differential flux ratio"),1,Measured("Cloud texture differential flux deviation"),
$"Thin cloud texture covers {Measured("Cloud texture coverage"):P0} of the aligned overlap (largest connected area {Measured("Cloud texture connected coverage"):P0}, {Measured("Cloud texture significance"):0.0} × clear-frame scatter); stars beneath it are {1-Measured("Cloud texture differential flux ratio"):P1} fainter relative to clear parts of the same exposure ({Measured("Cloud texture differential flux deviation"):0.0} × nearby clear-frame scatter, {Measured("Cloud texture differential samples"):0} apertures)")); $"Thin cloud texture covers {Measured("Cloud texture coverage"):P0} of the aligned overlap (largest connected area {Measured("Cloud texture connected coverage"):P0}, {Measured("Cloud texture significance"):0.0} × clear-frame scatter); stars beneath it are {1-Measured("Cloud texture differential flux ratio"):P1} fainter relative to clear parts of the same exposure ({Measured("Cloud texture differential flux deviation"):0.0} × nearby clear-frame scatter, {Measured("Cloud texture differential samples"):0} apertures)"));
cloud|=thinCloud; cloud|=thinCloud;

View file

@ -70,7 +70,7 @@ public sealed class Frame
} }
public sealed class Project public sealed class Project
{ {
public const string EngineVersion="0.2.3-spatial-reference-4"; public const string EngineVersion="0.2.2-spatial-reference-3";
public string Version {get;set;}=EngineVersion; public string Version {get;set;}=EngineVersion;
public string Name {get;set;}="Untitled"; public string Name {get;set;}="Untitled";
public string Source {get;set;}=""; public string Source {get;set;}="";

View file

@ -16,8 +16,8 @@ static class QualityRegression
var opaque=Make(40);opaque.Stars=stars.Take(25).ToList();opaque.StarCount=25; var opaque=Make(40);opaque.Stars=stars.Take(25).ToList();opaque.StarCount=25;
var broad=Make(41);var gradient=Make(42);var uncertain=Make(43);var cohort=Make(44);var trailing=Make(45); var broad=Make(41);var gradient=Make(42);var uncertain=Make(43);var cohort=Make(44);var trailing=Make(45);
var subtleShape=Make(46);var insufficient=Make(47);var noisyFlux=Make(48); var subtleShape=Make(46);var insufficient=Make(47);var noisyFlux=Make(48);
var thinFlagged=Make(49);var thinUndimmed=Make(50);var thinClean=Make(51);var unconfirmedShape=Make(52);var moderateCloud=Make(53); var thinFlagged=Make(49);var thinUndimmed=Make(50);var thinClean=Make(51);
frames.AddRange([opaque,broad,gradient,uncertain,cohort,trailing,subtleShape,insufficient,noisyFlux,thinFlagged,thinUndimmed,thinClean,unconfirmedShape,moderateCloud]); frames.AddRange([opaque,broad,gradient,uncertain,cohort,trailing,subtleShape,insufficient,noisyFlux,thinFlagged,thinUndimmed,thinClean]);
foreach(var f in frames) foreach(var f in frames)
{ {
Matching.Measure(frames[0],f);f.Transparency=1;f.RegionFlux=Enumerable.Repeat(1.0,12).ToArray();f.RegionMatches=Enumerable.Repeat(8,12).ToArray(); Matching.Measure(frames[0],f);f.Transparency=1;f.RegionFlux=Enumerable.Repeat(1.0,12).ToArray();f.RegionMatches=Enumerable.Repeat(8,12).ToArray();
@ -43,7 +43,7 @@ static class QualityRegression
trailing.Ellipticity=.3;trailing.AdditionalMeasurements["Matched shape samples"]=100; trailing.Ellipticity=.3;trailing.AdditionalMeasurements["Matched shape samples"]=100;
trailing.AdditionalMeasurements["Matched shape change"]=.2;trailing.AdditionalMeasurements["Matched shape uncertainty"]=.01; trailing.AdditionalMeasurements["Matched shape change"]=.2;trailing.AdditionalMeasurements["Matched shape uncertainty"]=.01;
subtleShape.Ellipticity=.3;subtleShape.AdditionalMeasurements["Matched shape samples"]=100; subtleShape.Ellipticity=.3;subtleShape.AdditionalMeasurements["Matched shape samples"]=100;
subtleShape.AdditionalMeasurements["Matched shape change"]=.10;subtleShape.AdditionalMeasurements["Matched shape uncertainty"]=.005; subtleShape.AdditionalMeasurements["Matched shape change"]=.12;subtleShape.AdditionalMeasurements["Matched shape uncertainty"]=.005;
void Texture(Frame f,double ratio,double deviation,bool flagged) void Texture(Frame f,double ratio,double deviation,bool flagged)
{ {
f.AdditionalMeasurements["Clear reference member"]=0; f.AdditionalMeasurements["Clear reference member"]=0;
@ -51,20 +51,14 @@ static class QualityRegression
f.AdditionalMeasurements["Cloud texture connected coverage"]=.10;f.AdditionalMeasurements["Cloud texture differential samples"]=60; f.AdditionalMeasurements["Cloud texture connected coverage"]=.10;f.AdditionalMeasurements["Cloud texture differential samples"]=60;
f.AdditionalMeasurements["Cloud texture differential flux ratio"]=ratio;f.AdditionalMeasurements["Cloud texture differential flux deviation"]=deviation; f.AdditionalMeasurements["Cloud texture differential flux ratio"]=ratio;f.AdditionalMeasurements["Cloud texture differential flux deviation"]=deviation;
if(!flagged)return; if(!flagged)return;
// Weak, uncorroborated planar structure routes the frame to REVIEW. f.Ellipticity=.3;f.AdditionalMeasurements["Matched shape samples"]=100;
Cloud(f,6,.05,1); f.AdditionalMeasurements["Matched shape change"]=.2;f.AdditionalMeasurements["Matched shape uncertainty"]=.01;
} }
Texture(thinFlagged,.96,4,true);Texture(thinUndimmed,1,.3,true);Texture(thinClean,.96,4,false); Texture(thinFlagged,.96,4,true);Texture(thinUndimmed,1,.3,true);Texture(thinClean,.96,4,false);
unconfirmedShape.Ellipticity=.3;unconfirmedShape.AdditionalMeasurements["Matched shape samples"]=30;
unconfirmedShape.AdditionalMeasurements["Matched shape change"]=.2;unconfirmedShape.AdditionalMeasurements["Matched shape uncertainty"]=.01;
// Flagged sky structure, strong texture, and two moderate, independent dimming measurements.
Texture(moderateCloud,.98,2,false);Cloud(moderateCloud,8,.10,.91);moderateCloud.AdditionalMeasurements["Cloud aperture flux deviation"]=2.9;
moderateCloud.AdditionalMeasurements["Cloud texture significance"]=30;moderateCloud.Transparency=1;
Classification.Run(frames); Classification.Run(frames);
check(thinFlagged.Automatic==Verdict.Reject&&thinFlagged.Evidence.Any(e=>e.Metric=="Cloud texture"),"flagged frame with thin cloud texture that dims stars beneath it rejects"); check(thinFlagged.Automatic==Verdict.Reject&&thinFlagged.Evidence.Any(e=>e.Metric=="Cloud texture"),"flagged frame with thin cloud texture that dims stars beneath it rejects");
check(thinUndimmed.Automatic==Verdict.Review,"thin texture without differential stellar dimming stays REVIEW"); check(thinUndimmed.Automatic==Verdict.Review,"thin texture without differential stellar dimming stays REVIEW");
check(thinClean.Automatic==Verdict.Keep,"thin cloud texture alone never rejects an otherwise clean KEEP"); check(thinClean.Automatic==Verdict.Keep,"thin cloud texture alone never rejects an otherwise clean KEEP");
check(moderateCloud.Automatic==Verdict.Reject&&moderateCloud.Evidence.Any(e=>e.Metric=="Cloud texture"),"flagged sky structure with strong texture and two moderate dimming measurements rejects");
double[] curved=Enumerable.Range(0,SkyModel.Count).Select(i=>{double x=(i%SkyModel.Columns+.5)/SkyModel.Columns-.5,y=(i/SkyModel.Columns+.5)/SkyModel.Rows-.5;return 1000+40*x-30*y+200*x*x-150*x*y+120*y*y;}).ToArray(); double[] curved=Enumerable.Range(0,SkyModel.Count).Select(i=>{double x=(i%SkyModel.Columns+.5)/SkyModel.Columns-.5,y=(i/SkyModel.Columns+.5)/SkyModel.Rows-.5;return 1000+40*x-30*y+200*x*x-150*x*y+120*y*y;}).ToArray();
check(SkyModel.Detrend(curved,true).All(v=>Math.Abs(v)<.01)&&SkyModel.Detrend(curved).Max(Math.Abs)>5,"quadratic detrending removes smooth sky curvature that a plane leaves behind"); check(SkyModel.Detrend(curved,true).All(v=>Math.Abs(v)<.01)&&SkyModel.Detrend(curved).Max(Math.Abs)>5,"quadratic detrending removes smooth sky curvature that a plane leaves behind");
double[] spike=new double[SkyModel.Count];spike[10*SkyModel.Columns+10]=9;var smoothed=SkyModel.Smooth(spike); double[] spike=new double[SkyModel.Count];spike[10*SkyModel.Columns+10]=9;var smoothed=SkyModel.Smooth(spike);
@ -74,9 +68,8 @@ static class QualityRegression
check(gradient.Automatic==Verdict.Review,"uncorroborated sky structure stays REVIEW rather than rejecting a possible gradient"); check(gradient.Automatic==Verdict.Review,"uncorroborated sky structure stays REVIEW rather than rejecting a possible gradient");
check(uncertain.Automatic==Verdict.Review,"severe apparent cloud with unverified geometry stays REVIEW"); check(uncertain.Automatic==Verdict.Review,"severe apparent cloud with unverified geometry stays REVIEW");
check(cohort.Automatic==Verdict.Keep,"matched-star evidence can resolve an elongation flag caused by a changed detection cohort"); check(cohort.Automatic==Verdict.Keep,"matched-star evidence can resolve an elongation flag caused by a changed detection cohort");
check(trailing.Automatic==Verdict.Reject&&trailing.Cause=="Likely tracking or focus failure","elongation confirmed by the same matched reference stars rejects as a roundness outlier"); check(trailing.Automatic==Verdict.Review,"matched-star elongation remains REVIEW when other measurements are normal");
check(unconfirmedShape.Automatic==Verdict.Review,"elongation without enough matched reference stars stays REVIEW"); check(subtleShape.Automatic==Verdict.Review,"measurable sub-threshold matched elongation is not promoted to KEEP");
check(subtleShape.Automatic==Verdict.Review,"matched elongation between the dismissal and rejection limits stays REVIEW");
check(insufficient.Automatic==Verdict.Review&&noisyFlux.Automatic==Verdict.Review,"too few or noisy affected apertures cannot authorize cloud rejection"); check(insufficient.Automatic==Verdict.Review&&noisyFlux.Automatic==Verdict.Review,"too few or noisy affected apertures cannot authorize cloud rejection");
check(frames.Take(40).All(f=>f.Automatic==Verdict.Keep),"quality policy changes preserve unchanged clear comparisons"); check(frames.Take(40).All(f=>f.Automatic==Verdict.Keep),"quality policy changes preserve unchanged clear comparisons");
var options=new JsonSerializerOptions{PropertyNameCaseInsensitive=true,Converters={new JsonStringEnumConverter()}}; var options=new JsonSerializerOptions{PropertyNameCaseInsensitive=true,Converters={new JsonStringEnumConverter()}};