Commit b056e1a5 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: remove cuas_calc_fpn/cuas_calc_rowcol - file existence is THE recalc trigger

Delete-the-file rule (Andrey): FPN and row/col noise recalculate ONLY
when <center>-FPN.tiff / <center>-ROWCOL.tiff are missing in the model
directory. The two force-recalc checkboxes are removed from the dialog
and the config (stale _cuas_calc_* keys in old corr-xml are ignored on
load). Reuse printlns name the exact file to delete; the dialog shows
addMessage() notes in place of the removed checkboxes.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 3cc0997b
......@@ -86,7 +86,7 @@ public class CorrectionFPN {
int cuas_invert_iters = clt_parameters.imp.cuas_invert_iters; // 4 Enhance inversion iterations
double cuas_invert_tolerance = clt_parameters.imp.cuas_invert_tolerance;// 0.001 Finish enhancing when last change was lower than
int cuas_invert_gap2 = clt_parameters.imp.cuas_invert_gap2; // 10 Maximal dual gap size for inversion (depends on scanning radius in tiles)
boolean cuas_calc_fpn = clt_parameters.imp.cuas_calc_fpn;
// cuas_calc_fpn removed 2026-07-07 (delete-the-file rule): FPN recalculates only when <center>-FPN.tiff is missing. // By Claude on 07/07/2026
double cuas_rot_period = clt_parameters.imp.cuas_rot_period;
double cuas_um_sigma = clt_parameters.imp.cuas_um_sigma; // Apply Unsharp Mask filter sigma when calculating row/column noise
double cuas_max_abs_rowcol = clt_parameters.imp.cuas_max_abs_rowcol; // consider pixels with abs(UM difference) does not exceed this value
......@@ -138,12 +138,12 @@ 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
if (fpn != null) { // file-gated reuse (Andrey 07/06/2026, the ONLY force method 07/07): 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 (fpn == null) {
if (debugLevel >-3) {
System.out.println("Calculating FPN.");
}
......@@ -391,19 +391,17 @@ public class CorrectionFPN {
boolean show_fpn = cuas_debug && !clt_parameters.batch_run; //
if (cuas_subtract_rowcol) {
int fpn_width = center_CLT.getTilesX() * center_CLT.getTileSize(); // see if center_CLT can be used
boolean cuas_calc_rowcol= clt_parameters.imp.cuas_calc_rowcol; // Recalculate+save row/column noise, if false - try to read saved one first
// cuas_calc_rowcol removed 2026-07-07 (delete-the-file rule): saved row/col noise is always tried first; erasing <center>-ROWCOL.tiff is THE way to force recalculation. // By Claude on 07/07/2026
double cuas_um_sigma = clt_parameters.imp.cuas_um_sigma; // Apply Unsharp Mask filter sigma when calculating row/column noise
double cuas_max_abs_rowcol= clt_parameters.imp.cuas_max_abs_rowcol; // consider pixels with abs(UM difference) does not exceed this value
double cuas_outliers_rowcol=clt_parameters.imp.cuas_outliers_rowcol;// scale weight of the outliers with high difference (to prevent undefined values
/// read/calculate Row/Column noise correction
double cuas_max_abs_rowcol= clt_parameters.imp.cuas_max_abs_rowcol; // consider pixels with abs(UM difference) does not exceed this value
double cuas_outliers_rowcol=clt_parameters.imp.cuas_outliers_rowcol;// scale weight of the outliers with high difference (to prevent undefined values
/// read/calculate Row/Column noise correction
boolean is_new = false;
double [][][][] row_col = null;
if (!cuas_calc_rowcol) {
if (debugLevel >-3) {
System.out.println("Reading row/column noise per-scene data.");
}
row_col = center_CLT.getCorrectionFPN().readImageRowCol();
if (show_fpn && (row_col != null)) {
double [][][][] row_col = center_CLT.getCorrectionFPN().readImageRowCol();
if (row_col != null) {
System.out.println("RowCol: reusing saved "+center_CLT.getImageName()+QuadCLT.CENTER_ROWCOL_SUFFIX+
".tiff - delete it (model dir) to recalculate the row/column noise"); // By Claude on 07/07/2026 (delete-the-file rule)
if (show_fpn) {
center_CLT.getCorrectionFPN().saveShowRowCol(
row_col[0], // final double [][][] rows, // [scene][sensor][width]
row_col[1], // final double [][][] cols, // [scene][sensor][height]
......
......@@ -755,12 +755,12 @@ min_str_neib_fpn 0.35
public boolean cuas_step = true; // recalculate template image after each fitting step
public boolean cuas_subtract_fpn= true; // Subtract FPN
public boolean cuas_calc_fpn = false; // Recalculate+save FPN unconditionally, if false - try to read saved one first
// cuas_calc_fpn REMOVED 2026-07-07 (delete-the-file rule, Andrey): FPN recalculates only when <center>-FPN.tiff is missing - delete it (model dir) to force. // By Claude on 07/07/2026
public double cuas_rot_period = 175.0; // rotation period of te gimbal mount (in scenes)
public int cuas_fpn_iters = 1; // FPN back-propagation iterations: >1 rebuilds the center in memory from FPN-corrected scenes and adds the residual (removes the content ghost) // By Claude on 07/06/2026
public double cuas_min_series = 180.0; // discard shorter series // FIXME: allow shorter, but modify FPN/row_col to copy parent's files if less than cuas_rot_period
public boolean cuas_subtract_rowcol= true; // Subtract row/column noise
public boolean cuas_calc_rowcol= false; // Recalculate+save row/column noise, if false - try to read saved one first
// cuas_calc_rowcol REMOVED 2026-07-07 (delete-the-file rule, Andrey): row/col noise recalculates only when <center>-ROWCOL.tiff is missing - delete it (model dir) to force. // By Claude on 07/07/2026
public boolean cuas_backprop_rowcol= true; // exclude content when calculating row/col noise: subtract the back-projected (pose-transformed, photometric-matched) virtual center from each scene before the line averaging - fixes bright content biasing the averages (dark horizontal/vertical lines at bright spots). Slower (one GPU back-projection per scene) - non-RT path only (roadmap RT step 2b, Andrey 07/07/2026). // By Claude on 07/07/2026
public double cuas_um_sigma = 10.0; // Apply Unsharp Mask filter sigma when calculating row/column noise
public double cuas_max_abs_rowcol = 50.0; // consider pixels with abs(UM difference) does not exceed this value
......@@ -2681,8 +2681,7 @@ min_str_neib_fpn 0.35
gd.addMessage("=== Subtract FPN ===");
gd.addCheckbox ("Subtract FPN", this.cuas_subtract_fpn,
"Subtract FPN from the channel images.");
gd.addCheckbox ("(Re)calculate FPN", this.cuas_calc_fpn,
"Recalculate+save FPN unconditionally, if false - try to read saved one.");
gd.addMessage("FPN is reused from the saved <center>-FPN.tiff - DELETE that file in the model directory to recalculate (verify \"Rotation period\" matches the true period first)."); // By Claude on 07/07/2026 (delete-the-file rule)
gd.addNumericField("Rotation period", this.cuas_rot_period, 5,7,"scene periods",
"Used for averaging FPN for integer number of rotation periods. TODO: calculate from the actual rotation.");
gd.addNumericField("FPN back-propagation iterations", this.cuas_fpn_iters, 0,3,"", // By Claude on 07/06/2026
......@@ -2693,8 +2692,7 @@ min_str_neib_fpn 0.35
gd.addMessage("=== Row/column noise (on top of the FPN) ===");
gd.addCheckbox ("Subtract row/column noise", this.cuas_subtract_rowcol,
"Subtract per-scene row/column noise (on top of the per scene sequence FPN).");
gd.addCheckbox ("(Re)calculate row/column noise", this.cuas_calc_rowcol,
"Recalculate per-scene row column noise even if it exists. If false, try to read first.");
gd.addMessage("Row/column noise is reused from the saved <center>-ROWCOL.tiff - DELETE that file in the model directory to recalculate."); // By Claude on 07/07/2026 (delete-the-file rule)
gd.addCheckbox ("Exclude content (back-project center)", this.cuas_backprop_rowcol, // By Claude on 07/07/2026
"When calculating row/column noise, subtract the back-projected (pose-transformed, photometric-matched) virtual center from each scene before the line averaging - "+
"prevents bright content from biasing the averages (dark row/col lines at bright spots). Slower: one GPU back-projection per scene.");
......@@ -4461,13 +4459,13 @@ min_str_neib_fpn 0.35
this.cuas_keep_fraction = gd.getNextNumber();
this.cuas_step = gd.getNextBoolean();
this.cuas_subtract_fpn = gd.getNextBoolean();
this.cuas_calc_fpn = gd.getNextBoolean();
// cuas_calc_fpn getNext removed 2026-07-07 (delete-the-file rule). // By Claude on 07/07/2026
this.cuas_rot_period = gd.getNextNumber();
this.cuas_fpn_iters = (int) gd.getNextNumber(); // By Claude on 07/06/2026
this.cuas_min_series = gd.getNextNumber();
this.cuas_subtract_rowcol = gd.getNextBoolean();
this.cuas_calc_rowcol = gd.getNextBoolean();
// cuas_calc_rowcol getNext removed 2026-07-07 (delete-the-file rule). // By Claude on 07/07/2026
this.cuas_backprop_rowcol = gd.getNextBoolean(); // By Claude on 07/07/2026
this.cuas_um_sigma = gd.getNextNumber();
this.cuas_max_abs_rowcol = gd.getNextNumber();
......@@ -5797,13 +5795,11 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_step", this.cuas_step+""); // boolean
properties.setProperty(prefix+"cuas_subtract_fpn", this.cuas_subtract_fpn+""); // boolean
properties.setProperty(prefix+"cuas_calc_fpn", this.cuas_calc_fpn+""); // boolean
properties.setProperty(prefix+"cuas_rot_period", this.cuas_rot_period+""); // double
properties.setProperty(prefix+"cuas_fpn_iters", this.cuas_fpn_iters+""); // int // By Claude on 07/06/2026
properties.setProperty(prefix+"cuas_min_series", this.cuas_min_series+""); // double
properties.setProperty(prefix+"cuas_subtract_rowcol", this.cuas_subtract_rowcol+"");// boolean
properties.setProperty(prefix+"cuas_calc_rowcol", this.cuas_calc_rowcol+""); // boolean
properties.setProperty(prefix+"cuas_backprop_rowcol",this.cuas_backprop_rowcol+"");// boolean // By Claude on 07/07/2026
properties.setProperty(prefix+"cuas_um_sigma", this.cuas_um_sigma+""); // double
properties.setProperty(prefix+"cuas_max_abs_rowcol", this.cuas_max_abs_rowcol+""); // double
......@@ -7071,13 +7067,11 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_keep_fraction")!=null) this.cuas_keep_fraction=Double.parseDouble(properties.getProperty(prefix+"cuas_keep_fraction"));
if (properties.getProperty(prefix+"cuas_step")!=null) this.cuas_step=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_step"));
if (properties.getProperty(prefix+"cuas_subtract_fpn")!=null) this.cuas_subtract_fpn=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_subtract_fpn"));
if (properties.getProperty(prefix+"cuas_calc_fpn")!=null) this.cuas_calc_fpn=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_calc_fpn"));
if (properties.getProperty(prefix+"cuas_rot_period")!=null) this.cuas_rot_period=Double.parseDouble(properties.getProperty(prefix+"cuas_rot_period"));
if (properties.getProperty(prefix+"cuas_fpn_iters")!=null) this.cuas_fpn_iters=Integer.parseInt(properties.getProperty(prefix+"cuas_fpn_iters")); // By Claude on 07/06/2026
if (properties.getProperty(prefix+"cuas_min_series")!=null) this.cuas_min_series=Double.parseDouble(properties.getProperty(prefix+"cuas_min_series"));
if (properties.getProperty(prefix+"cuas_subtract_rowcol")!=null) this.cuas_subtract_rowcol=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_subtract_rowcol"));
if (properties.getProperty(prefix+"cuas_calc_rowcol")!=null) this.cuas_calc_rowcol=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_calc_rowcol"));
if (properties.getProperty(prefix+"cuas_backprop_rowcol")!=null) this.cuas_backprop_rowcol=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_backprop_rowcol")); // By Claude on 07/07/2026
if (properties.getProperty(prefix+"cuas_um_sigma")!=null) this.cuas_um_sigma=Double.parseDouble(properties.getProperty(prefix+"cuas_um_sigma"));
if (properties.getProperty(prefix+"cuas_max_abs_rowcol")!=null) this.cuas_max_abs_rowcol=Double.parseDouble(properties.getProperty(prefix+"cuas_max_abs_rowcol"));
......@@ -8365,13 +8359,11 @@ min_str_neib_fpn 0.35
imp.cuas_keep_fraction = this.cuas_keep_fraction;
imp.cuas_step = this.cuas_step;
imp.cuas_subtract_fpn = this.cuas_subtract_fpn;
imp.cuas_calc_fpn = this.cuas_calc_fpn;
imp.cuas_rot_period = this.cuas_rot_period;
imp.cuas_fpn_iters = this.cuas_fpn_iters; // By Claude on 07/06/2026
imp.cuas_min_series = this.cuas_min_series;
imp.cuas_subtract_rowcol = this.cuas_subtract_rowcol;
imp.cuas_calc_rowcol = this.cuas_calc_rowcol;
imp.cuas_backprop_rowcol = this.cuas_backprop_rowcol; // By Claude on 07/07/2026
imp.cuas_um_sigma = this.cuas_um_sigma;
imp.cuas_max_abs_rowcol = this.cuas_max_abs_rowcol;
......
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