Ignore:
Timestamp:
Feb 17, 2012 12:04:13 PM (11 years ago)
Author:
srkline
Message:

changes to FFT routines to clean things up for a beta release at the next startup. No functionality changes, just cleaning up the operation, interface, and menu items.

Some important changes to the polarization routines. New equations for calculating the coefficient matrix. Now appears to be correct. Also, proper proportions are used when adding multiple files together to the matrix.

Change to the Model Docs is an updated reference.

WorkFileUtils? was broken when I changed to use linear_data exclusively. This has now been fixed and it operates as expected.

PackageLoader? now has menu items (under Macros) for the Polarization routines. These may later be moved to the SANS menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cubes_Includes.ipf

    r828 r836  
    3030                "Davg_to_Np" 
    3131        end 
    32         Submenu "Matrix Moving" 
    33                 "ParseMatrix 3D to XYZ" 
    34                 "Plot XYZ" 
    35                 "Animated Slices" 
    36                 "Show Full Matrix" 
    37         end 
    38         Submenu "3D testing" 
     32        Submenu "3D Examples" 
     33                "Polydisperse Spheres" 
    3934                "Connect Dots 3D" 
    4035                "Put Random Cylinders at Points" 
     
    4237                "Put X-axis Cylinders Square Grid",PutXAxisCylindersSquare() 
    4338                "Put X-axis Cylinders Hexagonal Grid",PutXAxisCylindersHexagonal() 
    44                 "Hexagonal Cylinders" 
    45                 "Conc Sphere Loop" 
    46                 "-" 
    47                 "Overnight" 
     39                "Core-shell Cylinders Hex Grid",PutXAxisCoreShellCyl_HexGrid() 
    4840        end 
    49         Submenu "2D testing" 
    50                 "Test 2D" 
    51                 "Connect Dots 2D" 
    52                 "Erase 2D" 
     41        Submenu "Matrix Viewing" 
     42//              "ParseMatrix 3D to XYZ" 
     43//              "Plot XYZ"                      //replaced by Gizmo 
     44                "Animated Slices" 
     45//              "Show Full Matrix" 
    5346        end 
    54         "-" 
    55         "Include FFT Fit Functions" 
     47        Submenu "Automation Examples" 
     48//              "Hexagonal Cylinders" 
     49//              "Conc Sphere Loop" 
     50//              "-" 
     51//              "Overnight" 
     52        end 
     53//      Submenu "2D testing" 
     54//              "Test 2D" 
     55//              "Connect Dots 2D" 
     56//              "Erase 2D" 
     57//      end 
     58//      "-" 
     59//      "Include FFT Fit Functions"             //automatically loaded now... 
    5660End 
    5761 
     
    6266        Execute/P "COMPILEPROCEDURES " 
    6367end 
     68 
     69 
     70////// examples of different structures, shapes and techniques for generating structures 
     71// other examples that could be added are: 
     72// -- a tetrahedron w/ 4 different colors (rotation, transformation) 
     73// -- core-shell spheres 
     74// -- binary (touching) spheres of different SLD (would make a simple fit function too) 
     75// -- ? other 
     76// -- orientation-dependent structures vs. 2D analytic 
     77// -- simple automation examples 
     78 
     79 
     80Proc PolydisperseSpheres(nSph,rad,pd,nPass,tagStr) 
     81        Variable nSph=505,rad=20,pd=0.25,nPass=10 
     82        String tagStr="_Poly" 
     83// nSph = number of LARGE spheres to add (not the voxel size) 
     84// rad = mean radius of these large spheres 
     85// pd = polydispersity (0,1) 
     86// nPass = number of repeat averaging passes 
     87// tagStr = extension string for the output name = "iBin"+tagStr 
     88        TestConcSpheres(nSph,rad,pd,nPass,tagStr) 
     89        Display $("iBin"+tagStr) vs $("qBin"+tagStr) 
     90        ModifyGraph grid=1,mirror=2,log=1 
     91        ModifyGraph mode=4,marker=2,msize=2 
     92        Legend 
     93End 
     94 
     95Proc PutXAxisCoreShellCyl_HexGrid(w,rad,len,sep) 
     96        String w="mat" 
     97        Variable rad=30,len=300,sep=100 
     98        Prompt w,"matrix" 
     99        prompt rad,"radius of cylinders" 
     100        prompt len,"length of cylinders" 
     101        prompt sep,"center-to-center separation of cylinders" 
     102         
     103        $w=0 
     104        X_CoreShellCylinderHexGrid($w,rad,len,sep) 
     105         
     106        NumberOfPoints() 
     107end 
     108 
     109Function X_CoreShellCylinderHexGrid(mat,rad,len,sep) 
     110        Wave mat 
     111        variable rad,len                //length of cylinders 
     112        Variable sep                    // EDGE separation, in same units as cylinder 
     113         
     114         
     115        NVAR grid=root:FFT_T 
     116        Variable np,spacing 
     117        np = DimSize(mat,0)                     // assumes that all dimensions are the same 
     118         
     119        // fill a 2D plane with points 
     120        Make/O/B/N=(np,np) plane 
     121        plane = 0 
     122 
     123        spacing = round(sep/grid)               // so it's an integer 
     124        FillPlaneHexagonal(plane,spacing) 
     125         
     126        // put it in the proper plane of the matrix 
     127        mat[np/2][][] = plane[q][r]                     // in the YZ plane 
     128         
     129        ParseMatrix3D_rho(mat) 
     130        Wave x3d=x3d 
     131        Wave y3d=y3d 
     132        Wave z3d=z3d 
     133         
     134        Variable ii=0,num 
     135        num = numpnts(x3d)       
     136         
     137        for(ii=0;ii<num;ii+=1) 
     138                FillXCylinder(mat,grid,rad,x3d[ii],y3d[ii],z3d[ii],len,1)               //cylinder 1 
     139        endfor 
     140 
     141// makes a crude core-shell cylinder     
     142        for(ii=0;ii<num;ii+=1) 
     143                FillXCylinder(mat,grid,rad-20,x3d[ii],y3d[ii],z3d[ii],len,3)            //cylinder 1 
     144        endfor 
     145         
     146        return(0) 
     147End 
Note: See TracChangeset for help on using the changeset viewer.