Commit 53fe5f5c authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: retire curt.pose_recalc - delete-the-file is THE force method; reuse printlns say so

Andrey's clutter rule: calibration force-rerun = erase the file, not a
config checkbox. pose_recalc removed everywhere (field/dialog/properties/
copy; old configs' leftover key is ignored harmlessly), poseSequencePass
lost its allow_recalc parameter. Every file-gated reuse now prints the
delete-to-recalculate hint:
- TILE-CALIB: 'reusing ... delete <name>-POSE-RT-TILE-CALIB.tiff to recalculate'
- RT-STATE dc_center: 'delete <name>-RT-STATE.json (or its dc_center field)'
- FPN (CorrectionFPN): 'reusing saved <name>-FPN.tiff - delete it to
  recalculate (verify Rotation period first - a mismatch bakes an
  azimuth-sector content ghost into the FPN)'
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 2c6751b8
......@@ -137,6 +137,11 @@ public class CorrectionFPN {
fpn = center_CLT.getCorrectionFPN().readImageFPN ( -1); // int sens_mask);
boolean created_fpn = false;
double [][] fpn_weights = null;
if ((fpn != null) && !cuas_calc_fpn) { // file-gated reuse (Andrey 07/06/2026): delete the file to force
System.out.println("FPN: reusing saved "+center_CLT.getImageName()+QuadCLT.CENTER_FPN_SUFFIX+
".tiff - delete it (model dir) to recalculate (verify \"Rotation period\" matches the true "+
"period first - a mismatch bakes an azimuth-sector content ghost into the FPN)");
}
if ((fpn == null) || cuas_calc_fpn) {
if (debugLevel >-3) {
System.out.println("Calculating FPN.");
......
......@@ -551,8 +551,9 @@ public class CuasPoseRT {
*
* TILE-CALIBRATION BOOTSTRAP (Andrey's missing-file rule, 07/05/2026): calibrations
* are FILE-gated, per scene sequence (the file lives in this sequence's CENTER model
* directory). If -POSE-RT-TILE-CALIB is missing (fresh v013_min copy) or
* curt.pose_recalc is ON, pass 1 runs FULL (all strength-selected tiles), generates
* directory). If -POSE-RT-TILE-CALIB is missing (fresh v013_min copy - or DELETED
* to force: the ONLY force method, no configuration checkbox), pass 1 runs FULL
* (all strength-selected tiles), generates
* and saves the calibration, and the sequence AUTOMATICALLY re-runs filtered
* (~150 cluster tiles): the first run is slow but ends in the same state as a warmed
* system, and all outputs are the filtered-run products (pass-1 outputs are
......@@ -576,7 +577,6 @@ public class CuasPoseRT {
final int debugLevel) {
final boolean [] saved_calib = new boolean [1];
double [][][] fitted = poseSequencePass(clt_parameters, center_CLT, quadCLTs,
true, // allow_recalc: honor curt.pose_recalc on the first pass
saved_calib, // out: set when this pass generated+saved the tile calibration
debugLevel);
if (saved_calib[0]) { // bootstrap: calibration was just generated - re-run filtered
......@@ -584,7 +584,6 @@ public class CuasPoseRT {
" was just generated; re-running the sequence with the filtered selection"+
" (all outputs are overwritten by the filtered run)");
fitted = poseSequencePass(clt_parameters, center_CLT, quadCLTs,
false, // allow_recalc: ignore curt.pose_recalc - use the fresh calibration
null, // saved_calib: a filtered pass never writes the calibration
debugLevel);
}
......@@ -597,7 +596,6 @@ public class CuasPoseRT {
final CLTParameters clt_parameters,
final QuadCLT center_CLT,
final QuadCLT [] quadCLTs,
final boolean allow_recalc, // false on the bootstrap re-run: ignore curt.pose_recalc
final boolean [] saved_calib, // out (may be null): [0]=true if the tile calibration was saved
final int debugLevel) {
final double min_str = clt_parameters.curt.pose_str; // e.g. 1.0
......@@ -654,10 +652,10 @@ public class CuasPoseRT {
boolean full_selection = true; // the tile calibration is (re)saved only from a full-selection run
// pose_full (DEBUG): all strength-selected tiles, calibration neither read nor written
// (a measurement-debug run must not pollute the persistent tile calibration). By Claude on 07/04/2026.
final boolean force_recalc = allow_recalc && clt_parameters.curt.pose_recalc; // bootstrap re-run never re-forces // By Claude on 07/05/2026
ImagePlus imp_max = (force_recalc || clt_parameters.curt.pose_full) ? null :
// File-gated (no force checkbox - DELETE the file to force a rebuild, Andrey 07/06/2026)
ImagePlus imp_max = clt_parameters.curt.pose_full ? null :
center_CLT.readImagePlusFromModelDirectory(TILE_CALIB_SUFFIX);
if ((imp_max == null) && !force_recalc && !clt_parameters.curt.pose_full) { // legacy name fallback
if ((imp_max == null) && !clt_parameters.curt.pose_full) { // legacy name fallback
imp_max = center_CLT.readImagePlusFromModelDirectory(TILE_CALIB_SUFFIX_OLD);
}
if (clt_parameters.curt.pose_full) {
......@@ -679,10 +677,10 @@ public class CuasPoseRT {
}
full_selection = false;
System.out.println("CuasPoseRT.testPoseSequence(): reusing "+TILE_CALIB_SUFFIX+" calibration, filtered to "+
num_filt+" tiles (of "+num_reliable+" by strength)");
num_filt+" tiles (of "+num_reliable+" by strength); delete "+
center_CLT.getImageName()+TILE_CALIB_SUFFIX+".tiff (model dir) to recalculate");
} else {
System.out.println("CuasPoseRT.testPoseSequence(): "+
(force_recalc ? "curt_pose_recalc ON" : TILE_CALIB_SUFFIX+" not found")+
System.out.println("CuasPoseRT.testPoseSequence(): "+TILE_CALIB_SUFFIX+" not found"+
" - FULL run, will generate the calibration"+
(clt_parameters.curt.pose_full ? "" : ", then re-run filtered (bootstrap)"));
}
......
......@@ -211,7 +211,8 @@ public class CuasRT {
if (rt_state.dc_center != null) {
level = rt_state.dc_center;
System.out.println("appropriateCenter(): center DC level = "+level+" (reused from "+
CuasRtState.SUFFIX+": "+rt_state.dc_center_source+")");
CuasRtState.SUFFIX+": "+rt_state.dc_center_source+"); delete "+
center_CLT.getImageName()+CuasRtState.SUFFIX+" (or its dc_center field) to re-derive");
}
}
if (level == 0.0) { // derive: median of the top (sky) half of the reference buffer render
......
......@@ -21,7 +21,6 @@ public class CuasRtParameters {
public double pose_str = 1.0; // reliable-tile strength threshold over the combo-DSI strength for the pose test tile selection (1.0 ~ old getReliableTiles population). // By Claude on 07/03/2026
public double pose_dxy_k = 0.75; // tile-selection outlier gate: keep tiles with max-over-scenes residual <= median + k*NMAD of the finite per-tile maxes (scale-free - adapts to footage quality/sequence length; NaN-in-any-scene = +inf, always rejected). <=0 - skip the gate. // By Claude on 07/04/2026
public int pose_num_tiles = 150; // tile-selection compute budget: after the gate, keep this many BEST (smallest max-residual) tiles; threshold-free rank - always yields the best available population. <=0 - no cap. // By Claude on 07/04/2026
public boolean pose_recalc = false; // force regeneration of the -POSE-RT-TILE-CALIB calibration even if it exists: FULL-selection pass 1 rebuilds+saves it, then the sequence automatically re-runs filtered (bootstrap). Default (false): file-gated reuse - if -POSE-RT-TILE-CALIB exists, use it (NMAD gate + rank-N selection); if missing, the same full-then-filtered bootstrap runs automatically, so the PREFERRED force method is simply ERASING the file (this checkbox is a convenience, normally leave OFF). // By Claude on 07/05/2026
public boolean pose_raw = false; // phase A2 ingest: per scene read RAW /jp4/, condition with the current calibration (CuasConditioning: rowcol + photometric + FPN) and FORCE-upload straight to the GPU, bypassing the QuadCLT prepared image_data (which carries the old broken Photogrammetric Calibration). Judge by own dstored quality, not agreement with phase A. // By Claude on 07/05/2026
public boolean pose_lean = false; // phase B measurement engine: TD-average the 16 sensors (CuasTD, CPU bridge) then ONE conj-multiply vs the virtual-center TD -> FZ-normalize -> PD -> argmax+eigen (getMaxXYCmEig) -> 3-angle LMA. All existing GPU kernels. v1: NO motion-blur compensation - compare vs the NOMB baseline. // By Claude on 07/05/2026
public boolean pose_full = false; // DEBUG: use ALL strength-selected tiles (~1074) - the -POSE-RT-TILE-CALIB calibration is neither read nor written (temporary bypass of the 150-tile filter for measurement debugging). // By Claude on 07/04/2026
......@@ -100,8 +99,6 @@ public class CuasRtParameters {
"Keep tiles with max-over-scenes residual <= median + k*NMAD of finite per-tile maxes (scale-free; NaN in any scene always rejected). <=0 - skip the gate.");
gd.addNumericField("Pose test number of best tiles", this.pose_num_tiles, 0,7,"", // By Claude on 07/04/2026
"After the gate keep this many best (smallest max-residual) tiles - the RT compute budget. <=0 - no cap.");
gd.addCheckbox ("Pose test force recalc calibration", this.pose_recalc, // By Claude on 07/04/2026
"Force a FULL pose run that regenerates -POSE-RT-TILE-CALIB even if it exists. Default OFF = automatic reuse: use the calibration if present (filtered run), else run full and generate it.");
gd.addCheckbox ("Pose test raw-jp4 ingest (A2)", this.pose_raw, // By Claude on 07/05/2026
"Per scene: read RAW /jp4/, condition with the CURRENT calibration (rowcol+photometric+FPN, CuasConditioning) and force-upload straight to the GPU, bypassing the prepared image_data (old broken Photogrammetric Calibration).");
gd.addCheckbox ("Pose test lean correlation (B)", this.pose_lean, // By Claude on 07/05/2026
......@@ -252,7 +249,6 @@ public class CuasRtParameters {
this.pose_str = gd.getNextNumber(); // By Claude on 07/03/2026
this.pose_dxy_k = gd.getNextNumber(); // By Claude on 07/04/2026
this.pose_num_tiles =(int) gd.getNextNumber(); // By Claude on 07/04/2026
this.pose_recalc = gd.getNextBoolean(); // By Claude on 07/04/2026
this.pose_raw = gd.getNextBoolean(); // By Claude on 07/05/2026
this.pose_lean = gd.getNextBoolean(); // By Claude on 07/05/2026
this.pose_full = gd.getNextBoolean(); // By Claude on 07/04/2026
......@@ -336,7 +332,6 @@ public class CuasRtParameters {
properties.setProperty(prefix+"pose_str", this.pose_str+""); // double // By Claude on 07/03/2026
properties.setProperty(prefix+"pose_dxy_k", this.pose_dxy_k+""); // double // By Claude on 07/04/2026
properties.setProperty(prefix+"pose_num_tiles", this.pose_num_tiles+""); // int // By Claude on 07/04/2026
properties.setProperty(prefix+"pose_recalc", this.pose_recalc+""); // boolean // By Claude on 07/04/2026
properties.setProperty(prefix+"pose_raw", this.pose_raw+""); // boolean // By Claude on 07/05/2026
properties.setProperty(prefix+"pose_lean", this.pose_lean+""); // boolean // By Claude on 07/05/2026
properties.setProperty(prefix+"pose_full", this.pose_full+""); // boolean // By Claude on 07/04/2026
......@@ -420,7 +415,6 @@ public class CuasRtParameters {
if (properties.getProperty(prefix+"pose_str")!=null) this.pose_str=Double.parseDouble(properties.getProperty(prefix+"pose_str")); // By Claude on 07/03/2026
if (properties.getProperty(prefix+"pose_dxy_k")!=null) this.pose_dxy_k=Double.parseDouble(properties.getProperty(prefix+"pose_dxy_k")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"pose_num_tiles")!=null) this.pose_num_tiles=Integer.parseInt(properties.getProperty(prefix+"pose_num_tiles")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"pose_recalc")!=null) this.pose_recalc=Boolean.parseBoolean(properties.getProperty(prefix+"pose_recalc")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"pose_raw")!=null) this.pose_raw=Boolean.parseBoolean(properties.getProperty(prefix+"pose_raw")); // By Claude on 07/05/2026
if (properties.getProperty(prefix+"pose_lean")!=null) this.pose_lean=Boolean.parseBoolean(properties.getProperty(prefix+"pose_lean")); // By Claude on 07/05/2026
if (properties.getProperty(prefix+"pose_full")!=null) this.pose_full=Boolean.parseBoolean(properties.getProperty(prefix+"pose_full")); // By Claude on 07/04/2026
......@@ -507,7 +501,6 @@ public class CuasRtParameters {
cp.pose_str = this.pose_str;
cp.pose_dxy_k = this.pose_dxy_k;
cp.pose_num_tiles = this.pose_num_tiles;
cp.pose_recalc = this.pose_recalc;
cp.pose_raw = this.pose_raw;
cp.pose_lean = this.pose_lean;
cp.pose_full = this.pose_full; // By Claude on 07/04/2026
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment