source: sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Sphere_Fills.ipf @ 798

Last change on this file since 798 was 798, checked in by srkline, 11 years ago

I'm not sure this is a great idea, but I'm putting the FFT / Debye sphere work that I have completed into SVN. It's all really rough - the math, I believe is correct, but the interface if really, really rough. But it's not going to develop without help.

File size: 7.0 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2
3// currently a bunch of commented out, old, untested macros that
4// could be modified to do some automated testing and verification
5// of the various combinations of the mtrix fills
6//
7// the calls to the actual calculation must be updated, plus lots of other stuff,
8// but it's a good start
9
10
11///////////////
12//Macro Do10()
13//
14//      Variable t1,num,nx,rval,grid,rho,qmin,qmax,ii
15//     
16//     
17//      //grid=5
18//      //rval=0.62*grid
19//      rval=20
20//      grid=1.6*rval
21//      rho=1
22//      num=50          //number of qvals
23//      qmin=0.001
24//      qmax = 0.5
25//      Make/O/N=(num) ival1,ival2,ival3,ival4,ival5,ival6,ival7,ival8,ival9,ival10,qval
26//      qval = alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
27//     
28//      ii=1
29//      do
30//              sparse=0
31//              SparseRodFill(sparse,10,10)
32//              nx=numpnts(x3d)
33//              t1=ticks
34//              //XOP is obsolete
35////            $("ival"+num2str(ii) ) = IQRfromXYZ_XOP(x3d,y3d,z3d,qval,rval,rho,grid,nx)
36////            $("ival"+num2str(ii) ) = CalcIQRfromXYZ(x3d,y3d,z3d,qval,rho,rval,grid)
37////            Printf "Igor time for %d qvals and %d spheres = %g seconds\r",num,nx,(ticks-t1)/60.15
38////            AppendtoGraph $("ival"+num2str(ii) ) vs qval
39//              Print "no calculation is done in Do10"
40//              Print "ii = ",ii
41//              ii+=1
42//      while(ii<11)
43//      Print "Completed OK"
44//End
45//
46//Macro DoSpheres()
47//      //
48//      Variable qmin=0.005,qmax=0.5
49//      Variable numq=100
50//     
51//      Make/O/N=(numq) ival_2x,ival_3x,ival_4x,ival_5x,ival_6x,ival_7x,ival_8x,qval_sph
52//      qval_sph = alog(log(qmin) + x*((log(qmax)-log(qmin))/numq))
53//      //2
54//      FillSphere(mat,2,21,21,21,1)
55//      Save/O/C/P=home mat as "mat_sphere2.ibw"
56//      fDoCalc(qval_sph,ival_2x,20/2)
57//////  //3
58//      FillSphere(mat,3,21,21,21,1)
59//      Save/O/C/P=home mat as "mat_sphere3.ibw"
60//      fDoCalc(qval_sph,ival_3x,20/3)
61////    //4
62//      FillSphere(mat,4,21,21,21,1)
63//      Save/O/C/P=home mat as "mat_sphere4.ibw"
64//      fDoCalc(qval_sph,ival_4x,20/4)
65////    //5
66//      FillSphere(mat,5,21,21,21,1)
67//      Save/O/C/P=home mat as "mat_sphere5.ibw"
68//      fDoCalc(qval_sph,ival_5x,20/5)
69//      //6
70//      FillSphere(mat,6,21,21,21,1)
71//      Save/O/C/P=home mat as "mat_sphere6.ibw"
72//      fDoCalc(qval_sph,ival_6x,20/6)
73//              //6
74//      FillSphere(mat,7,21,21,21,1)
75//      Save/O/C/P=home mat as "mat_sphere7.ibw"
76//      fDoCalc(qval_sph,ival_7x,20/7)
77//      //8
78//      FillSphere(mat,8,21,21,21,1)
79//      Save/O/C/P=home mat as "mat_sphere8.ibw"
80//      fDoCalc(qval_sph,ival_8x,20/8)
81//End
82//
83//Macro Do10Spheres()
84//
85//      Variable t1,num,nx,rval,grid,rho,qmin,qmax,ii
86//     
87//      rval=5
88//      grid=1.6*rval
89//      rho=1
90//      num=50          //number of qvals
91//      qmin=0.001
92//      qmax = 0.5
93//      Make/O/N=(num) ival1,ival2,ival3,ival4,ival5,ival6,ival7,ival8,ival9,ival10,qval
94//      qval = alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
95//     
96//      ii=1
97//      mat=0
98//      do
99//              SparseRodFill(mat,10,100)
100//              nx=numpnts(x3d)
101//              t1=ticks
102//              AltiSpheres(qval,$("ival"+num2str(ii) ),x3d,y3d,z3d,rval,(rval*0.62))
103////            $("ival"+num2str(ii) ) = CalcIQRfromXYZ(x3d,y3d,z3d,qval,rho,rval,grid)
104//              Printf "XOP time for %d qvals and %d spheres = %g seconds\r",num,nx,(ticks-t1)/60.15
105////            AppendtoGraph $("ival"+num2str(ii) ) vs qval
106//              Print "ii = ",ii
107//              ii+=1
108//      while(ii<11)
109//      Print "Completed OK"
110//End
111//
112//Macro SetupBeads()
113//      Variable num,qmin,qmax
114//     
115//      num=50
116//      qmin=0.001
117//      qmax=0.5
118//      Make/O/N=(num) ival11,ival12,ival13,ival14,ival15,ival16,ival17,ival8,ival9,ival10,qval
119//      qval = alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
120//     
121//      Make/O/B/N=(21,21,1000) mat
122//     
123//End
124//
125//
126//
127//Macro DoBeads()
128//
129//      Variable start=11,rad=4,ii
130//     
131//      //SetupBeads()
132//      mat=0
133//     
134//      ii=1
135//     
136//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
137//      ParseMatrix3D(mat)
138//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
139//      ii+=1
140//     
141//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
142//      ParseMatrix3D(mat)
143//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
144//      ii+=1
145//     
146//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
147//      ParseMatrix3D(mat)
148//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
149//      ii+=1
150//             
151//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
152//      ParseMatrix3D(mat)
153//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
154//      ii+=1   
155//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
156//      ParseMatrix3D(mat)
157//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
158//      ii+=1   
159//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
160//      ParseMatrix3D(mat)
161//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
162//      ii+=1   
163//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
164//      ParseMatrix3D(mat)
165//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
166//      ii+=1   
167//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
168//      ParseMatrix3D(mat)
169//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
170//      ii+=1   
171//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
172//      ParseMatrix3D(mat)
173//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
174//      ii+=1   
175//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
176//      ParseMatrix3D(mat)
177//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
178//      ii+=1   
179//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
180//      ParseMatrix3D(mat)
181//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
182//      ii+=1   
183//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
184//      ParseMatrix3D(mat)
185//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
186//      ii+=1   
187//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
188//      ParseMatrix3D(mat)
189//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
190//      ii+=1   
191//      AddSphere(mat,rad,11,11,(start+2*rad*ii))
192//      ParseMatrix3D(mat)
193//      Save/T/O/P=home x3d,y3d,z3d as "beadXYZ"+num2str(ii)+".awav"
194//      ii+=1
195////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
196////    ii+=1
197////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
198////    ii+=1
199////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
200////    ii+=1
201////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
202////    ii+=1
203////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
204////    ii+=1
205////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
206////    ii+=1
207////   
208////    //8
209////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
210////    ParseMatrix3D(mat)
211////    fDoCalc($("ival"+num2str(ii)),20,rad)
212////    ii+=1
213////   
214////    //9
215////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
216////    ParseMatrix3D(mat)
217////    fDoCalc($("ival"+num2str(ii)),20,rad)
218////    ii+=1
219////    //10
220////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
221////    ParseMatrix3D(mat)
222////    fDoCalc($("ival"+num2str(ii)),20,rad)
223////    ii+=1
224////    //11
225////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
226////    ParseMatrix3D(mat)
227////    fDoCalc($("ival"+num2str(ii)),20,rad)
228////    ii+=1
229////    //12
230////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
231////    ParseMatrix3D(mat)
232////    fDoCalc($("ival"+num2str(ii)),20,rad)
233////    ii+=1
234////    //13
235////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
236////    ParseMatrix3D(mat)
237////    fDoCalc($("ival"+num2str(ii)),20,rad)
238////    ii+=1
239////    //14
240////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
241////    ParseMatrix3D(mat)
242////    fDoCalc($("ival"+num2str(ii)),20,rad)
243////    ii+=1
244////    //15
245////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
246////    ParseMatrix3D(mat)
247////    fDoCalc($("ival"+num2str(ii)),20,rad)
248////    ii+=1
249////    //16
250////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
251////    ParseMatrix3D(mat)
252////    fDoCalc($("ival"+num2str(ii)),20,rad)
253////    ii+=1
254////    //17
255////    AddSphere(mat,rad,11,11,(start+2*rad*ii))
256////    ParseMatrix3D(mat)
257////    fDoCalc($("ival"+num2str(ii)),20,rad)
258////    ii+=1
259////   
260//End
Note: See TracBrowser for help on using the repository browser.