- Timestamp:
- Sep 7, 2016 2:18:50 PM (7 years ago)
- Location:
- sans/Dev/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf
r1007 r1008 48 48 "Load Real Space Modeling",RealSpaceLoader() 49 49 "Event Mode Processing",EventModeLoader() 50 //"Load Batch Fitting - Beta",BatchFitLoader()51 //"Load Simulation Run Builder",SimSANSRunListLoader()52 //"Automated SANS Reduction - Beta",AutomateSANSLoader()50 "Load Batch Fitting - Beta",BatchFitLoader() 51 "Load Simulation Run Builder",SimSANSRunListLoader() 52 "Automated SANS Reduction - Beta",AutomateSANSLoader() 53 53 54 54 // "-" -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Lattice_Fills.ipf
r798 r1008 16 16 // 17 17 // 18 19 20 21 Macro PutXAxisCylindersAt3DPoints(w,num,rad,len,periodic,sobol,fill,centered) 22 String w="mat" 23 Variable num=100,rad=20,len=300,periodic=1,sobol=1,fill=10,centered=0 24 Prompt w,"matrix" 25 Prompt num,"number of starting points" 26 prompt rad,"radius of cylinders" 27 prompt len,"length of cylinders" 28 prompt periodic,"1=periodic, 0=non-periodic boundaries" 29 Prompt sobol,"1=Sobol, 0=random" 30 Prompt fill,"fill SLD value" 31 Prompt centered,"concentrate at center (0|1)" 32 33 34 // $w=0 35 // always start fresh 36 FFTEraseMatrixButtonProc("") 37 38 X_CylindersAt3DPoints($w,num,rad,len,sobol,periodic,fill,centered) 39 40 NumberOfPoints() 41 end 42 43 44 Function X_CylindersAt3DPoints(mat,num,rad,len,sobol,periodic,fill,centered) 45 Wave mat 46 variable num,rad,len //length in direction 47 Variable periodic //==1 if periodic boundaries 48 Variable sobol //==1 if sobol selection of points (2D) 49 Variable fill 50 Variable centered 51 52 NVAR solventSLD = root:FFT_SolventSLD 53 54 Variable np 55 np = DimSize(mat,0) // assumes that all dimensions are the same 56 57 if(centered) 58 Make/O/D/N=(np/2,np/2,np/2) small 59 if(sobol) 60 SobolFill3DMat(small,num,fill) 61 else 62 RandomFill3DMat(small,num,fill) 63 endif 64 ParseMatrix3D_rho(small) 65 killwaves small 66 67 Wave x3d=x3d 68 Wave y3d=y3d 69 Wave z3d=z3d 70 x3d += np/4 71 y3d += np/4 72 z3d += np/4 73 74 else 75 //use the full matrix 76 if(sobol) 77 SobolFill3DMat(mat,num,fill) 78 else 79 RandomFill3DMat(mat,num,fill) 80 endif 81 82 ParseMatrix3D_rho(mat) 83 Wave x3d=x3d 84 Wave y3d=y3d 85 Wave z3d=z3d 86 87 endif 88 89 90 Variable ii=0 91 NVAR grid=root:FFT_T 92 93 for(ii=0;ii<num;ii+=1) 94 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,fill) //cylinder 1 95 endfor 96 97 return(0) 98 End 99 -
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf
r950 r1008 738 738 //set the global to the path (as a string) 739 739 // need 4 \ since it is the escape character 740 if(cmpstr("\\\\",dum[0,1])==0) //Windoze user going through network neighborhood 741 DoAlert 0,alertStr 742 KillPath catPathName 743 return(1) 744 endif 740 741 // SRK 2016, for windows 10, try to eliminate this restriction 742 print igorinfo(3) 743 // if(cmpstr("\\\\",dum[0,1])==0) //Windoze user going through network neighborhood 744 // DoAlert 0,alertStr 745 // KillPath catPathName 746 // return(1) 747 // endif 748 745 749 String/G root:Packages:NIST:gCatPathStr = dum 746 750 return(0) //no error -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf
r1001 r1008 13 13 // 14 14 // -- examples? 15 // 16 // -- added a test function AutoFix_Rollover_Steps() that will search for steps (simple delta) that 17 // are +/- 0.1s away from the 6.7s missed rollover. This function looks for up, down, then re-calculates 18 // the derivative. ?? should this be set to work only between the cursors? Currently it does the whole set. 19 // 20 // -- added a test function PutCursorsAtBigStep(tol). that will look for a big "jump", larger than tol. 21 // find a way to work this into the panel, maybe add a button and a setVar to set the value 22 // 23 // 24 // -- EC_FindStepButton_down (and up) now both do the SAME thing -- using the "PutCursorsAtBigStep" function 25 // as above. This may change in the future... 15 26 // 16 27 // … … 1032 1043 ba.eventCode = 2 1033 1044 ShowEventDataButtonProc(ba) 1045 1046 SetDataFolder root: 1034 1047 1035 1048 return(0) … … 2235 2248 ControlBar 100 2236 2249 Button button0,pos={18,12},size={70,20},proc=EC_AddCursorButtonProc,title="Cursors" 2237 Button button1,pos={153,12},size={80,20},proc=EC_AddTimeButtonProc,title="Add time" 2238 Button button2,pos={153,38},size={80,20},proc=EC_SubtractTimeButtonProc,title="Subtr time" 2239 Button button3,pos={153,64},size={90,20},proc=EC_TrimPointsButtonProc,title="Trim points" 2240 Button button4,pos={295+150,12},size={90,20},proc=EC_SaveWavesButtonProc,title="Save Waves" 2241 Button button5,pos={285,64},size={100,20},proc=EC_FindOutlierButton,title="Find Outlier" 2242 Button button6,pos={18,38},size={80,20},proc=EC_ShowAllButtonProc,title="All Data" 2243 Button button7,pos={683,12},size={30,20},proc=EC_HelpButtonProc,title="?" 2244 Button button8,pos={658,72},size={60,20},proc=EC_DoneButtonProc,title="Done" 2245 2246 Button button9,pos={285,12},size={110,20},proc=EC_FindStepButton_down,title="Find Step Down" 2247 Button button10,pos={285,38},size={110,20},proc=EC_FindStepButton_up,title="Find Step Up" 2248 Button button11,pos={295+150,38},size={110,20},proc=EC_DoDifferential,title="Differential" 2249 Button button12,pos={295+150,64},size={110,20},proc=EC_AddFindNext,title="Add Find Next" 2250 Button button13,pos={285+120,12},size={20,20},proc=EC_NudgeCursor,title=">" 2251 2250 Button button1,pos={18,38},size={80,20},proc=EC_ShowAllButtonProc,title="All Data" 2251 Button button2,pos={18,64},size={110,20},proc=EC_DoDifferential,title="Differential" 2252 2253 2254 SetVariable setvar0 pos={153,12},title="Tol",size={90,20},value=gStepTolerance 2255 Button button3,pos={153,38},size={100,20},proc=EC_AutoCorrectSteps,title="Auto Correct" 2256 Button button4,pos={153,64},size={110,20},proc=EC_AddFindNext,title="Add Find Next" 2257 2258 2259 Button button5,pos={285,12},size={80,20},proc=EC_AddTimeButtonProc,title="Add 6.7s" 2260 Button button6,pos={285,38},size={80,20},proc=EC_SubtractTimeButtonProc,title="Subtr 6.7s" 2261 Button button7,pos={285,64},size={90,20},proc=EC_TrimPointsButtonProc,title="Trim points" 2262 2263 2264 Button button8,pos={400,12},size={110,20},proc=EC_FindStepButton_down,title="Find Step Down" 2265 Button button9,pos={400,38},size={110,20},proc=EC_FindStepButton_up,title="Find Step Up" 2266 Button button10,pos={400,64},size={100,20},proc=EC_FindOutlierButton,title="Find Outlier" 2267 Button button11,pos={520,12},size={20,20},proc=EC_NudgeCursor,title=">" 2268 2269 2270 Button button12,pos={683,12},size={30,20},proc=EC_HelpButtonProc,title="?" 2271 Button button13,pos={625,38},size={90,20},proc=EC_SaveWavesButtonProc,title="Save Waves" 2272 Button button14,pos={655,64},size={60,20},proc=EC_DoneButtonProc,title="Done" 2273 2274 2252 2275 else 2253 2276 DoAlert 0, "Please load some event data, then you'll have something to edit." … … 2258 2281 EndMacro 2259 2282 2283 2284 Function EC_AutoCorrectSteps(ba) 2285 STRUCT WMButtonAction &ba 2286 2287 switch( ba.eventCode ) 2288 case 2: // mouse up 2289 // click code here 2290 AutoFix_Rollover_Steps() 2291 2292 break 2293 case -1: // control being killed 2294 break 2295 endswitch 2296 2297 return(0) 2298 End 2260 2299 2261 2300 Function EC_NudgeCursor(ba) … … 2602 2641 startPt = min(ptA,ptB) 2603 2642 2604 FindLevel/P/Q/R=[startPt] rescaledTime_DIF a vg*upDown2643 FindLevel/P/Q/R=[startPt] rescaledTime_DIF abs(avg)*upDown // in case the average is negative 2605 2644 if(V_flag==0) 2606 2645 pt = V_levelX … … 2668 2707 NVAR upDown = root:Packages:NIST:Event:gStepTolerance 2669 2708 2670 PutCursorsAtStep(-1*upDown) 2709 PutCursorsAtBigStep(upDown) 2710 // PutCursorsAtStep(-1*upDown) 2671 2711 2672 2712 return(0) … … 2680 2720 NVAR upDown = root:Packages:NIST:Event:gStepTolerance 2681 2721 2682 PutCursorsAtStep(upDown) 2722 PutCursorsAtBigStep(upDown) 2723 // PutCursorsAtStep(upDown) 2683 2724 2684 2725 return(0) … … 4169 4210 4170 4211 End 4212 4213 4214 ////////////////// 4215 Function FixStepDown() 4216 4217 SetDataFolder root:Packages:NIST:Event: 4218 4219 Wave rescaledTime = rescaledTime 4220 Wave timePt = timePt 4221 Variable rollTime,rollTicks,ii,delta 4222 4223 rollTicks = 2^26 // in ticks 4224 rollTime = 2^26*1e-7 // in seconds 4225 4226 for(ii=0;ii<numpnts(rescaledTime)-1;ii+=1) 4227 delta = rescaledTime[ii+1] - rescaledTime[ii] 4228 if(delta < -6.6 && delta > -6.8) //assume anything this large is a step down 4229 print ii, delta 4230 MultiThread timePt[ii+1,] += rollTicks 4231 MultiThread rescaledTime[ii+1,] += rollTime 4232 4233 // updates the longest time (as does every operation of adjusting the data) 4234 NVAR t_longest = root:Packages:NIST:Event:gEvent_t_longest 4235 t_longest = waveMax(rescaledTime) 4236 endif 4237 4238 endfor 4239 4240 SetDataFolder root: 4241 4242 return(0) 4243 End 4244 4245 Function FixStepUp() 4246 4247 SetDataFolder root:Packages:NIST:Event: 4248 4249 Wave rescaledTime = rescaledTime 4250 Wave timePt = timePt 4251 Variable rollTime,rollTicks,ii,delta 4252 4253 rollTicks = 2^26 // in ticks 4254 rollTime = 2^26*1e-7 // in seconds 4255 4256 for(ii=0;ii<numpnts(rescaledTime)-1;ii+=1) 4257 delta = rescaledTime[ii+1] - rescaledTime[ii] 4258 if(delta > 6.6 && delta < 6.8) //assume anything this large is a step up 4259 print ii, delta 4260 MultiThread timePt[ii+1,] -= rollTicks 4261 MultiThread rescaledTime[ii+1,] -= rollTime 4262 4263 // updates the longest time (as does every operation of adjusting the data) 4264 NVAR t_longest = root:Packages:NIST:Event:gEvent_t_longest 4265 t_longest = waveMax(rescaledTime) 4266 endif 4267 4268 endfor 4269 4270 SetDataFolder root: 4271 4272 return(0) 4273 End 4274 4275 // added a test function AutoFix_Rollover_Steps() that will search for steps (simple delta) that 4276 // are +/- 0.1s away from the 6.7s missed rollover. This function looks for up, down, then re-calculates 4277 // the derivative. 4278 // - this way, both the simple steps, and the "square" steps can both be corrected. 4279 // 4280 Function AutoFix_Rollover_Steps() 4281 // fix steps up, then down (order doesn't matter) 4282 Print "Fixing steps of 6.7s up" 4283 FixStepUp() 4284 Print "Fixing steps of 6.7s down" 4285 FixStepDown() 4286 // re-do the differential 4287 DifferentiatedTime() 4288 return(0) 4289 End 4290 4291 4292 //upDown looks for a step up or down? 4293 // 4294 // plan is to be able to locate large (t0) steps from oscillations that are not timing errors 4295 // 4296 // 4297 // will search from the leftmost cursor to the end. this allows skipping of oscillations 4298 // that are not timing errors. It may introduce other issues, but we'll see what happens 4299 // 4300 Function PutCursorsAtBigStep(tol) 4301 Variable tol 4302 4303 SetDataFolder root:Packages:NIST:Event: 4304 4305 Wave rescaledTime=rescaledTime 4306 Variable ii,delta,ptA,ptB,startPt,pt 4307 4308 ptA = pcsr(A) 4309 ptB = pcsr(B) 4310 startPt = min(ptA,ptB) 4311 4312 for(ii=startPt;ii<numpnts(rescaledTime)-1;ii+=1) 4313 delta = rescaledTime[ii+1] - rescaledTime[ii] //if there is a step down, this will be negative 4314 if(abs(delta) > tol) 4315 print ii, delta 4316 pt = ii 4317 break 4318 endif 4319 endfor 4320 4321 Cursor/P A rescaledTime pt+1 //at the point+1 4322 Cursor/P B rescaledTime numpnts(rescaledTime)-1 //at the end 4323 4324 SetDataFolder root: 4325 4326 return(0) 4327 4328 4329 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANS_Utilities.ipf
r942 r1008 425 425 //set the global to the path (as a string) 426 426 // need 4 \ since it is the escape character 427 if(cmpstr("\\\\",dum[0,1])==0) //Windoze user going through network neighborhood 428 DoAlert 0,alertStr 429 KillPath catPathName 430 return(1) 431 endif 427 428 // SRK 2016, for windows 10, try to eliminate this restriction 429 print igorinfo(3) 430 // if(cmpstr("\\\\",dum[0,1])==0) //Windoze user going through network neighborhood 431 // DoAlert 0,alertStr 432 // KillPath catPathName 433 // return(1) 434 // endif 435 432 436 String/G root:myGlobals:gCatPathStr = dum 433 // these are now set in their erespective procedures, since the folders don't exist yet!437 // these are now set in their respective procedures, since the folders don't exist yet! 434 438 // String/G root:myGlobals:Patch:gCatPathStr = dum //and the global used by Patch and Trans 435 439 // String/G root:myGlobals:TransHeaderInfo:gCatPathStr = dum //and the global used by Patch and Trans
Note: See TracChangeset
for help on using the changeset viewer.