Changeset 942
- Timestamp:
- Jun 20, 2014 11:44:52 AM (8 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_ConcentratedSpheres.ipf
r936 r942 315 315 fill = 10 316 316 rad = 100 317 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)317 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 318 318 DoSpheresCalcFFTPanel(num,qMin,qMax) 319 319 FFTEraseMatrixButtonProc("") 320 320 321 321 rad = 80 322 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)322 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 323 323 DoSpheresCalcFFTPanel(num,qMin,qMax) 324 324 FFTEraseMatrixButtonProc("") 325 325 326 326 rad = 70 327 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)327 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 328 328 DoSpheresCalcFFTPanel(num,qMin,qMax) 329 329 FFTEraseMatrixButtonProc("") 330 330 331 331 rad = 50 332 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)332 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 333 333 DoSpheresCalcFFTPanel(num,qMin,qMax) 334 334 FFTEraseMatrixButtonProc("") 335 335 336 336 rad = 30 337 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)337 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 338 338 DoSpheresCalcFFTPanel(num,qMin,qMax) 339 339 FFTEraseMatrixButtonProc("") … … 343 343 fill = 10 344 344 rad = 150 345 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)345 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 346 346 DoBinnedSpheresCalcFFTPanel(num,qMin,qMax) 347 347 FFTEraseMatrixButtonProc("") 348 348 349 349 rad = 120 350 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)350 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 351 351 DoBinnedSpheresCalcFFTPanel(num,qMin,qMax) 352 352 FFTEraseMatrixButtonProc("") 353 353 354 354 rad = 100 355 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)355 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 356 356 DoBinnedSpheresCalcFFTPanel(num,qMin,qMax) 357 357 FFTEraseMatrixButtonProc("") 358 358 359 359 rad = 80 360 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)360 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 361 361 DoBinnedSpheresCalcFFTPanel(num,qMin,qMax) 362 362 FFTEraseMatrixButtonProc("") 363 363 364 364 rad = 50 365 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)365 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 366 366 DoBinnedSpheresCalcFFTPanel(num,qMin,qMax) 367 367 FFTEraseMatrixButtonProc("") … … 371 371 fill = 30 372 372 rad = 150 373 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)373 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 374 374 fill = 20 375 375 rad = 100 376 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)377 fill = 10 378 rad = 50 379 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)376 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 377 fill = 10 378 rad = 50 379 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 380 380 DoBinnedSLDCalcFFTPanel(num,qMin,qMax) 381 381 FFTEraseMatrixButtonProc("") … … 383 383 fill = 30 384 384 rad = 120 385 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)385 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 386 386 fill = 20 387 387 rad = 100 388 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)389 fill = 10 390 rad = 50 391 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)388 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 389 fill = 10 390 rad = 50 391 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 392 392 DoBinnedSLDCalcFFTPanel(num,qMin,qMax) 393 393 FFTEraseMatrixButtonProc("") … … 395 395 fill = 30 396 396 rad = 100 397 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)397 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 398 398 fill = 20 399 399 rad = 70 400 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)401 fill = 10 402 rad = 50 403 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)400 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 401 fill = 10 402 rad = 50 403 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 404 404 DoBinnedSLDCalcFFTPanel(num,qMin,qMax) 405 405 FFTEraseMatrixButtonProc("") … … 407 407 fill = 30 408 408 rad = 80 409 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)409 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 410 410 fill = 20 411 411 rad = 70 412 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)413 fill = 10 414 rad = 50 415 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)412 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 413 fill = 10 414 rad = 50 415 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 416 416 DoBinnedSLDCalcFFTPanel(num,qMin,qMax) 417 417 FFTEraseMatrixButtonProc("") … … 419 419 fill = 30 420 420 rad = 50 421 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)421 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 422 422 fill = 20 423 423 rad = 40 424 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)424 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 425 425 fill = 10 426 426 rad = 30 427 FillSphereRadius (mat,grid,rad,xc,yc,zc,fill)427 FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 428 428 DoBinnedSLDCalcFFTPanel(num,qMin,qMax) 429 429 FFTEraseMatrixButtonProc("") -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cubes.ipf
r936 r942 85 85 Function fDoFFT() 86 86 87 Wave mat= mat87 Wave mat=root:mat 88 88 Variable t0,t1 89 89 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cylinder_Fills.ipf
r936 r942 48 48 WAVE numConnection3D = numConnection3D 49 49 WAVE/T connectedTo3D = connectedTo3D 50 WAVE mat= mat50 WAVE mat=root:mat 51 51 Variable num=numpnts(x3d),ii=0 52 52 Variable matSize=DimSize(mat,0),jj … … 97 97 WAVE numConnection3D = numConnection3D 98 98 WAVE/T connectedTo3D = connectedTo3D 99 WAVE mat = mat99 WAVE mat = root:mat 100 100 101 101 for(ii=1;ii<num;ii+=1) //[0] point is the test point, dist == 0 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_FillMatrixShapes.ipf
r849 r942 77 77 // endif 78 78 endif 79 endfor 80 endfor 81 endfor 82 83 return(0) 84 End 85 86 //grid is the size of each voxel in the matrix in angstroms (grid^3 is the volume) 87 //radius is the real-space radius that you want the sphere to be 88 // 89 // Now enforces periodic boundary conditions 90 Function FillSphereRadiusPeriodic(mat,grid,rad,xc,yc,zc,fill) 91 WAVE mat 92 Variable grid,rad,xc,yc,zc,fill 93 94 Variable ii,jj,kk,dik,numVox 95 Variable x1,y1,z1 96 Variable nDimx,nDimy,nDimz 97 98 numVox= round(rad/grid*3) //*3 for extra room, *2 is diam 99 100 nDimx=DimSize(mat,0)-1 101 nDimy=DimSize(mat,1)-1 102 nDimz=DimSize(mat,2)-1 103 104 // keep the bounding box within bounds 105 // x1 = (xc >= numVox) ? (xc-numVox) : 0 106 // x2 = (xc + numVox) <= numx ? (xc + numVox) : numx 107 // y1 = (yc >= numVox) ? (yc-numVox) : 0 108 // y2 = (yc + numVox) <= numy ? (yc + numVox) : numy 109 // z1 = (zc >= numVox) ? (zc-numVox) : 0 110 // z2 = (zc + numVox) <= numz ? (zc + numVox) : numz 111 112 113 for(ii=xc-numVox;ii<xc+numVox;ii+=1) 114 for(jj=yc-numVox;jj<yc+numVox;jj+=1) 115 for(kk=zc-numVox;kk<zc+numVox;kk+=1) 116 //calculate the distance, even if it's off the matrix 117 dik=sqrt( (ii-xc)^2+(jj-yc)^2+(kk-zc)^2 )*grid 118 if(dik<=rad) 119 //then if it's part of the sphere, get the voxel in bounds before filling 120 x1=ii 121 y1=jj 122 z1=kk 123 if( (ii>nDimx) || (ii<0) ) 124 x1 = abs(nDimx+1 - abs(x1)) 125 endif 126 if( (jj>nDimy) || (jj<0) ) 127 y1 = abs(nDimy+1 - abs(y1)) 128 endif 129 if( (kk>nDimz) || (kk<0) ) 130 z1 = abs(nDimz+1 - abs(z1)) 131 endif 132 133 mat[x1][y1][z1] = fill 134 135 136 endif //if dist < rad 79 137 endfor 80 138 endfor … … 233 291 // 234 292 // !! this does not check for overlap!!! 235 Function SphereAtEachPoint(mat,rad,pd)293 Function SphereAtEachPoint(mat,rad,pd,fill) 236 294 Wave mat 237 Variable rad,pd 295 Variable rad,pd,fill 238 296 239 297 Wave x3d=x3d … … 251 309 rad = meanRad + gnoise(pd*meanRad) 252 310 endif 253 FillSphereRadius (mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],1)311 FillSphereRadiusPeriodic(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],fill) 254 312 endfor 255 313 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_FillTests.ipf
r936 r942 35 35 fill2 = trunc(rho2/FFT_delRho) 36 36 37 FillSphereRadius (m,FFT_T,radius1,ctr,ctr,ctr,fill1)38 FillSphereRadius (m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2)37 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr,ctr,ctr,fill1) 38 FillSphereRadiusPeriodic(m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2) 39 39 return(0) 40 40 End … … 77 77 fill2 = trunc(rho2/FFT_delRho) 78 78 79 FillSphereRadius (m,FFT_T,radius2,ctr,ctr,ctr,fill2)80 FillSphereRadius (m,FFT_T,radius1,ctr,ctr,ctr,fill1)79 FillSphereRadiusPeriodic(m,FFT_T,radius2,ctr,ctr,ctr,fill2) 80 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr,ctr,ctr,fill1) 81 81 return(0) 82 82 End … … 124 124 fill3 = trunc(rhoshel3/FFT_delRho) 125 125 126 FillSphereRadius (m,FFT_T,rcore+thick1+thick2+thick3,ctr,ctr,ctr,fill3) //outer size (shell 3)127 FillSphereRadius (m,FFT_T,rcore+thick1+thick2,ctr,ctr,ctr,fill2) //outer size (shell 2)128 FillSphereRadius (m,FFT_T,rcore+thick1,ctr,ctr,ctr,fill1) //outer size (shell 1)129 FillSphereRadius (m,FFT_T,rcore,ctr,ctr,ctr,fillc) //core126 FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1+thick2+thick3,ctr,ctr,ctr,fill3) //outer size (shell 3) 127 FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1+thick2,ctr,ctr,ctr,fill2) //outer size (shell 2) 128 FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1,ctr,ctr,ctr,fill1) //outer size (shell 1) 129 FillSphereRadiusPeriodic(m,FFT_T,rcore,ctr,ctr,ctr,fillc) //core 130 130 return(0) 131 131 End … … 176 176 // (1,-1,-1) 177 177 178 FillSphereRadius (m,FFT_T,radius1,ctr+separation/FFT_T,ctr+separation/FFT_T,ctr+separation/FFT_T,fill1)179 FillSphereRadius (m,FFT_T,radius1,ctr-separation/FFT_T,ctr-separation/FFT_T,ctr+separation/FFT_T,fill2)180 FillSphereRadius (m,FFT_T,radius1,ctr-separation/FFT_T,ctr+separation/FFT_T,ctr-separation/FFT_T,fill3)181 FillSphereRadius (m,FFT_T,radius1,ctr+separation/FFT_T,ctr-separation/FFT_T,ctr-separation/FFT_T,fill4)178 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr+separation/FFT_T,ctr+separation/FFT_T,ctr+separation/FFT_T,fill1) 179 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr-separation/FFT_T,ctr-separation/FFT_T,ctr+separation/FFT_T,fill2) 180 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr-separation/FFT_T,ctr+separation/FFT_T,ctr-separation/FFT_T,fill3) 181 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr+separation/FFT_T,ctr-separation/FFT_T,ctr-separation/FFT_T,fill4) 182 182 return(0) 183 183 End -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Fit_MixedDumbbell.ipf
r844 r942 115 115 fill2 = trunc(rho2/FFT_delRho) 116 116 117 FillSphereRadius (m,FFT_T,radius1,ctr,ctr,ctr,fill1)118 FillSphereRadius (m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2)117 FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr,ctr,ctr,fill1) 118 FillSphereRadiusPeriodic(m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2) 119 119 120 120 // set up for the calculation … … 212 212 // fill2 = trunc(rho2/FFT_delRho) 213 213 // 214 // FillSphereRadius (m,FFT_T,radius1,ctr,ctr,ctr,fill1)215 // FillSphereRadius (m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2)214 // FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr,ctr,ctr,fill1) 215 // FillSphereRadiusPeriodic(m,FFT_T,radius2,ctr+separation/FFT_T,ctr,ctr,fill2) 216 216 // 217 217 //End … … 254 254 // fill2 = trunc(rho2/FFT_delRho) 255 255 // 256 // FillSphereRadius (m,FFT_T,radius2,ctr,ctr,ctr,fill2)257 // FillSphereRadius (m,FFT_T,radius1,ctr,ctr,ctr,fill1)256 // FillSphereRadiusPeriodic(m,FFT_T,radius2,ctr,ctr,ctr,fill2) 257 // FillSphereRadiusPeriodic(m,FFT_T,radius1,ctr,ctr,ctr,fill1) 258 258 // 259 259 //End … … 301 301 // fill3 = trunc(rhoshel3/FFT_delRho) 302 302 // 303 // FillSphereRadius (m,FFT_T,rcore+thick1+thick2+thick3,ctr,ctr,ctr,fill3) //outer size (shell 3)304 // FillSphereRadius (m,FFT_T,rcore+thick1+thick2,ctr,ctr,ctr,fill2) //outer size (shell 2)305 // FillSphereRadius (m,FFT_T,rcore+thick1,ctr,ctr,ctr,fill1) //outer size (shell 1)306 // FillSphereRadius (m,FFT_T,rcore,ctr,ctr,ctr,fillc) //core303 // FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1+thick2+thick3,ctr,ctr,ctr,fill3) //outer size (shell 3) 304 // FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1+thick2,ctr,ctr,ctr,fill2) //outer size (shell 2) 305 // FillSphereRadiusPeriodic(m,FFT_T,rcore+thick1,ctr,ctr,ctr,fill1) //outer size (shell 1) 306 // FillSphereRadiusPeriodic(m,FFT_T,rcore,ctr,ctr,ctr,fillc) //core 307 307 // 308 308 //End -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Panel.ipf
r936 r942 110 110 SetVariable FFTSetVar_4,limits={0,0,0},value= FFT_estTime,noedit= 1,live= 1,format="%d" 111 111 Button FFTButton_9,pos={200,400},size={100,20},proc=FFT_Get2DSlice,title="Get 2D Slice" 112 Button FFTButton_10,pos={169,156},size={130,20},proc=FFT_TransposeMat,title="Transpose Matrix" 113 Button FFTButton_11,pos={169,189},size={130,20},proc=FFT_RotateMat,title="Rotate Matrix" 114 Button FFTButton_12,pos={168,219},size={130,20},proc=FFT_AddRotatedObject,title="Add Rotated Obj" 115 Button FFTButton_12,disable=2 // hide this button 112 113 Button FFTButton_19,pos={168,150},size={130,20},proc=FFT_ChangeMatrixValuesButton,title="Replace Voxels" 114 Button FFTButton_12,pos={168,175},size={130,20},proc=FFT_ReplaceSolventButton,title="Replace Solvent" 115 Button FFTButton_11,pos={169,200},size={130,20},proc=FFT_RotateMat,title="Rotate Matrix" 116 Button FFTButton_10,pos={169,225},size={130,20},proc=FFT_TransposeMat,title="Transpose Matrix" 117 116 118 Button FFTButton_13,pos={14,109},size={120,20},proc=FFTFillSolventMatrixProc,title="Solvent Matrix" 117 119 SetVariable FFTSetVar_5,pos={155,111},size={150,15},title="Solvent SLD (10^-7)" … … 591 593 fill = solventSLD 592 594 593 WAVE mat = mat595 WAVE mat = root:mat 594 596 Variable dx,dy,dz,nx,ny,nz 595 597 dx = DimSize(mat,0) … … 643 645 End 644 646 647 Function FFT_ChangeMatrixValuesButton(ctrlName) 648 String ctrlName 649 650 Execute "ChangeMatrixValues()" 651 652 end 653 654 Function FFT_ReplaceSolventButton(ctrlname) 655 String ctrlName 656 657 Execute "ReplaceSolvent()" 658 end 645 659 646 660 Function FFT_MakeMatrixButtonProc(ctrlName) : ButtonControl … … 670 684 End 671 685 672 Proc FFTDrawSphereProc(matStr,rad,xc,yc,zc,fill )686 Proc FFTDrawSphereProc(matStr,rad,xc,yc,zc,fill,periodic) 673 687 String matStr="mat" 674 Variable rad=25,xc=50,yc=50,zc=50,fill=10 688 Variable rad=25,xc=50,yc=50,zc=50,fill=10,periodic=1 675 689 Prompt matStr,"the wave" //,popup,WaveList("*",";","") 676 690 Prompt rad,"enter real radius (A)" … … 679 693 Prompt zc,"enter the Z-center" 680 694 Prompt fill,"fill SLD value" 695 Prompt periodic,"enter 1 for periodic, 0 for non-periodic fill" 681 696 682 697 Variable grid=root:FFT_T 683 698 684 FillSphereRadius($matStr,grid,rad,xc,yc,zc,fill) 685 699 if(periodic) 700 FillSphereRadiusPeriodic($matStr,grid,rad,xc,yc,zc,fill) 701 else 702 FillSphereRadius($matStr,grid,rad,xc,yc,zc,fill) 703 endif 686 704 End 687 705 … … 881 899 End 882 900 901 // replaces specified values 902 Proc ChangeMatrixValues(old,new) 903 Variable old,new 904 905 mat = (mat==old) ? new : mat 906 // sequence of steps to get the gizmo to update the display correctly 907 RemoveFromGizmo/N=Gizmo_VoxelMat object=Voxelgram0 908 RemoveFromGizmo/N=Gizmo_VoxelMat displayItem=axes0 909 AppendToGizmo/N=Gizmo_VoxelMat voxelgram=root:mat,name=voxelgram0 910 ModifyGizmo/N=Gizmo_VoxelMat setDisplayList=-1, object=voxelgram0 911 ModifyGizmo/N=Gizmo_VoxelMat setDisplayList=-1, object=axes0 //so that the axes are drawn last 912 ModifyGizmo ModifyObject=voxelgram0 property={ pointSize,3} 913 914 915 ColorizeGizmo() 916 End 917 918 919 920 // replaces the solvent value and updates the global 921 Proc ReplaceSolvent(newSolv) 922 Variable newSolv 923 924 Variable solv = root:FFT_SolventSLD 925 926 mat = (mat==solv) ? newSolv : mat 927 928 root:FFT_SolventSLD = newSolv 929 930 // sequence of steps to get the gizmo to update the display correctly 931 RemoveFromGizmo/N=Gizmo_VoxelMat object=Voxelgram0 932 RemoveFromGizmo/N=Gizmo_VoxelMat displayItem=axes0 933 AppendToGizmo/N=Gizmo_VoxelMat voxelgram=root:mat,name=voxelgram0 934 ModifyGizmo/N=Gizmo_VoxelMat setDisplayList=-1, object=voxelgram0 935 ModifyGizmo/N=Gizmo_VoxelMat setDisplayList=-1, object=axes0 //so that the axes are drawn last 936 ModifyGizmo ModifyObject=voxelgram0 property={ pointSize,3} 937 938 939 ColorizeGizmo() 940 End 941 942 883 943 //overwrites any existing matrix 884 944 // matrix is byte, to save space -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Plane_Fills.ipf
r836 r942 38 38 Function MakeTactoid() 39 39 40 WAVE mat= mat40 WAVE mat=root:mat 41 41 Variable ii,trim=10 42 42 Variable num=DimSize(mat,0) -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_VoxelDisplay.ipf
r941 r942 13 13 ModifyGizmo startRecMacro 14 14 AppendToGizmo voxelgram=root:mat,name=voxelgram0 15 ModifyGizmo ModifyObject=voxelgram0 property={ valueRGBA,0,10,1.5259e-05,0.195544,0.8,0.15}15 // ModifyGizmo ModifyObject=voxelgram0 property={ valueRGBA,0,10,1.5259e-05,0.195544,0.8,0.15} 16 16 ModifyGizmo ModifyObject=voxelgram0 property={ mode,0} 17 17 ModifyGizmo ModifyObject=voxelgram0 property={ pointSize,3} -
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf
r941 r942 1307 1307 list = RemoveFromList("FillYZCircle;FillZCylinder;PadMatrix;RandomFill3DMat;RandomPoints2D;SobolFill3DMat;SphereAtEachPoint;UnConnectedRodFill;XYZV_toByteVoxels;",list,";") 1308 1308 list = RemoveFromList("MakeTriplet;SobolPoints2D;X_CylindersAtPoints;X_CylindersHexagonalGrid;X_CylindersSquareGrid;maxDistance_Threaded;KR_MultiCylinder;",list,";") 1309 list = RemoveFromList("X_CoreShellCylinderHexGrid;FillPlaneHexagonal;FillPlaneSquareGrid;",list,";") 1309 list = RemoveFromList("X_CoreShellCylinderHexGrid;FillPlaneHexagonal;FillPlaneSquareGrid;FillSphereRadiusPeriodic;",list,";") 1310 list = RemoveFromList("Setup_Ur;M_energy;DoRotation;Copy_xyz_to_xyz3d;MultiCyl_Loop;",list,";") 1310 1311 1311 1312 // from Polarization -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf
r941 r942 203 203 Proc EventModePanel() 204 204 PauseUpdate; Silent 1 // building window... 205 NewPanel /W=(82,44,8 54,664)/N=EventModePanel/K=2205 NewPanel /W=(82,44,884,664)/N=EventModePanel/K=2 206 206 DoWindow/C EventModePanel 207 207 ModifyPanel fixedSize=1,noEdit =1 … … 209 209 SetDrawLayer UserBack 210 210 DrawText 479,345,"Stream Data" 211 DrawLine 563,338,7 31,338212 DrawText 479,419,"Oscillatory Data"213 DrawLine 578,411,731,411211 DrawLine 563,338,775,338 212 DrawText 479,419,"Oscillatory or Stream Data" 213 DrawLine 647,411,775,411 214 214 215 215 // ShowTools/A 216 216 Button button0,pos={14,87},size={150,20},proc=LoadEventLog_Button,title="Load Event Log File" 217 217 Button button0,fSize=12 218 TitleBox tb1,pos={475,500},size={ 135,24},fSize=10218 TitleBox tb1,pos={475,500},size={266,86},fSize=10 219 219 TitleBox tb1,variable= root:Packages:NIST:Event:gEventDisplayString 220 220 221 CheckBox chkbox2,pos={376,151},size={81,1 4},proc=LogIntEvent_Proc,title="Log Intensity"221 CheckBox chkbox2,pos={376,151},size={81,15},proc=LogIntEvent_Proc,title="Log Intensity" 222 222 CheckBox chkbox2,fSize=10,variable= root:Packages:NIST:Event:gEvent_logint 223 CheckBox chkbox3,pos={14,125},size={119,1 4},title="Remove Bad Events?",fSize=10223 CheckBox chkbox3,pos={14,125},size={119,15},title="Remove Bad Events?",fSize=10 224 224 CheckBox chkbox3,variable= root:Packages:NIST:Event:gRemoveBadEvents 225 225 226 Button doneButton,pos={7 08,36},size={50,20},proc=EventDone_Proc,title="Done"226 Button doneButton,pos={738,36},size={50,20},proc=EventDone_Proc,title="Done" 227 227 Button doneButton,fSize=12 228 Button button2,pos={419,28},size={140,20},proc=ShowEventDataButtonProc,title="Show Event Data" 229 Button button3,pos={419,56},size={140,20},proc=ShowBinDetailsButtonProc,title="Show Bin Details" 230 Button button5,pos={419,85},size={140,20},proc=ExportSlicesButtonProc,title="Export Slices as VAX" 231 Button button6,pos={718,9},size={40,20},proc=EventModeHelpButtonProc,title="?" 232 233 234 Button button7,pos={487,197},size={120,20},proc=AdjustEventDataButtonProc,title="Adjust Events" 235 Button button8,pos={619,197},size={120,20},proc=CustomBinButtonProc,title="Custom Bins" 236 Button button4,pos={487,227},size={120,20},proc=UndoTimeSortButtonProc,title="Undo Time Sort" 237 Button button18,pos={619,227},size={120,20},proc=EC_ImportWavesButtonProc,title="Import Edited" 238 228 Button button2,pos={486,200},size={140,20},proc=ShowEventDataButtonProc,title="Show Event Data" 229 Button button3,pos={486,228},size={140,20},proc=ShowBinDetailsButtonProc,title="Show Bin Details" 230 Button button5,pos={633,228},size={140,20},proc=ExportSlicesButtonProc,title="Export Slices as VAX" 231 Button button6,pos={748,9},size={40,20},proc=EventModeHelpButtonProc,title="?" 232 233 Button button7,pos={211,33},size={120,20},proc=AdjustEventDataButtonProc,title="Adjust Events" 234 Button button8,pos={653,201},size={120,20},proc=CustomBinButtonProc,title="Custom Bins" 235 Button button4,pos={211,63},size={120,20},proc=UndoTimeSortButtonProc,title="Undo Time Sort" 236 Button button18,pos={211,90},size={120,20},proc=EC_ImportWavesButtonProc,title="Import Edited" 239 237 240 238 SetVariable setvar0,pos={208,149},size={160,16},proc=sliceSelectEvent_Proc,title="Display Time Slice" 241 239 SetVariable setvar0,fSize=10 242 240 SetVariable setvar0,limits={0,1000,1},value= root:Packages:NIST:Event:gEvent_tsdisp 243 SetVariable setvar1,pos={ 206,26},size={160,16},title="Number of slices",fSize=10241 SetVariable setvar1,pos={389,29},size={160,16},title="Number of slices",fSize=10 244 242 SetVariable setvar1,limits={1,1000,1},value= root:Packages:NIST:Event:gEvent_nslices 245 SetVariable setvar2,pos={ 206,51},size={160,16},title="Max Time (s)",fSize=10243 SetVariable setvar2,pos={389,54},size={160,16},title="Max Time (s)",fSize=10 246 244 SetVariable setvar2,value= root:Packages:NIST:Event:gEvent_t_longest 247 245 248 PopupMenu popup0,pos={ 206,74},size={119,20},proc=BinTypePopMenuProc,title="Bin Spacing"246 PopupMenu popup0,pos={389,77},size={119,20},proc=BinTypePopMenuProc,title="Bin Spacing" 249 247 PopupMenu popup0,fSize=10 250 248 PopupMenu popup0,mode=1,popvalue="Equal",value= #"\"Equal;Fibonacci;Custom;\"" 251 Button button1,pos={ 206,100},size={120,20},fSize=12,proc=ProcessEventLog_Button,title="Bin Event Data"249 Button button1,pos={389,103},size={120,20},fSize=12,proc=ProcessEventLog_Button,title="Bin Event Data" 252 250 253 251 Button button10,pos={488,305},size={100,20},proc=SplitFileButtonProc,title="Split Big File" 254 252 Button button14,pos={488,350},size={120,20},proc=Stream_LoadDecim,title="Load Split List" 255 Button button19,pos={6 19,350},size={120,20},proc=Stream_LoadAdjustedList,title="Load Edited List"256 Button button20,pos={6 50,376},size={90,20},proc=ShowList_ToLoad,title="Show List"253 Button button19,pos={649,350},size={120,20},proc=Stream_LoadAdjustedList,title="Load Edited List" 254 Button button20,pos={680,376},size={90,20},proc=ShowList_ToLoad,title="Show List" 257 255 SetVariable setvar3,pos={487,378},size={150,16},title="Decimation factor" 258 256 SetVariable setvar3,fSize=10 … … 262 260 Button button16_1,pos={488,450},size={110,20},proc=AccumulateSlicesButton,title="Add Next Slice" 263 261 Button button17_2,pos={620,425},size={110,20},proc=AccumulateSlicesButton,title="Display Total" 264 265 262 266 263 CheckBox chkbox1_0,pos={25,34},size={69,14},title="Oscillatory",fSize=10 … … 273 270 CheckBox chkbox1_3,proc=EventModeRadioProc,value=0,mode=1 274 271 275 GroupBox group0_0,pos={5,5},size={174,112},title=" Mode",fSize=12,fStyle=1276 GroupBox group0_1,pos={ 192,5},size={192,123},title="Binning",fSize=12,fStyle=1277 GroupBox group0_2,pos={4 03,5},size={173,109},title="Viewing",fSize=12,fStyle=1278 GroupBox group0_3,pos={ 476,169},size={277,92},title="Editing",fSize=12,fStyle=1279 GroupBox group0_4,pos={474,278},size={ 279,200},title="BigFiles",fSize=12272 GroupBox group0_0,pos={5,5},size={174,112},title="(1) Loading Mode",fSize=12,fStyle=1 273 GroupBox group0_1,pos={372,5},size={192,127},title="(3) Bin Events",fSize=12,fStyle=1 274 GroupBox group0_2,pos={477,169},size={310,92},title="(4) View / Export",fSize=12,fStyle=1 275 GroupBox group0_3,pos={191,5},size={165,117},title="(2) Edit Events",fSize=12,fStyle=1 276 GroupBox group0_4,pos={474,278},size={312,200},title="Split / Accumulate Files",fSize=12 280 277 GroupBox group0_4,fStyle=1 281 278 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MC_SimulationScripting.ipf
r940 r942 12 12 // Example_1DSim() 13 13 // Example_2DSim() 14 // Example_Loop_1DSim() 15 // Example_Loop_2DSim() 14 16 // 15 17 // and also the instructions below in the "basic cycle" … … 126 128 127 129 /// un-comment this by removing the "x" from the word xMenu. Then compile. 128 xMenu "Macros" 129 Submenu "Simulation Scripting - Beta" 130 "Save Configuration",Sim_saveConfProc() 131 "Move to Configuration",Sim_moveConfProc() 132 "List Configurations",ListSASCALCConfigs() 133 "1D Count Rates",DryRunProc_1D() 134 "2D Dry Run",DryRunProc_2D() 135 "Optimal Count Times",OptimalCountProc() 136 "Make Table to Combine By Name",MakeCombineTable_byName() 137 "Combine by Name",DoCombineFiles_byName(lowQfile,medQfile,hiQfile,saveName) 138 "Turn Off Dead Time Correction",Sim_SetDeadTimeTiny() 139 "-" 140 "Setup Sim Example",Setup_Sim_Example() 141 "Run 1D Sim Example",Example_1DSim() 142 "Run 2D Sim Example",Example_2DSim() 143 End 144 End 145 130 Menu "Macros" 131 Submenu "Simulation Scripting - Beta" 132 ScriptItem(0),Sim_saveConfProc() 133 ScriptItem(1),Sim_moveConfProc() 134 ScriptItem(2),ListSASCALCConfigs() 135 ScriptItem(3),DryRunProc_1D() 136 ScriptItem(4),DryRunProc_2D() 137 ScriptItem(5),OptimalCountProc() 138 ScriptItem(6),MakeCombineTable_byName() 139 ScriptItem(7),DoCombineFiles_byName(lowQfile,medQfile,hiQfile,saveName) 140 ScriptItem(8),Sim_SetDeadTimeTiny() 141 ScriptItem(9) 142 ScriptItem(10),Setup_Sim_Example() 143 ScriptItem(11),Example_1DSim() 144 ScriptItem(12),Example_2DSim() 145 ScriptItem(13) 146 ScriptItem(14),DisplayProcedure "Example_1DSim" 147 End 148 End 149 150 Function/S ScriptItem(num) 151 Variable num 152 153 String str="" 154 155 if(exists("root:SANS_RED_VERSION") && exists("root:Packages:NIST:SANS_ANA_VERSION")) 156 switch(num) 157 case 0: 158 str = "Save Configuration" 159 break 160 case 1: 161 str = "Move to Configuration" 162 break 163 case 2: 164 str = "List Configurations" 165 break 166 case 3: 167 str = "1D Count Rates" 168 break 169 case 4: 170 str = "2D Dry Run" 171 break 172 case 5: 173 str = "Optimal Count Times" 174 break 175 case 6: 176 str = "Make Table to Combine By Name" 177 break 178 case 7: 179 str = "Combine by Name" 180 break 181 case 8: 182 str = "Turn Off Dead Time Correction" 183 break 184 case 9: 185 str = "-" 186 break 187 case 10: 188 str = "Setup Sim Example" 189 break 190 case 11: 191 str = "Run 1D Sim Example" 192 break 193 case 12: 194 str = "Run 2D Sim Example" 195 break 196 case 13: 197 str = "-" 198 break 199 case 14: 200 str = "Display Example Code" 201 break 202 endswitch 203 endif 204 205 return(str) 206 end 146 207 147 208 ////////// --- START OF EXAMPLE SCRIPTS --- //////////////// 148 209 149 210 // 150 // run this before the examplesto make sure that the proper named configurations and function exist.211 // run this before either the 1D or 2D example to make sure that the proper named configurations and function exist. 151 212 // this function will overwrite any same-named configurations 152 213 // … … 162 223 // include the model and plot it, so that it will exist. Post to queue so they execute in order 163 224 Execute/P "INSERTINCLUDE \"SchulzSpheres_Sq_v40\"" 225 Execute/P "INSERTINCLUDE \"DAB_Model_v40\"" 164 226 Execute/P "COMPILEPROCEDURES " 165 227 Execute/P "PlotSchulzSpheres_SC(256,0.001,0.7)" 228 Execute/P "PlotDAB_Model(256,0.001,0.7)" 166 229 167 230 Execute/P "SASCALC()" … … 333 396 return(0) 334 397 End 398 399 400 // 401 // 402 // This example will run the same sample with three different thicknesses, at 403 // 1m, 4m, 13m 404 // 405 // empty beam measurements at all three distances, sample transmission at 13m 406 // 407 // total simulation time is < 600 seconds on my old machine... 408 // do a dry run first to see how long it'll take. 409 // 410 // 411 Function Example_Loop_2DSim() 412 413 String confList,ctTimeList,titleStr,transConfList,transCtTimeList 414 Variable runIndex,val,totalTime 415 String funcStr 416 417 tic() 418 419 Sim_SetSimulationType(0) //kill the simulation panel 420 Sim_SetSimulationType(2) //open the 2D simulation panel 421 Sim_SetSimTimeWarning(36000) //sets the threshold for the warning dialog to 10 hours 422 totalTime = 0 423 424 425 //(1) determine the (unsmeared) function name (we'll set this right before the simulation) 426 funcStr = "DAB_model" 427 Wave cw = $("root:"+getFunctionCoef(funcStr)) 428 429 //(2) set the standard sample cell size (1" diam banjo cell) 430 // and set the conditions for beam stop in, and raw counts 431 Sim_SetSampleRadius(1.27) // sam radius (cm) 432 Sim_SetRawCountsCheck(1) // raw cts? 1== yes 433 Sim_SetBeamStopInOut(1) // BS in? 1==yes 434 435 //(3) model coefficients here, if needed. Wave name is "cw" 436 // then set the sample thickness and incoherent cross section 437 438 cw = {1e-05,200,0.1} 439 440 // as needed - look at the parameter list for the model 441 442 Sim_SetThickness(0.2) // thickness (cm) 443 Sim_SetIncohXS(1.3) // incoh XS 444 445 //(4) starting run index for the saved raw data files. this will automatically increment 446 // as the sample is "Run" 447 runIndex = 500 448 449 450 //(5) run the transmissions and empty beam first, before you forget them 451 452 // run the empty beam at all configurations 453 // This will automatically change the function to "EC_Empirical" and "empty beam" conditions 454 transConfList = "Config_1m;Config_4m;Config_13m;" 455 transCtTimeList = "1;1;1;" 456 titleStr = "Empty Beam" 457 totalTime += Sim_RunEmptyBeamTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 458 459 460 //(6) set the configuration list, times, a single sample label, and the starting run index 461 // -- the mumber of listed configurations must match the number of discrete count times 462 confList = "" // these will be filled in the loop 463 ctTimeList = "" 464 transConfList = "Config_13m" // trans only @ 13m 465 transCtTimeList = "1;" // trans count time = 1s 466 titleStr = "MySample 1" 467 468 // runIndex is PBR and updates as the number of files are written 469 470 Variable ii,jj 471 472 // any, all, or more settings can be set up to change in the loop 473 // -- be sure these waves are the same length and the values correspond. 474 Make/O/D thick = {0.1,0.2,0.5,0.1,0.2,0.5,0.1,0.2,0.5} 475 Make/O/D ctTime = {100,100,100,300,300,300,900,900,900} 476 Make/O/D/T conf = {"Config_1m","Config_1m","Config_1m","Config_4m","Config_4m","Config_4m","Config_13m","Config_13m","Config_13m"} 477 478 479 Sim_SetModelFunction(funcStr) // model function name 480 481 for(ii=0;ii<numpnts(thick);ii+=1) 482 Sim_SetThickness(thick[ii]) // thickness (cm) 483 484 confList = conf[ii] +";" 485 titleStr = "DAB simulation, thick = "+num2str(thick[ii]) 486 ctTimeList = num2str(ctTime[ii])+";" 487 488 // this runs the transmissions (only at 13m) 489 if(cmpstr(conf[ii],"Config_13m")==0) 490 totalTime += Sim_RunTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 491 endif 492 493 // this runs the sample 494 totalTime += Sim_RunSample_2D(confList,ctTimeList,titleStr,runIndex) 495 496 endfor 497 498 Print "runIndex = ",runIndex 499 500 Sim_SetSimTimeWarning(10) 501 502 toc() 503 504 return(totalTime) 505 End 506 507 508 335 509 336 510 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANS_Utilities.ipf
r886 r942 255 255 End 256 256 257 Function setMREDFileList(str) 258 String str 259 260 SVAR/Z list = root:myGlobals:MRED:gFileNumList 261 if(SVAR_Exists(list)==0) //check for myself 262 DoAlert 0,"The Multiple Reduce Panel must be open for you to use this function" 263 Return(1) 264 endif 265 266 list = str 267 268 //force an update If the SVAR exists, then the panel does too - MRED cleans up after itself when done 269 DoWindow/F Multiple_Reduce_Panel //bring to front 270 MRedPopMenuProc("MRFilesPopup",0,"") //parse the list, pop the menu 271 272 return(0) 273 End 257 258 259 // for testing, not used anymore 260 //Proc FillMREDList() 261 // setMREDFileList(rStr) 262 // DoUpdate 263 //End 264 265 //Function setMREDFileList(str) 266 // String str 267 // 268 // SVAR/Z list = root:myGlobals:MRED:gFileNumList 269 // if(SVAR_Exists(list)==0) //check for myself 270 // DoAlert 0,"The Multiple Reduce Panel must be open for you to use this function" 271 // Return(1) 272 // endif 273 // 274 // list = str 275 // 276 // //force an update If the SVAR exists, then the panel does too - MRED cleans up after itself when done 277 // DoWindow/F Multiple_Reduce_Panel //bring to front 278 // MRedPopMenuProc("MRFilesPopup",0,"") //parse the list, pop the menu 279 // 280 // return(0) 281 //End 274 282 275 283 Proc FillEMPUsingSelection() … … 328 336 End 329 337 330 Proc FillMREDList()331 setMREDFileList(rStr)332 DoUpdate333 End334 338 335 339
Note: See TracChangeset
for help on using the changeset viewer.