Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions storm_analysis/sa_library/dao_fit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,17 +1265,12 @@ fitData* daoInitialize(double *rqe, double *scmos_calibration, double tol, int i
mFitInitializeROIIndexing(fit_data, roi_size);

/*
* I thought that even/odd might need different offsets, but based on some testing
* it looks like the optimal offset is pretty similar / the same for both.
* I thought that even/odd ROI sizes might need different offsets, but based
* on some testing it looks like the optimal offset is pretty similar / the
* same for both, so roi_size%2 is deliberately not consulted here.
*/
if((roi_size%2)==0){
fit_data->xoff = 0.5*((double)roi_size) - 1.0;
fit_data->yoff = 0.5*((double)roi_size) - 1.0;
}
else{
fit_data->xoff = 0.5*((double)roi_size) - 1.0;
fit_data->yoff = 0.5*((double)roi_size) - 1.0;
}
fit_data->xoff = 0.5*((double)roi_size) - 1.0;
fit_data->yoff = 0.5*((double)roi_size) - 1.0;

fit_data->fit_model = (daoFit *)malloc(sizeof(daoFit));
dao_fit = (daoFit *)fit_data->fit_model;
Expand Down
2 changes: 0 additions & 2 deletions storm_analysis/sa_library/dao_fit_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ def loadDaoFitC():
ctypes.c_double,
ctypes.c_double]

daofit.daoInitializeZ.argtypes = [ctypes.c_void_p]

daofit.daoInitializeZ.argtypes = [ctypes.c_void_p,
ndpointer(dtype=numpy.float64),
ndpointer(dtype=numpy.float64),
Expand Down
4 changes: 2 additions & 2 deletions storm_analysis/sa_library/multi_fit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,12 +1929,12 @@ void mFitUpdate(peakData *peak)
double dx,dy;

dx = peak->params[XCENTER] - peak->xi;
if((dx<-0.5)||(dx>1.5)){
if((dx<(0.5-HYSTERESIS))||(dx>(0.5+HYSTERESIS))){
peak->xi = (int)floor(peak->params[XCENTER]);
}

dy = peak->params[YCENTER] - peak->yi;
if((dy<-0.5)||(dy>1.5)){
if((dy<(0.5-HYSTERESIS))||(dy>(0.5+HYSTERESIS))){
peak->yi = (int)floor(peak->params[YCENTER]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions storm_analysis/sa_library/multi_fit.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define CONVERGED 1
#define ERROR 2

#define HYSTERESIS 0.6 /* In order to move the AOI or change it's size,
#define HYSTERESIS 1.0 /* In order to move the AOI or change it's size,
the new value must differ from the old value
by at least this much (<= 0.5 is no hysteresis). */

Expand Down Expand Up @@ -171,7 +171,6 @@ void mFitGetResidual(fitData *, double *);
int mFitGetUnconverged(fitData *);
fitData *mFitInitialize(double *, double *, double, int, int);
void mFitInitializeROIIndexing(fitData *, int);
void mFitIterateOriginal(fitData *);
void mFitIterateLM(fitData *);
void mFitNewBackground(fitData *, double *);
void mFitNewImage(fitData *, double *);
Expand All @@ -181,6 +180,7 @@ double mFitPeakFgSum(fitData *, peakData *);
double mFitPeakSum(fitData *, peakData *);
void mFitRecenterPeaks(fitData *);
void mFitRemoveErrorPeaks(fitData *);
void mFitRemoveRunningPeaks(fitData *);
void mFitResetPeak(fitData *, int);
void mFitSetPeakStatus(fitData *, int32_t *);
int mFitSolve(double *, double *, int);
Expand Down
8 changes: 5 additions & 3 deletions storm_analysis/spliner/cubic_spline.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ double dxfAt3D(splineData *spline_data, int zc, int yc, int xc)
{
double yv;

xc = rangeCheckI("dxfAt3D,xc", xc, 0, spline_data->xsize);
yc = rangeCheckI("dxfAt3D,yc", yc, 0, spline_data->ysize);
zc = rangeCheckI("dxfAt3D,zc", zc, 0, spline_data->zsize);
if(RANGECHECK){
xc = rangeCheckI("dxfAt3D,xc", xc, 0, spline_data->xsize);
yc = rangeCheckI("dxfAt3D,yc", yc, 0, spline_data->ysize);
zc = rangeCheckI("dxfAt3D,zc", zc, 0, spline_data->zsize);
}

yv = dot(&(spline_data->aij[(xc*(spline_data->ysize*spline_data->zsize)+yc*spline_data->zsize+zc)*64]), spline_data->delta_dxf, 64);

Expand Down
Loading