Changeset 840 for sans/Dev/trunk/NCNR_User_Procedures
- Timestamp:
- Feb 29, 2012 11:36:57 AM (11 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_ConcentratedSpheres.ipf
r836 r840 192 192 193 193 //try to put the sphere there, and keep trying forever 194 err = FillSphereRadiusNoOverlap(m,grid,tmprad,xt,yt,zt,1 )194 err = FillSphereRadiusNoOverlap(m,grid,tmprad,xt,yt,zt,10) 195 195 196 196 // if(fails == 10) … … 312 312 313 313 //// type 0 314 fill = 1 314 fill = 10 315 315 rad = 100 316 316 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 340 340 341 341 // type 2 342 fill = 1 342 fill = 10 343 343 rad = 150 344 344 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 368 368 369 369 // type 3 370 fill = 3 370 fill = 30 371 371 rad = 150 372 372 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 373 fill = 2 373 fill = 20 374 374 rad = 100 375 375 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 376 fill = 1 376 fill = 10 377 377 rad = 50 378 378 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 380 380 FFTEraseMatrixButtonProc("") 381 381 382 fill = 3 382 fill = 30 383 383 rad = 120 384 384 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 385 fill = 2 385 fill = 20 386 386 rad = 100 387 387 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 388 fill = 1 388 fill = 10 389 389 rad = 50 390 390 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 392 392 FFTEraseMatrixButtonProc("") 393 393 394 fill = 3 394 fill = 30 395 395 rad = 100 396 396 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 397 fill = 2 397 fill = 20 398 398 rad = 70 399 399 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 400 fill = 1 400 fill = 10 401 401 rad = 50 402 402 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 404 404 FFTEraseMatrixButtonProc("") 405 405 406 fill = 3 406 fill = 30 407 407 rad = 80 408 408 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 409 fill = 2 409 fill = 20 410 410 rad = 70 411 411 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 412 fill = 1 412 fill = 10 413 413 rad = 50 414 414 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) … … 416 416 FFTEraseMatrixButtonProc("") 417 417 418 fill = 3 419 rad = 50 420 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 421 fill = 2 418 fill = 30 419 rad = 50 420 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 421 fill = 20 422 422 rad = 40 423 423 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) 424 fill = 1 424 fill = 10 425 425 rad = 30 426 426 FillSphereRadius(mat,grid,rad,xc,yc,zc,fill) -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_ConnectedRods.ipf
r798 r840 217 217 Variable ranType 218 218 219 Variable ii,np,frac,nocc 219 Variable ii,np,frac,nocc,fill 220 220 Wave m=root:mat 221 221 NVAR grid=root:FFT_T … … 224 224 np = 0 225 225 frac = 0 226 fill = 10 226 227 for(ii=0;ii<nPass;ii+=1) //number of averaging passes 227 228 m=0 228 229 229 230 if(ranType == 1) 230 SobolFill3DMat(m,nPts )231 SobolFill3DMat(m,nPts,fill) 231 232 else 232 RandomFill3DMat(m,nPts )233 RandomFill3DMat(m,nPts,fill) 233 234 endif 234 235 ParseMatrix3D_rho(m) // get the triplets of points to connect -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cubes_Includes.ipf
r838 r840 93 93 End 94 94 95 Proc PutXAxisCoreShellCyl_HexGrid(w,rad,len,sep )95 Proc PutXAxisCoreShellCyl_HexGrid(w,rad,len,sep,fill) 96 96 String w="mat" 97 Variable rad=30,len=300,sep=100 97 Variable rad=30,len=300,sep=100,fill=10 98 98 Prompt w,"matrix" 99 99 prompt rad,"radius of cylinders" 100 100 prompt len,"length of cylinders" 101 101 prompt sep,"center-to-center separation of cylinders" 102 Prompt fill,"fill SLD value" 102 103 103 $w=0104 X_CoreShellCylinderHexGrid($w,rad,len,sep )104 // $w=0 105 X_CoreShellCylinderHexGrid($w,rad,len,sep,fill) 105 106 106 107 NumberOfPoints() 107 108 end 108 109 109 Function X_CoreShellCylinderHexGrid(mat,rad,len,sep )110 Function X_CoreShellCylinderHexGrid(mat,rad,len,sep,fill) 110 111 Wave mat 111 112 variable rad,len //length of cylinders 112 113 Variable sep // EDGE separation, in same units as cylinder 114 Variable fill 113 115 116 NVAR solventSLD = root:FFT_SolventSLD 114 117 115 118 NVAR grid=root:FFT_T … … 119 122 // fill a 2D plane with points 120 123 Make/O/B/N=(np,np) plane 121 plane = 0124 plane = solventSLD 122 125 123 126 spacing = round(sep/grid) // so it's an integer 124 FillPlaneHexagonal(plane,spacing )127 FillPlaneHexagonal(plane,spacing,fill) 125 128 126 129 // put it in the proper plane of the matrix … … 136 139 137 140 for(ii=0;ii<num;ii+=1) 138 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len, 1) //cylinder 1141 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,fill) //cylinder 1 139 142 endfor 140 143 141 144 // makes a crude core-shell cylinder 142 145 for(ii=0;ii<num;ii+=1) 143 FillXCylinder(mat,grid,rad-20,x3d[ii],y3d[ii],z3d[ii],len,3 ) //cylinder 1146 FillXCylinder(mat,grid,rad-20,x3d[ii],y3d[ii],z3d[ii],len,3*fill) //cylinder 1 144 147 endfor 145 148 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cylinder_2D_Fill.ipf
r798 r840 113 113 114 114 Proc Test2D() 115 116 Variable fill = 10 117 115 118 Make/O/N=(100,100) plane 116 119 DoWindow/F Plane_View … … 122 125 endif 123 126 plane=0 124 RandomPoints2D(plane,10 )127 RandomPoints2D(plane,10,fill) 125 128 End 126 129 … … 132 135 //for the 3D equivalent, see RandomFill3DMat(mat,num) 133 136 // 134 Function RandomPoints2D(w,num )137 Function RandomPoints2D(w,num,fill) 135 138 Wave w 136 139 variable num //number of spheres to add 140 Variable fill 137 141 138 142 Variable row,col,ii,xt,yt,zt,fail=0 … … 146 150 yt=trunc(abs(enoise(col))) 147 151 if( w[xt][yt] == 0 ) 148 w[xt][yt] = 1152 w[xt][yt] = fill 149 153 ii+=1 //increment number of spheres actually added 150 154 //Print "point ",ii … … 161 165 162 166 // the Sobol sequence MUST be initlalized before passing to thie routine 163 Function SobolPoints2D(w,num )167 Function SobolPoints2D(w,num,fill) 164 168 Wave w 165 169 variable num //number of spheres to add 170 Variable fill 166 171 167 172 Variable row,col,ii,xt,yt,zt,fail=0 … … 178 183 xt = Sobol2D[0] *row 179 184 yt = Sobol2D[1] *col 180 w[xt][yt] = 1185 w[xt][yt] = fill 181 186 endfor 182 187 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cylinder_Fills.ipf
r836 r840 14 14 15 15 16 Proc ConnectDots3D(w,np,maxNumConn,sobol )16 Proc ConnectDots3D(w,np,maxNumConn,sobol,fill) 17 17 String w="mat" 18 Variable np=100,maxNumConn=2,sobol=1 18 Variable np=100,maxNumConn=2,sobol=1,fill=10 19 19 Prompt w,"matrix" 20 20 Prompt np,"number of points" 21 21 prompt maxNumConn,"number of connections per point" 22 22 Prompt sobol,"1=Sobol, 0=random" 23 24 $w=0 23 Prompt fill,"fill SLD value" 24 25 // $w=0 25 26 26 27 if(sobol) 27 SobolFill3DMat($w,np )28 SobolFill3DMat($w,np,fill) 28 29 else 29 RandomFill3DMat($w,np )30 RandomFill3DMat($w,np,fill) 30 31 endif 31 32 … … 35 36 Make/O/N=(num) numConnection3D=0 36 37 Make/O/T/N=(num) connectedTo3D="" 37 fConnectDots3D(maxNumConn )38 fConnectDots3D(maxNumConn,fill) 38 39 end 39 40 40 41 // connect the dots, no periodic boundary conditions 41 42 //thickness is set to 1 42 Function fConnectDots3D(maxNumConn )43 Variable maxNumConn 43 Function fConnectDots3D(maxNumConn,fill) 44 Variable maxNumConn,fill 44 45 45 46 … … 65 66 connectedTo3D[ii] += num2str(nnInd)+"," 66 67 67 ConnectPoints3D(mat, x3d[ii],y3d[ii],z3d[ii],x3d[nnInd],y3d[nnInd],z3d[nnInd],thick, 1) //always fill68 ConnectPoints3D(mat, x3d[ii],y3d[ii],z3d[ii],x3d[nnInd],y3d[nnInd],z3d[nnInd],thick,fill) //always fill 68 69 endif 69 70 endfor … … 231 232 // this implementation is a random walk, end-to-end connection 232 233 // 233 Function ConnectedRodFill(mat,len,num,periodic )234 Function ConnectedRodFill(mat,len,num,periodic,fill) 234 235 Wave mat 235 236 variable len,num //length in direction, number of spheres to add 236 237 Variable periodic //==1 if periodic boundaries 238 Variable fill 237 239 238 240 Variable nptx,npty,nptz,ii,fail=0,nAdd … … 251 253 dirVec[2] = PickDirection() 252 254 253 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic )255 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic,fill) 254 256 255 257 stVec = endVec //end point is the new starting point … … 262 264 dirVec[1] = PickDirection() 263 265 dirVec[2] = PickDirection() 264 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic )266 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic,fill) 265 267 stVec = endVec //end point is the new starting point 266 268 … … 281 283 // 282 284 // 283 Function UnConnectedRodFill(mat,len,num,periodic )285 Function UnConnectedRodFill(mat,len,num,periodic,fill) 284 286 Wave mat 285 287 variable len,num //length in direction, number of spheres to add 286 288 Variable periodic //==1 if periodic boundaries 289 Variable fill 287 290 288 291 Variable nptx,npty,nptz,ii,fail=0,nAdd … … 301 304 dirVec[2] = PickDirection() 302 305 303 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic )306 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic,fill) 304 307 //loop over remaining 305 308 ii=nAdd … … 313 316 dirVec[2] = PickDirection() 314 317 //add as many spheres as possible in that direction 315 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic )318 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic,fill) 316 319 ii+=nAdd 317 320 //Print "point ",ii … … 335 338 // 336 339 // 337 Function AddSpheresInDirection(m,stVec,dirVec,endVec,nTry,periodic )340 Function AddSpheresInDirection(m,stVec,dirVec,endVec,nTry,periodic,fill) 338 341 WAVE m,stVec,dirVec,endVec 339 Variable nTry,periodic 342 Variable nTry,periodic,fill 340 343 341 344 Variable added,nx,ny,nz,nDimx,nDimy,nDimz 342 345 346 NVAR solventSLD = root:FFT_SolventSLD 347 343 348 nDimx=DimSize(m,0)-1 344 349 nDimy=DimSize(m,1)-1 … … 376 381 Endif 377 382 //add the point or exit 378 if(m[nx][ny][nz] )383 if(m[nx][ny][nz] != solventSLD) 379 384 break //point is already occupied 380 385 else 381 m[nx][ny][nz] = 1386 m[nx][ny][nz] = fill 382 387 // nx +=1 //we'll back this off before returning 383 388 // ny +=1 … … 393 398 End 394 399 395 Proc PutRandomCylindersAtPoints(w,num,len,periodic )400 Proc PutRandomCylindersAtPoints(w,num,len,periodic,fill) 396 401 String w="mat" 397 Variable num=1000,len=10,periodic=1 402 Variable num=1000,len=10,periodic=1,fill = 10 398 403 Prompt w,"matrix" 399 404 Prompt num,"number of starting points" 400 405 prompt len,"length of cylinders" 401 406 prompt periodic"1=periodic, 0=non-periodic boundaries" 402 403 $w=0 404 RandomFill3DMat($w,num) 405 CylindersAtPoints($w,len,periodic) 407 Prompt fill,"fill SLD value" 408 409 410 // $w=0 411 RandomFill3DMat($w,num,fill) 412 CylindersAtPoints($w,len,periodic,fill) 406 413 407 414 NumberOfPoints() 408 415 end 409 416 410 Proc PutXAxisCylindersAtPoints(w,num,rad,len,periodic,sobol )417 Proc PutXAxisCylindersAtPoints(w,num,rad,len,periodic,sobol,fill) 411 418 String w="mat" 412 Variable num=100,rad=20,len=300,periodic=1,sobol=1 419 Variable num=100,rad=20,len=300,periodic=1,sobol=1,fill=10 413 420 Prompt w,"matrix" 414 421 Prompt num,"number of starting points" … … 417 424 prompt periodic,"1=periodic, 0=non-periodic boundaries" 418 425 Prompt sobol,"1=Sobol, 0=random" 419 420 $w=0 421 X_CylindersAtPoints($w,num,rad,len,sobol,periodic) 426 Prompt fill,"fill SLD value" 427 428 429 // $w=0 430 X_CylindersAtPoints($w,num,rad,len,sobol,periodic,fill) 422 431 423 432 NumberOfPoints() 424 433 end 425 434 426 Proc PutXAxisCylindersSquare(w,rad,len,sep )435 Proc PutXAxisCylindersSquare(w,rad,len,sep,fill) 427 436 String w="mat" 428 Variable rad=20,len=300,sep=80 437 Variable rad=20,len=300,sep=80,fill=10 429 438 Prompt w,"matrix" 430 439 prompt rad,"radius of cylinders" 431 440 prompt len,"length of cylinders" 432 441 prompt sep,"center-to-center separation of cylinders" 433 434 $w=0 435 X_CylindersSquareGrid($w,rad,len,sep) 442 Prompt fill,"fill SLD value" 443 444 445 // $w=0 446 X_CylindersSquareGrid($w,rad,len,sep,fill) 436 447 437 448 NumberOfPoints() 438 449 end 439 450 440 Proc PutXAxisCylindersHexagonal(w,rad,len,sep )451 Proc PutXAxisCylindersHexagonal(w,rad,len,sep,fill) 441 452 String w="mat" 442 Variable rad=20,len=300,sep=80 453 Variable rad=20,len=300,sep=80,fill=10 443 454 Prompt w,"matrix" 444 455 prompt rad,"radius of cylinders" 445 456 prompt len,"length of cylinders" 446 457 prompt sep,"center-to-center separation of cylinders" 447 448 $w=0 449 X_CylindersHexagonalGrid($w,rad,len,sep) 458 Prompt fill,"fill SLD value" 459 460 // $w=0 461 X_CylindersHexagonalGrid($w,rad,len,sep,fill) 450 462 451 463 NumberOfPoints() 452 464 end 453 465 454 Function CylindersAtPoints(mat,len,periodic )466 Function CylindersAtPoints(mat,len,periodic,fill) 455 467 Wave mat 456 468 variable len //length in direction 457 469 Variable periodic //==1 if periodic boundaries 470 Variable fill 458 471 459 472 Make/O/B/N=3 stVec,dirVec,endVec … … 476 489 stVec[1] = y3d[ii] 477 490 stVec[2] = z3d[ii] 478 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic )491 nAdd = AddSpheresInDirection(mat,stVec,dirVec,endVec,len,periodic,fill) 479 492 //FillSphereRadius(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],1) 480 493 endfor … … 485 498 /////////////// 486 499 487 Function X_CylindersAtPoints(mat,num,rad,len,sobol,periodic )500 Function X_CylindersAtPoints(mat,num,rad,len,sobol,periodic,fill) 488 501 Wave mat 489 502 variable num,rad,len //length in direction 490 503 Variable periodic //==1 if periodic boundaries 491 504 Variable sobol //==1 if sobol selection of points (2D) 492 505 Variable fill 506 507 NVAR solventSLD = root:FFT_SolventSLD 493 508 494 509 Variable np … … 497 512 // fill a 2D plane with points 498 513 Make/O/B/N=(np,np) plane 499 plane = 0 514 plane = solventSLD 515 500 516 if(sobol) 501 517 if(WaveExists($"SobolInit") == 0) … … 503 519 SobolX(-1,SobolInit) 504 520 else 505 SobolPoints2D(plane,num )521 SobolPoints2D(plane,num,fill) 506 522 endif 507 523 else 508 RandomPoints2D(plane,num )524 RandomPoints2D(plane,num,fill) 509 525 endif 510 526 // put it in the proper plane of the matrix … … 520 536 521 537 for(ii=0;ii<num;ii+=1) 522 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len, 1) //cylinder 1538 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,fill) //cylinder 1 523 539 endfor 524 540 … … 527 543 528 544 529 Function X_CylindersSquareGrid(mat,rad,len,sep )545 Function X_CylindersSquareGrid(mat,rad,len,sep,fill) 530 546 Wave mat 531 547 variable rad,len //length of cylinders 532 548 Variable sep // EDGE separation, in same units as cylinder 533 534 549 Variable fill 550 551 NVAR solventSLD = root:FFT_SolventSLD 552 535 553 NVAR grid=root:FFT_T 536 554 Variable np,spacing … … 539 557 // fill a 2D plane with points 540 558 Make/O/B/N=(np,np) plane 541 plane = 0559 plane = solventSLD 542 560 543 561 544 562 spacing = round(sep/grid) // so it's an integer 545 FillPlaneSquareGrid(plane,spacing) 563 FillPlaneSquareGrid(plane,spacing,fill) 564 565 546 566 547 567 // put it in the proper plane of the matrix 548 568 mat[np/2][][] = plane[q][r] // in the YZ plane 549 569 570 550 571 ParseMatrix3D_rho(mat) 551 572 Wave x3d=x3d … … 557 578 558 579 for(ii=0;ii<num;ii+=1) 559 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len, 1) //cylinder 1580 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,fill) //cylinder 1 560 581 endfor 561 582 … … 563 584 End 564 585 565 Function X_CylindersHexagonalGrid(mat,rad,len,sep )586 Function X_CylindersHexagonalGrid(mat,rad,len,sep,fill) 566 587 Wave mat 567 588 variable rad,len //length of cylinders 568 589 Variable sep // EDGE separation, in same units as cylinder 569 590 Variable fill 591 592 NVAR solventSLD = root:FFT_SolventSLD 570 593 571 594 NVAR grid=root:FFT_T … … 575 598 // fill a 2D plane with points 576 599 Make/O/B/N=(np,np) plane 577 plane = 0600 plane = solventSLD 578 601 579 602 spacing = round(sep/grid) // so it's an integer 580 FillPlaneHexagonal(plane,spacing )603 FillPlaneHexagonal(plane,spacing,fill) 581 604 582 605 // put it in the proper plane of the matrix … … 592 615 593 616 for(ii=0;ii<num;ii+=1) 594 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len, 1) //cylinder 1617 FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,fill) //cylinder 1 595 618 endfor 596 619 597 620 //// makes a crude core-shell cylinder 598 621 // for(ii=0;ii<num;ii+=1) 599 // FillXCylinder(mat,grid,rad-10,x3d[ii],y3d[ii],z3d[ii],len,3 ) //cylinder 1622 // FillXCylinder(mat,grid,rad-10,x3d[ii],y3d[ii],z3d[ii],len,3*fill) //cylinder 1 600 623 // endfor 601 624 // … … 605 628 606 629 607 Function FillPlaneSquareGrid(w,sp )630 Function FillPlaneSquareGrid(w,sp,fill) 608 631 Wave w 609 632 Variable sp //spacing in pixels 633 Variable fill 610 634 611 635 Variable np,ii,jj … … 615 639 for(ii=sp;ii<(np-sp/2);ii+=sp) 616 640 for(jj=sp;jj<(np-sp/2);jj+=sp) 617 w[ii][jj] = 1641 w[ii][jj] = fill 618 642 endfor 619 643 endfor … … 624 648 625 649 // sp is the 626 Function FillPlaneHexagonal(w,sp )650 Function FillPlaneHexagonal(w,sp,fill) 627 651 Wave w 628 652 Variable sp //spacing in pixels 629 630 Variable np,ii,jj,xx,yy,fill 653 Variable fill 654 655 Variable np,ii,jj,xx,yy 631 656 632 657 np = DimSize(w,0) 633 658 634 fill = 1 659 635 660 // do even columns, then odds 636 661 for(ii=sp;ii<(np-sp/2);ii+=(sp*sqrt(3)) ) … … 789 814 rad = meanRad + gnoise(pd*meanRad) 790 815 print ii,rad 791 FillZCylinder(mat,grid,rad,xc,yc,zc,len,1 ) //cylinder 1816 FillZCylinder(mat,grid,rad,xc,yc,zc,len,10) //cylinder 1 792 817 rad = meanRad + gnoise(pd*meanRad) 793 818 print ii,rad 794 FillZCylinder(mat,grid,rad,xc,yc+aa,zc,len,1 ) //cylinder 2819 FillZCylinder(mat,grid,rad,xc,yc+aa,zc,len,10) //cylinder 2 795 820 rad = meanRad + gnoise(pd*meanRad) 796 821 print ii,rad 797 FillZCylinder(mat,grid,rad,xc+sina,yc+cosa,zc,len,1 ) //cylinder 3822 FillZCylinder(mat,grid,rad,xc+sina,yc+cosa,zc,len,10) //cylinder 3 798 823 Execute "DoFFT()" 799 824 if(ii==0) … … 808 833 rad = meanRad + gnoise(pd*meanRad) 809 834 print rad 810 FillZCylinder(mat,grid,rad,xc,yc+aa,zc,len,1 )835 FillZCylinder(mat,grid,rad,xc,yc+aa,zc,len,10) 811 836 Execute "DoFFT()" 812 837 Duplicate/O iBin iBin_2 … … 814 839 rad = meanRad + gnoise(pd*meanRad) 815 840 print rad 816 FillZCylinder(mat,grid,rad,xc+sina,yc+cosa,zc,len,1 )841 FillZCylinder(mat,grid,rad,xc+sina,yc+cosa,zc,len,10) 817 842 Execute "DoFFT()" 818 843 Duplicate/O iBin iBin_3 … … 820 845 rad = meanRad + gnoise(pd*meanRad) 821 846 print rad 822 FillZCylinder(mat,grid,rad,xc+sina,yc-cosa,zc,len,1 )847 FillZCylinder(mat,grid,rad,xc+sina,yc-cosa,zc,len,10) 823 848 Execute "DoFFT()" 824 849 Duplicate/O iBin iBin_4 … … 826 851 rad = meanRad + gnoise(pd*meanRad) 827 852 print rad 828 FillZCylinder(mat,grid,rad,xc,yc-aa,zc,len,1 )853 FillZCylinder(mat,grid,rad,xc,yc-aa,zc,len,10) 829 854 Execute "DoFFT()" 830 855 Duplicate/O iBin iBin_5 … … 832 857 rad = meanRad + gnoise(pd*meanRad) 833 858 print rad 834 FillZCylinder(mat,grid,rad,xc-sina,yc-cosa,zc,len,1 )859 FillZCylinder(mat,grid,rad,xc-sina,yc-cosa,zc,len,10) 835 860 Execute "DoFFT()" 836 861 Duplicate/O iBin iBin_6 … … 838 863 rad = meanRad + gnoise(pd*meanRad) 839 864 print rad 840 FillZCylinder(mat,grid,rad,xc-sina,yc+cosa,zc,len,1 )865 FillZCylinder(mat,grid,rad,xc-sina,yc+cosa,zc,len,10) 841 866 Execute "DoFFT()" 842 867 Duplicate/O iBin iBin_7 … … 847 872 Proc Vary_N_In_Direction() 848 873 874 Variable fill=10 875 849 876 FFTEraseMatrixButtonProc("") 850 ConnectedRodFill(mat,2,30000*4,1 )877 ConnectedRodFill(mat,2,30000*4,1,fill) 851 878 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 852 879 Duplicate/O ival_XOP ival_XOP_2 … … 854 881 855 882 FFTEraseMatrixButtonProc("") 856 ConnectedRodFill(mat,3,30000*4,1 )883 ConnectedRodFill(mat,3,30000*4,1,fill) 857 884 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 858 885 Duplicate/O ival_XOP ival_XOP_3 … … 860 887 861 888 FFTEraseMatrixButtonProc("") 862 ConnectedRodFill(mat,4,30000*4,1 )889 ConnectedRodFill(mat,4,30000*4,1,fill) 863 890 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 864 891 Duplicate/O ival_XOP ival_XOP_4 … … 866 893 867 894 FFTEraseMatrixButtonProc("") 868 ConnectedRodFill(mat,5,30000*4,1 )895 ConnectedRodFill(mat,5,30000*4,1,fill) 869 896 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 870 897 Duplicate/O ival_XOP ival_XOP_5 … … 872 899 873 900 FFTEraseMatrixButtonProc("") 874 ConnectedRodFill(mat,6,30000*4,1 )901 ConnectedRodFill(mat,6,30000*4,1,fill) 875 902 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 876 903 Duplicate/O ival_XOP ival_XOP_6 … … 878 905 879 906 FFTEraseMatrixButtonProc("") 880 ConnectedRodFill(mat,7,30000*4,1 )907 ConnectedRodFill(mat,7,30000*4,1,fill) 881 908 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 882 909 Duplicate/O ival_XOP ival_XOP_7 … … 884 911 885 912 FFTEraseMatrixButtonProc("") 886 ConnectedRodFill(mat,8,30000*4,1 )913 ConnectedRodFill(mat,8,30000*4,1,fill) 887 914 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 888 915 Duplicate/O ival_XOP ival_XOP_8 … … 890 917 891 918 FFTEraseMatrixButtonProc("") 892 ConnectedRodFill(mat,9,30000*4,1 )919 ConnectedRodFill(mat,9,30000*4,1,fill) 893 920 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 894 921 Duplicate/O ival_XOP ival_XOP_9 … … 896 923 897 924 FFTEraseMatrixButtonProc("") 898 ConnectedRodFill(mat,10,30000*4,1 )925 ConnectedRodFill(mat,10,30000*4,1,fill) 899 926 DoBinnedSpheresCalcFFTPanel(300,0.0001,0.5) 900 927 Duplicate/O ival_XOP ival_XOP_10 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_FillMatrixShapes.ipf
r836 r840 386 386 // - likely more "evenly" spread out than a random pick 387 387 // -- but is it too regular? 388 Function SobolFill3DMat(mat,num )388 Function SobolFill3DMat(mat,num,fill) 389 389 Wave mat 390 variable num //number of spheres to add390 variable num,fill //number of spheres to add 391 391 392 392 Variable row,col,lay,ii,xt,yt,zt,fail=0 … … 407 407 zt = trunc(lay*Sobol3D[2]) 408 408 if( NoNeighbors(xt,yt,zt,mat) ) 409 mat[xt][yt][zt] = 1409 mat[xt][yt][zt] = fill 410 410 ii+=1 //increment number of spheres actually added 411 411 //Print "point ",ii … … 422 422 423 423 424 Function RandomFill3DMat(mat,num )424 Function RandomFill3DMat(mat,num,fill) 425 425 Wave mat 426 variable num //number of spheres to add426 variable num,fill //number of spheres to add 427 427 428 428 Variable row,col,lay,ii,xt,yt,zt,fail=0 … … 444 444 zt=trunc(abs(enoise(lay))) 445 445 if( NoNeighbors(xt,yt,zt,mat) ) 446 mat[xt][yt][zt] = 1446 mat[xt][yt][zt] = fill 447 447 ii+=1 //increment number of spheres actually added 448 448 //Print "point ",ii … … 468 468 Variable valid=1,invalid=0,xMax,yMax,zMax,ncont=0 469 469 470 if(mat[xt][yt][zt]) //already occupied, trial is invalid 470 NVAR solventSLD = root:FFT_SolventSLD 471 472 if(mat[xt][yt][zt] != solventSLD) //already occupied, trial is invalid 471 473 return (invalid) 472 474 Endif … … 493 495 //at central point, do nothing 494 496 else 495 if(mat[xi][yi][zi] )497 if(mat[xi][yi][zi] != solventSLD) 496 498 ncont+=1 497 499 endif … … 667 669 668 670 WAVE mat = root:mat 671 NVAR solventSLD = root:FFT_SolventSLD 669 672 670 673 if(erase) 671 mat = 0674 mat = solventSLD 672 675 endif 673 676 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_KR_Parser.ipf
r800 r840 390 390 Button button_0,pos={45,80},size={100,20},proc=KR_Show3DButtonProc,title="Show 3D" 391 391 Button button_1,pos={46,51},size={100,20},proc=KR_Plot1DButtonProc,title="Plot 1D" 392 Button button_2,pos={178,80},size={120,20},proc=KR_DoCalcButtonProc,title="Do Calculation" 392 Button button_2,pos={178,50},size={150,20},proc=KR_GenerateButtonProc,title="Generate Structure" 393 Button button_4,pos={178,80},size={120,20},proc=KR_DoCalcButtonProc,title="Do Calculation" 393 394 Button button_3,pos={600,50},size={120,20},proc=KR_DeleteRow,title="Delete Row(s)" 394 395 ValDisplay valdisp_0,pos={339,16},size={80,13},title="FFT_T" … … 461 462 End 462 463 463 Function KR_DoCalcButtonProc(ba) : ButtonControl 464 465 //just generates the structure, no calculation 466 Function KR_GenerateButtonProc(ba) : ButtonControl 464 467 STRUCT WMButtonAction &ba 465 468 … … 493 496 494 497 XYZV_FillMat(xoutW,youtW,ZoutW,sldW,1) //last 1 will erase the matrix 498 // MakeTriplet(xoutW,youtW,zoutW) 499 // 500 // // and the calculation. Assumes SLDs are all the same 501 // NVAR qmin = root:KR_Qmin 502 // NVAR qmax = root:KR_Qmax 503 // NVAR npt = root:KR_Npt 504 // 505 // fDoBinned_KR_FFTPanel(npt,qmin,qmax) 506 // 507 508 break 509 endswitch 510 511 return 0 512 End 513 514 515 516 Function KR_DoCalcButtonProc(ba) : ButtonControl 517 STRUCT WMButtonAction &ba 518 519 switch( ba.eventCode ) 520 case 2: // mouse up 521 Wave xx=root:xx 522 if(numpnts(xx)==0) 523 return(0) 524 endif 525 wave yy=yy 526 wave zz=zz 527 wave rri=rri 528 wave hti=hti 529 // wave sbp=sbp 530 wave rotx=rotx 531 wave roty=roty 532 wave sld=sld 533 534 Duplicate/O xx, sbp 535 NVAR FFT_T=root:FFT_T 536 sbp = FFT_T 537 538 // parse 539 KR_MultiCylinder(xx,yy,zz,rri,hti,sbp,rotx,roty,sld) 540 541 // these are really just for display, or if the FFT of mat is wanted later. 542 WAVE xoutW=root:xoutW 543 WAVE youtW=root:youtW 544 WAVE zoutW=root:zoutW 545 WAVE sldW=root:sldW 546 547 XYZV_FillMat(xoutW,youtW,ZoutW,sldW,1) //last 1 will erase the matrix 495 548 MakeTriplet(xoutW,youtW,zoutW) 496 549 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Panel.ipf
r838 r840 398 398 Proc FFTDrawSphereProc(matStr,rad,xc,yc,zc,fill) 399 399 String matStr="mat" 400 Variable rad=25,xc=50,yc=50,zc=50,fill=1 400 Variable rad=25,xc=50,yc=50,zc=50,fill=10 401 401 Prompt matStr,"the wave" //,popup,WaveList("*",";","") 402 402 Prompt rad,"enter real radius (A)" … … 404 404 Prompt yc,"enter the Y-center" 405 405 Prompt zc,"enter the Z-center" 406 Prompt fill," 1= fill, 0 = erase"406 Prompt fill,"fill SLD value" 407 407 408 408 Variable grid=root:FFT_T … … 421 421 String direction 422 422 String matStr="mat" 423 Variable rad=25,len=300,xc=50,yc=50,zc=50,fill=1 423 Variable rad=25,len=300,xc=50,yc=50,zc=50,fill=10 424 424 Prompt direction, "Direction", popup "X;Y;Z;" 425 425 Prompt matStr,"the wave" //,popup,WaveList("*",";","") … … 429 429 Prompt yc,"enter the Y-center" 430 430 Prompt zc,"enter the Z-center" 431 Prompt fill," 1= fill, 0 = erase"431 Prompt fill,"fill SLD value" 432 432 433 433 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_VoxelDisplay.ipf
r836 r840 13 13 ModifyGizmo startRecMacro 14 14 AppendToGizmo voxelgram=root:mat,name=voxelgram0 15 ModifyGizmo ModifyObject=voxelgram0 property={ valueRGBA,0,1 ,1.5259e-05,0.195544,0.8,0.3}15 ModifyGizmo ModifyObject=voxelgram0 property={ valueRGBA,0,10,1.5259e-05,0.195544,0.8,0.3} 16 16 ModifyGizmo ModifyObject=voxelgram0 property={ mode,0} 17 17 ModifyGizmo ModifyObject=voxelgram0 property={ pointSize,3}
Note: See TracChangeset
for help on using the changeset viewer.