Skip to content

Commit 1fa33a7

Browse files
committed
Add pentafoil/hexafoil distortion (p11-p14), fix spline sign bug, restore
cardinal-angle resampling, and add calibration diagnostics. Five major changes in this commit: 1. PENTAFOIL/HEXAFOIL DISTORTION (p11-p14) Fourier analysis of calibrant residuals showed k=5 (pentafoil) as the dominant unmodeled harmonic at 5.6 µε. Added cos(5η)·R^5 (p11,p12) and cos(6η)·R^6 (p13,p14) to the distortion model. nBase increases from 16 to 20 in the optimizer; all 19 downstream files updated. New --fit-p-models keywords: pentafoil5, hexafoil6. Fix: CalibrantIntegratorOMP eg0 initializer was missing .p7-.p10 (evaluate-only mode used zeroed dipole/trefoil params). 2. SPLINE RESIDUAL CORRECTION SIGN FIX The spline stored deltaR = RadFit - IdealR and applied Rt += deltaR, amplifying errors instead of correcting them (correlation +0.53 with residuals). Fixed by negating: delta_r_px = -delta_r / px. Result: Stage 2 analytical = 6.0 µε → Stage 4 with spline = 4.5 µε (25% improvement, previously regressed to 8.4 µε). 3. CARDINAL-ANGLE RADIAL RESAMPLING FOR CALIBRANT IntegrationCore.c used nearest-neighbor pixel lookup, ignoring the bilinear interpolation + radial gradient correction implemented in IntegratorZarrOMP. Replaced with matching bilinear + optional GradientCorrection=1 radial resampling. Reduces cardinal-angle aliasing at sub-pixel R-bin widths (0.25 px). New CLI flag: --gradient-correction (default 1). 4. INTEGRATOR VALIDATION FIXES - Panel parameters (NPanelsY/Z, PanelShiftsFile) were not passed to DetectorMapper in run_integrator_validation, losing all per-panel corrections. Fixed. - Added DeltaR (µm) and DeltaA (Å) columns to both calibrant and integrator corr.csv output. 5. CALIBRATION DIAGNOSTICS - Stage 1/2/3/4 corr.csv files saved with stage suffixes. - Full-detector distortion map PNGs (200×200 vectorized numpy grid) generated at each stage, showing analytical + panel + spline ΔR. - Spline-only map PNG showing residual correction. - Panel corrections (dY, dZ, dTheta, dLsd, dP2) included in maps. - Mask-aware: gap pixels rendered as white. - Stage 4: evaluate-only (nIterations=0) with/without spline for diagnostic A/B comparison. - plot_calibrant_results.py viewer updated: DeltaR/DeltaA columns, dynamic column detection for backward compatibility. Files changed: 21 (781 insertions, 139 deletions) C core: DetectorGeometry, CalibrationCore, CalibrantIntegratorOMP, CalibrantEstep, MIDAS_ParamParser, MapperCore, DetectorMapper, IntegrationCore (previous commit) C fitting: FitSetupParamsAllZarr, FitMultipleGrains, FitWedgeParallel, PeaksFittingOMPZarrRefactor, ForwardSimulationCompressed Python: AutoCalibrateZarr, ffGenerateZipRefactor GUI: plot_calibrant_results.py Tests: test_calibration_integration.py Tested on CeO2 Varex 2880×2880 (63keV, 900mm) and CeO2 Pilatus 1475×1679 (72keV, 650mm). Varex: 6.0 µε analytical → 4.5 µε with spline. Pilatus: 38 µε → panel corrections reduce integrator to 20 µε range.
1 parent 2613e69 commit 1fa33a7

21 files changed

Lines changed: 781 additions & 139 deletions

FF_HEDM/Example/Calibration/runAllCalibrations.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Varex with bad distortion
2-
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_10s_1000mm_42keV_000718.tiff --n-iterations 5 --px 150.0 --wavelength 0.29519 --material ceo2 --im-trans 1 --cpus 8
2+
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_10s_1000mm_42keV_000718.tiff --n-iterations 5 --px 150.0 --wavelength 0.29519 --material ceo2 --im-trans 1 --cpus 8 --fit-p-models all
33

44
# Varex with low distortion
5-
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data Ceria_63keV_900mm_100x100_0p5s_aero_0_001137.tif --n-iterations 5 --px 150.0 --wavelength 0.196793 --material ceo2 --im-trans 2 --cpus 8
5+
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data Ceria_63keV_900mm_100x100_0p5s_aero_0_001137.tif --n-iterations 5 --px 150.0 --wavelength 0.196793 --material ceo2 --im-trans 2 --cpus 8 --fit-p-models all
66

77
# Pilatus with panel shifts and auto masking
88
# Delete older panel shifts file and mask file to initialize from scratch
99
rm *panel* *autocal_mask*
10-
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_Pil_100x100_att000_650mm_71p676keV_001956.tif --dark dark_CeO2_Pil_100x100_att000_650mm_71p676keV_001975.tif --px 172.0 --wavelength 0.172979 --material ceo2 --im-trans 2 --n-iterations 5 --cpus 8
10+
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_Pil_100x100_att000_650mm_71p676keV_001956.tif --dark dark_CeO2_Pil_100x100_att000_650mm_71p676keV_001975.tif --px 172.0 --wavelength 0.172979 --material ceo2 --im-trans 2 --n-iterations 5 --cpus 8 --fit-p-models all
1111

1212
# offset GE
13-
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_1s_65pt351keV_1860mm_000007.edf.ge1 --dark dark_6s_000010.ge1 --px 200.0 --wavelength 0.189714 --material ceo2 --n-iterations 5 --cpus 8
13+
python ~/opt/MIDAS/utils/AutoCalibrateZarr.py --data CeO2_1s_65pt351keV_1860mm_000007.edf.ge1 --dark dark_6s_000010.ge1 --px 200.0 --wavelength 0.189714 --material ceo2 --n-iterations 5 --cpus 8 --fit-p-models all
1414

1515

1616
# cleanup at the end

FF_HEDM/src/CalibrantEstep.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
typedef struct {
2121
double Lsd, ybc, zbc, tx, ty, tz;
2222
double p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10;
23+
double p11, p12, p13, p14;
2324
double px, MaxRingRad, parallax;
2425
double EtaBinSize;
2526
int RBinWidth;

FF_HEDM/src/CalibrantIntegratorOMP.c

Lines changed: 63 additions & 18 deletions
Large diffs are not rendered by default.

FF_HEDM/src/CalibrationCore.c

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void calib_set_trace_file(const char *filename) {
2929
if (calib_trace_fp) {
3030
fprintf(calib_trace_fp,
3131
"Eval,Objective,MeanStrain_ue,Lsd,ybc,zbc,ty,tz,"
32-
"p0,p1,p2,p3,p4,p5,p6\n");
32+
"p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14\n");
3333
fflush(calib_trace_fp);
3434
}
3535
}
@@ -377,9 +377,10 @@ double calib_problem_function(unsigned n, const double *x, double *grad,
377377
double p0 = x[5], p1 = x[6], p2 = x[7], p3 = x[8];
378378
double p4 = x[9], p5 = x[10], p6 = x[11];
379379
double p7 = x[12], p8 = x[13], p9 = x[14], p10 = x[15];
380+
double p11 = x[16], p12 = x[17], p13 = x[18], p14 = x[19];
380381
double parallax = 0;
381382
if (f->fitParallax)
382-
parallax = x[16];
383+
parallax = x[20];
383384
double wavelength = 0;
384385
if (f->fitWavelength)
385386
wavelength = x[f->nBase - 1];
@@ -443,7 +444,7 @@ double calib_problem_function(unsigned n, const double *x, double *grad,
443444
// and it internally computes Y_phys = (-rawY + ybc) * px
444445
double R_px, Eta;
445446
dg_pixel_to_REta_corr(rawY, rawZ, ybc, zbc, TRs, Lsd, MaxRad,
446-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
447+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
447448
f->residualCorr, &R_px, &Eta, NULL);
448449

449450
// Ideal R in pixels: Lsd * tan(2θ) / px
@@ -500,10 +501,11 @@ double calib_problem_function(unsigned n, const double *x, double *grad,
500501
: 0.0;
501502
fprintf(calib_trace_fp,
502503
"%lld,%.10e,%.6f,%.6f,%.6f,%.6f,%.8f,%.8f,"
503-
"%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e\n",
504+
"%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,%.8e,"
505+
"%.8e,%.8e,%.8e,%.8e\n",
504506
ctx->NrCalls, TotalDiff, meanStrain_ue,
505507
Lsd, ybc, zbc, ty, tz,
506-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
508+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);
507509
fflush(calib_trace_fp);
508510
}
509511

@@ -533,6 +535,10 @@ int calib_fit_tilt_bc_lsd(
533535
double p8in, double tolP8, double *p8Out,
534536
double p9in, double tolP9, double *p9Out,
535537
double p10in, double tolP10, double *p10Out,
538+
double p11in, double tolP11, double *p11Out,
539+
double p12in, double tolP12, double *p12Out,
540+
double p13in, double tolP13, double *p13Out,
541+
double p14in, double tolP14, double *p14Out,
536542
int verbose, int L2Objective, double *initParams,
537543
Panel *initPanels, int fitWavelength, double wavelengthIn,
538544
double tolWavelength, double *PointDSpacing,
@@ -544,7 +550,7 @@ int calib_fit_tilt_bc_lsd(
544550
const DGResidualCorr *residualCorr) {
545551

546552
int fitParallax = (tolParallax > EPS) ? 1 : 0;
547-
int nBase = 16; // Lsd, ybc, zbc, ty, tz, p0-p3, p4, p5, p6, p7, p8, p9, p10
553+
int nBase = 20; // Lsd, ybc, zbc, ty, tz, p0-p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14
548554
if (fitParallax) nBase++;
549555
if (fitWavelength) nBase++;
550556
unsigned n = nBase;
@@ -600,6 +606,10 @@ int calib_fit_tilt_bc_lsd(
600606
double bp8 = (initParams ? initParams[13] : p8in);
601607
double bp9 = (initParams ? initParams[14] : p9in);
602608
double bp10 = (initParams ? initParams[15] : p10in);
609+
double bp11 = (initParams ? initParams[16] : p11in);
610+
double bp12 = (initParams ? initParams[17] : p12in);
611+
double bp13 = (initParams ? initParams[18] : p13in);
612+
double bp14 = (initParams ? initParams[19] : p14in);
603613

604614
x[0] = Lsd; xl[0] = bLsd - tolLsd; xu[0] = bLsd + tolLsd;
605615
x[1] = ybc; xl[1] = bybc - tolBC; xu[1] = bybc + tolBC;
@@ -617,12 +627,16 @@ int calib_fit_tilt_bc_lsd(
617627
x[13] = p8in; xl[13] = bp8 - tolP8; xu[13] = bp8 + tolP8;
618628
x[14] = p9in; xl[14] = bp9 - tolP9; xu[14] = bp9 + tolP9;
619629
x[15] = p10in; xl[15] = bp10 - tolP10; xu[15] = bp10 + tolP10;
630+
x[16] = p11in; xl[16] = bp11 - tolP11; xu[16] = bp11 + tolP11;
631+
x[17] = p12in; xl[17] = bp12 - tolP12; xu[17] = bp12 + tolP12;
632+
x[18] = p13in; xl[18] = bp13 - tolP13; xu[18] = bp13 + tolP13;
633+
x[19] = p14in; xl[19] = bp14 - tolP14; xu[19] = bp14 + tolP14;
620634

621635
if (fitParallax) {
622-
double bpar = (initParams ? initParams[16] : parallaxIn);
623-
x[16] = parallaxIn;
624-
xl[16] = bpar - tolParallax;
625-
xu[16] = bpar + tolParallax;
636+
double bpar = (initParams ? initParams[20] : parallaxIn);
637+
x[nBase] = parallaxIn;
638+
xl[nBase] = bpar - tolParallax;
639+
xu[nBase] = bpar + tolParallax;
626640
}
627641
if (fitWavelength) {
628642
int wlIdx = nBase - 1;
@@ -752,7 +766,11 @@ int calib_fit_tilt_bc_lsd(
752766
if (p8Out) *p8Out = x[13];
753767
if (p9Out) *p9Out = x[14];
754768
if (p10Out) *p10Out = x[15];
755-
if (fitParallax && parallaxOut) *parallaxOut = x[16];
769+
if (p11Out) *p11Out = x[16];
770+
if (p12Out) *p12Out = x[17];
771+
if (p13Out) *p13Out = x[18];
772+
if (p14Out) *p14Out = x[19];
773+
if (fitParallax && parallaxOut) *parallaxOut = x[nBase];
756774
if (fitWavelength && wavelengthOut) *wavelengthOut = x[nBase - 1];
757775

758776
// Update panel shifts
@@ -826,6 +844,8 @@ int calib_fit_tilt_bc_lsd(
826844
(p6Out ? *p6Out : p6in),
827845
(p7Out ? *p7Out : p7in), (p8Out ? *p8Out : p8in),
828846
(p9Out ? *p9Out : p9in), (p10Out ? *p10Out : p10in),
847+
(p11Out ? *p11Out : p11in), (p12Out ? *p12Out : p12in),
848+
(p13Out ? *p13Out : p13in), (p14Out ? *p14Out : p14in),
829849
px, dLsd, dP2,
830850
(fitParallax && parallaxOut) ? *parallaxOut : 0,
831851
residualCorr, &R_px, &Eta, NULL);
@@ -889,6 +909,7 @@ void calib_correct_tilt_distortion(
889909
double p3, double *Etas, double *Diffs, double *RadOuts,
890910
double *StdDiff, double outlierFactor, int *IsOutlier,
891911
double p4, double p5, double p6, double p7, double p8, double p9, double p10,
912+
double p11, double p12, double p13, double p14,
892913
int OutlierIterations,
893914
int verbose, double *MeanDiffOut, double parallax,
894915
const int *skipBin,
@@ -934,7 +955,7 @@ void calib_correct_tilt_distortion(
934955
// Canonical geometry via dg_pixel_to_REta_corr
935956
double R_px, Eta;
936957
dg_pixel_to_REta_corr(rawY, rawZ, ybc, zbc, TRs, Lsd, MaxRad,
937-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
958+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
938959
residualCorr, &R_px, &Eta, NULL);
939960

940961
double RIdeal_px = (Lsd + dLsd) * tan(DG_DEG2RAD * IdealTtheta[i]) / px;

FF_HEDM/src/CalibrationCore.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ int calib_fit_tilt_bc_lsd(
146146
double p8in, double tolP8, double *p8Out,
147147
double p9in, double tolP9, double *p9Out,
148148
double p10in, double tolP10, double *p10Out,
149+
double p11in, double tolP11, double *p11Out,
150+
double p12in, double tolP12, double *p12Out,
151+
double p13in, double tolP13, double *p13Out,
152+
double p14in, double tolP14, double *p14Out,
149153
int verbose, int L2Objective, double *initParams,
150154
Panel *initPanels, int fitWavelength, double wavelengthIn,
151155
double tolWavelength, double *PointDSpacing,
@@ -166,6 +170,7 @@ void calib_correct_tilt_distortion(
166170
double p3, double *Etas, double *Diffs, double *RadOuts,
167171
double *StdDiff, double outlierFactor, int *IsOutlier,
168172
double p4, double p5, double p6, double p7, double p8, double p9, double p10,
173+
double p11, double p12, double p13, double p14,
169174
int OutlierIterations,
170175
int verbose, double *MeanDiffOut, double parallax,
171176
const int *skipBin,

FF_HEDM/src/DetectorGeometry.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ void dg_pixel_to_REta(double Y, double Z, double Ycen, double Zcen,
8181
double TRs[3][3], double Lsd, double RhoD, double p0,
8282
double p1, double p2, double p3, double p4, double p5,
8383
double p6, double p7, double p8, double p9, double p10,
84+
double p11, double p12, double p13, double p14,
8485
double px, double dLsd, double dP2, double parallax,
8586
double *R_out, double *Eta_out,
8687
double *Eta_untilted_out) {
8788
dg_pixel_to_REta_corr(Y, Z, Ycen, Zcen, TRs, Lsd, RhoD,
8889
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
90+
p11, p12, p13, p14,
8991
px, dLsd, dP2, parallax, NULL,
9092
R_out, Eta_out, Eta_untilted_out);
9193
}
@@ -94,6 +96,7 @@ void dg_pixel_to_REta_corr(double Y, double Z, double Ycen, double Zcen,
9496
double TRs[3][3], double Lsd, double RhoD, double p0,
9597
double p1, double p2, double p3, double p4, double p5,
9698
double p6, double p7, double p8, double p9, double p10,
99+
double p11, double p12, double p13, double p14,
97100
double px, double dLsd, double dP2, double parallax,
98101
const DGResidualCorr *corr,
99102
double *R_out, double *Eta_out,
@@ -125,6 +128,8 @@ void dg_pixel_to_REta_corr(double Y, double Z, double Ycen, double Zcen,
125128
DistortFunc += p5 * pow(RNorm, 4.0);
126129
DistortFunc += p7 * pow(RNorm, 4.0) * cos(DG_DEG2RAD * (EtaT + p8));
127130
DistortFunc += p9 * pow(RNorm, 3.0) * cos(DG_DEG2RAD * (3 * EtaT + p10));
131+
DistortFunc += p11 * pow(RNorm, 5.0) * cos(DG_DEG2RAD * (5 * EtaT + p12));
132+
DistortFunc += p13 * pow(RNorm, 6.0) * cos(DG_DEG2RAD * (6 * EtaT + p14));
128133
DistortFunc += 1;
129134
double Rt = Rad * DistortFunc / px; // in pixels
130135
Rt = Rt * (Lsd / panelLsd); // re-project to global Lsd plane
@@ -157,10 +162,12 @@ void dg_invert_REta_to_pixel(
157162
double Lsd, double RhoD,
158163
double p0, double p1, double p2, double p3, double p4, double p5,
159164
double p6, double p7, double p8, double p9, double p10,
165+
double p11, double p12, double p13, double p14,
160166
double px, double dLsd, double dP2, double parallax,
161167
double *Y_out, double *Z_out) {
162168
dg_invert_REta_to_pixel_corr(R_target, Eta_target, Ycen, Zcen, TRs,
163169
Lsd, RhoD, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
170+
p11, p12, p13, p14,
164171
px, dLsd, dP2, parallax, NULL, Y_out, Z_out);
165172
}
166173

@@ -170,6 +177,7 @@ void dg_invert_REta_to_pixel_corr(
170177
double Lsd, double RhoD,
171178
double p0, double p1, double p2, double p3, double p4, double p5,
172179
double p6, double p7, double p8, double p9, double p10,
180+
double p11, double p12, double p13, double p14,
173181
double px, double dLsd, double dP2, double parallax,
174182
const DGResidualCorr *corr,
175183
double *Y_out, double *Z_out) {
@@ -187,7 +195,7 @@ void dg_invert_REta_to_pixel_corr(
187195
// Evaluate forward function at current (Y, Z)
188196
double R_eval, Eta_eval;
189197
dg_pixel_to_REta_corr(Y, Z, Ycen, Zcen, TRs, Lsd, RhoD,
190-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
198+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
191199
corr, &R_eval, &Eta_eval, NULL);
192200

193201
double dR = R_target - R_eval;
@@ -202,10 +210,10 @@ void dg_invert_REta_to_pixel_corr(
202210
// Numerical Jacobian: ∂(R,η)/∂(Y,Z)
203211
double R_dY, Eta_dY, R_dZ, Eta_dZ;
204212
dg_pixel_to_REta_corr(Y + h, Z, Ycen, Zcen, TRs, Lsd, RhoD,
205-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
213+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
206214
corr, &R_dY, &Eta_dY, NULL);
207215
dg_pixel_to_REta_corr(Y, Z + h, Ycen, Zcen, TRs, Lsd, RhoD,
208-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
216+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
209217
corr, &R_dZ, &Eta_dZ, NULL);
210218

211219
double dRdY = (R_dY - R_eval) / h;
@@ -249,11 +257,13 @@ void dg_invert_REta_to_pixel_panel(
249257
double Lsd, double RhoD,
250258
double p0, double p1, double p2, double p3, double p4, double p5,
251259
double p6, double p7, double p8, double p9, double p10,
260+
double p11, double p12, double p13, double p14,
252261
double px, double parallax,
253262
const Panel *panel,
254263
double *Y_out, double *Z_out) {
255264
dg_invert_REta_to_pixel_panel_corr(R_target, Eta_target, Ycen, Zcen, TRs,
256265
Lsd, RhoD, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
266+
p11, p12, p13, p14,
257267
px, parallax, NULL, panel, Y_out, Z_out);
258268
}
259269

@@ -263,6 +273,7 @@ void dg_invert_REta_to_pixel_panel_corr(
263273
double Lsd, double RhoD,
264274
double p0, double p1, double p2, double p3, double p4, double p5,
265275
double p6, double p7, double p8, double p9, double p10,
276+
double p11, double p12, double p13, double p14,
266277
double px, double parallax,
267278
const DGResidualCorr *corr,
268279
const Panel *panel,
@@ -271,6 +282,7 @@ void dg_invert_REta_to_pixel_panel_corr(
271282
if (panel == NULL) {
272283
dg_invert_REta_to_pixel_corr(R_target, Eta_target, Ycen, Zcen, TRs,
273284
Lsd, RhoD, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
285+
p11, p12, p13, p14,
274286
px, 0, 0, parallax, corr, Y_out, Z_out);
275287
return;
276288
}
@@ -291,7 +303,7 @@ void dg_invert_REta_to_pixel_panel_corr(
291303
// Forward: panel-corrected pixel → (R, Eta) with panel dLsd/dP2
292304
double R_eval, Eta_eval;
293305
dg_pixel_to_REta_corr(Y, Z, Ycen, Zcen, TRs, Lsd, RhoD,
294-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
306+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
295307
corr, &R_eval, &Eta_eval, NULL);
296308

297309
double dR = R_target - R_eval;
@@ -305,10 +317,10 @@ void dg_invert_REta_to_pixel_panel_corr(
305317
// Numerical Jacobian
306318
double R_dY, Eta_dY, R_dZ, Eta_dZ;
307319
dg_pixel_to_REta_corr(Y + h, Z, Ycen, Zcen, TRs, Lsd, RhoD,
308-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
320+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
309321
corr, &R_dY, &Eta_dY, NULL);
310322
dg_pixel_to_REta_corr(Y, Z + h, Ycen, Zcen, TRs, Lsd, RhoD,
311-
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, px, dLsd, dP2, parallax,
323+
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, px, dLsd, dP2, parallax,
312324
corr, &R_dZ, &Eta_dZ, NULL);
313325

314326
double dRdY = (R_dY - R_eval) / h;

0 commit comments

Comments
 (0)