Changeset 568 for sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GeneticOptimization/NCNR_GenFitUtils.ipf
- Timestamp:
- Oct 9, 2009 12:52:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GeneticOptimization/NCNR_GenFitUtils.ipf
r499 r568 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 3 // genetic optimization, uses XOP supplied by Andy Nelson, ANSTO 4 // http://www.igorexchange.com/project/gencurvefit 5 2 6 3 7 … … 14 18 // X add a check to make sure that the XOP is installed before the switch is set (force 0 if not present) 15 19 // X add a global variable as a switch 16 // - parse the limits. All must be filled in. Currently unfilled slots are val/10 < val < 10*val, bad choice17 // if coef is zero, or too far from the true value20 // X parse the limits. All must be filled in. If not, fit aborts and asks for user input to fill them in. Limits 21 // on fixed parameters are +/- 1% of the value. Has no effect on fit (duh), but filled in for completeness. 18 22 // X create a mask wave for use when cursors are selected. [a,b] subranges can't be used w/Andy's XOP 19 23 // X fitYw not behaving correctly - probably need to hand-trim … … 25 29 // X odd bug where first "fit" fails on AppendToGraph as GenCurveFit is started. May need to disable /D flag 26 30 // 31 // -- need to pass back the chi-squared and number of points. "V_" globals don't appear 27 32 // 28 33 // for the speed test. try writing my own wrapper for an unsmeared calculation, and see if it's still dog-slow. … … 176 181 //need to parse limits, or make up some defaults 177 182 // limits is (n,2) 178 Variable nPnts = numpnts(fs.coefW),i,multip=1 0,isUSANS=0,tol=0.01183 Variable nPnts = numpnts(fs.coefW),i,multip=1.01,isUSANS=0,tol=0.01 179 184 Make/O/D/N=(nPnts,2) limits 180 185 Wave limits=limits 181 186 for (i=0; i < nPnts; i += 1) 187 182 188 if (strlen(lolim[i]) > 0) 183 189 limits[i][0] = str2num(lolim[i]) 184 else 185 limits[i][0] = fs.coefW[i]/multip 186 endif 190 else 191 if(cmpstr(holdStr[i],"0")==0) //no limit, not held 192 Abort "You must enter low and high coefficient limits for all free parameters" 193 else 194 limits[i][0] = fs.coefW[i]/multip //fixed parameter, just stick something in 195 endif 196 endif 197 187 198 if (strlen(hilim[i]) > 0) 188 199 limits[i][1] = str2num(hilim[i]) 189 else 190 limits[i][1] = fs.coefW[i] * multip 200 else 201 if(cmpstr(holdStr[i],"0")==0) //no limit, not held 202 Abort "You must enter low and high coefficient limits for all free parameters" 203 else 204 limits[i][1] = fs.coefW[i] * multip 205 endif 191 206 endif 192 207 endfor
Note: See TracChangeset
for help on using the changeset viewer.