Changeset 2191
- Timestamp:
- Apr 1, 2016 12:39:12 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r2187 r2191 617 617 def GetSelection(self): 618 618 if 'powder' in self.calcType: 619 return '0\n0\n3\n','','', self.Parm,self.parmRange,self.parmStep619 return '0\n0\n3\n','','','',self.Parm,self.parmRange,self.parmStep 620 620 elif 'selected' in self.calcType: 621 621 return '0\n0\n4\n1\n%d\n%d\n16\n1\n%d\n0\nend\n'% \ -
trunk/GSASIIphsGUI.py
r2187 r2191 2964 2964 dlg.Destroy() 2965 2965 G2pwd.StackSim(data['Layers'],ctrls,HistName,scale,background,limits,inst,profile) 2966 G2pwd.CalcStackingPWDR(data['Layers'],HistName,scale,background,limits,inst,profile) 2966 2967 G2plt.PlotPatterns(G2frame,plotType='PWDR') 2967 2968 else: #selected area 2968 G2pwd.StackSim(data['Layers'],ctrls)2969 #G2pwd.CalcStackingSADP(data['Layers'])2969 # G2pwd.StackSim(data['Layers'],ctrls) 2970 G2pwd.CalcStackingSADP(data['Layers']) 2970 2971 wx.CallAfter(UpdateLayerData) 2971 2972 -
trunk/GSASIIpwd.py
r2190 r2191 1935 1935 os.remove('GSASII-DIFFaX.dat') 1936 1936 1937 def CalcStackingPWDR(Layers,HistName,scale,background,limits,inst,profile): 1938 pass 1939 1937 1940 def CalcStackingSADP(Layers): 1938 1941 … … 1963 1966 laueId = ['-1','2/m(ab)','2/m(c)','mmm','-3','-3m','4/m','4/mmm', 1964 1967 '6/m','6/mmm'].index(Layers['Laue'])+1 1965 except ValueError: 1968 except ValueError: #for 'unknown' 1966 1969 laueId = -1 1967 1970 planeId = ['h0l','0kl','hhl','h-hl'].index(Layers['Sadp']['Plane'])+1 … … 2028 2031 pyx.pygettrans(Nlayers,TransP,TransX) 2029 2032 # result as Sadp 2030 mirror = laueId in [ 2,3,4,7,8,9,10]2033 mirror = laueId in [-1,2,3,7,8,9,10] 2031 2034 Nspec = 20001 2032 2035 spec = np.zeros(Nspec,dtype='double') 2033 2036 time0 = time.time() 2034 hkLim,Incr = pyx.pygetsadp(controls,Nspec,spec) 2035 # GSASIIpath.IPyBreak() 2037 hkLim,Incr,Nblk = pyx.pygetsadp(controls,Nspec,spec) 2036 2038 Sapd = np.zeros((256,256)) 2037 2039 maxInt = np.max(spec[1:]) … … 2039 2041 iB = 0 2040 2042 for i in range(hkLim): 2041 iF = iB+128 2042 p1 = 128+int(i*Incr) 2043 Sapd[128:,p1] = spec[iB:iF] 2044 Sapd[:128,p1] = spec[iF:iB:-1] 2045 if mirror: 2046 p2 = 128-int(i*Incr) 2043 iF = iB+Nblk 2044 p1 = 127+int(i*Incr) 2045 p2 = 128-int(i*Incr) 2046 if Nblk == 128: 2047 if i: 2048 Sapd[128:,p1] = spec[iB:iF] 2049 Sapd[:128,p1] = spec[iF:iB:-1] 2047 2050 Sapd[128:,p2] = spec[iB:iF] 2048 2051 Sapd[:128,p2] = spec[iF:iB:-1] 2049 iB += 128 2052 else: 2053 if i: 2054 Sapd[:,p1] = spec[iB:iF] 2055 Sapd[:,p2] = spec[iB:iF] 2056 iB += Nblk 2050 2057 Sapd *= Scale 2051 2058 Sapd = np.where(Sapd<32767.,Sapd,32767.) 2052 2059 Layers['Sadp']['Img'] = Sapd 2053 2060 print 'GETSAD time = %.2fs'%(time.time()-time0) 2061 # GSASIIpath.IPyBreak() 2054 2062 2055 2063 #testing data -
trunk/fsource/DIFFaXsubs/DIFFaX.inc
r2188 r2191 53 53 * incompatible with the input data, then this * 54 54 * will be reset to FALSE. * 55 * debug - TRUE for printouts to appear on screen (RVD) * 55 56 * DoDatdump - TRUE if the user wants a dump of the data file * 56 57 * DoSymDump - TRUE if the user wants to dump the output of * … … 382 383 | xplcit, rndm, inf_thick, has_l_mirror, h_mirror, 383 384 | k_mirror, hk_mirror, check_sym, same_rz, any_sharp, 384 | same_layer, finite_width 385 | same_layer, finite_width,debug 385 386 * 386 387 integer*4 l_seq(XP_MAX), pow(MAX_BIN), a_type(MAX_A,MAX_L), … … 422 423 | recrsv, xplcit, rndm, inf_thick, has_l_mirror, 423 424 | h_mirror, k_mirror, hk_mirror, check_sym, 424 | same_rz, any_sharp, same_layer, finite_width 425 | same_rz, any_sharp, same_layer, finite_width, 426 | debug 425 427 * 426 428 common /integ1/ l_seq, pow, a_type, l_n_atoms, l_symmetry, -
trunk/fsource/DIFFaXsubs/DIFFaXsubs.for
r2190 r2191 2352 2352 * 2353 2353 * write progress to screen 2354 write(op,102) h, k, infile(1:LENGTH(infile))2354 if (debug) write(op,102) h, k, infile(1:LENGTH(infile)) 2355 2355 * 2356 2356 call XYPHSE(h, k) … … 2385 2385 if(cnt.gt.MAX_SP) goto 998 2386 2386 spec(cnt) = x 2387 if(mod(info,info_step).eq.0 ) then2387 if(mod(info,info_step).eq.0 .and. debug) then 2388 2388 if(loglin.eq.0) then 2389 2389 if(ONE+x.gt.ZERO) then -
trunk/fsource/pydiffax.for
r2190 r2191 1 SUBROUTINE PYGETSADP(CNTRLS,NSADP,SADP,HKLIM,INCR)2 3 Cf2py intent(in) CNTRLS4 Cf2py intent(in) NSADP5 Cf2py intent(in/out) SADP6 Cf2py depend(NSADP) SADP7 Cf2py intent(out) HKLIM8 Cf2py intent(out) INCR9 10 INCLUDE 'DIFFaXsubs/DIFFaX.par'11 INCLUDE 'DIFFaXsubs/DIFFaX.inc'12 13 INTEGER*4 CNTRLS(7),NSADP,GET_SYM,i_plane,hk_lim,i,j,k14 INTEGER*4 HKLIM15 REAL*8 SADP(NSADP),AGLQ16,l_upper,INCR16 LOGICAL ok17 18 EXTERNAL AGLQ16,GET_SYM19 20 i_plane = CNTRLS(2)21 l_upper = CNTRLS(3)22 C print *,n_actual,(l_n_atoms(i),i=1,n_actual)23 C do j=1,n_actual24 C do i=1,l_n_atoms(j)25 C print *,a_name(i,j),(a_pos(k,i,j),k=1,3)26 C end do27 C end do28 C print *, recrsv,inf_thick,xplcit,rndm,l_cnt,has_l_mirror29 C do i=1,n_layers30 C print *,' layer',i31 C do j=1,n_layers32 C print *,'layer',j,l_alpha(i,j),(l_r(k,i,j),k=1,3)33 C end do34 C end do35 ok = .TRUE.36 37 C print *,cell_a,cell_b,cell_c,cell_gamma,pnt_grp,SymGrpNo38 c DoSymDump = .TRUE.39 CALL SPHCST()40 CALL DETUN()41 CALL OPTIMZ('GSAS-II',ok)42 C print *,lambda,max_angle,h_bnd,k_bnd,l_bnd,no_trials,43 C 1 rad_type,X_RAY,n_atoms44 C print *,(l_g(j),j=1,n_layers)45 C do j=1,n_layers46 C print *,(hx_ky(i,j),i=1,l_n_atoms(j))47 C print *,(mat(i,j),i=1,n_layers)48 C print *,(mat1(i,j),i=1,n_layers)49 C print *,(l_phi(i,j),i=1,n_layers)50 C end do51 CALL GETSAD(AGLQ16,i_plane,l_upper,hk_lim,'GSAS-II',ok)52 HKLIM = hk_lim+153 INCR = dble(SADSIZE/2)/l_upper54 if (i_plane.eq.1) then55 INCR = INCR*sqrt(a0/c0)56 else if (i_plane.eq.2) then57 INCR = INCR*sqrt(b0/c0)58 else if (i_plane.eq.3) then59 INCR = INCR*sqrt((a0+b0+d0)/c0)60 else if (i_plane.eq.4) then61 INCR = INCR*sqrt((a0+b0-d0)/c0)62 end if63 do I=1,NSADP64 SADP(i) = spec(i)65 end do66 RETURN67 END68 69 1 SUBROUTINE PYLOADSCF(NATP,ATYPES,SFDAT) 70 2 … … 82 14 83 15 C fill common x-ray scattering factors 16 debug = .FALSE. 84 17 DO J=1,NATP 85 18 WRITE(atom_l(J),'(A4)') ATYPES(J) … … 87 20 x_sf(I,J) = SFDAT(I,J) 88 21 END DO 89 C print *,ATYPES(J),(x_sf(I,J),I=1,9)22 if (debug) print '(1x,a4,9f10.6)',ATYPES(J),(x_sf(I,J),I=1,9) 90 23 END DO 91 24 intp_F = .TRUE. … … 150 83 xplcit = .FALSE. 151 84 IF (CNTRLS(6).NE.0) THEN 152 l_cnt = CNTRLS( 7)85 l_cnt = CNTRLS(6) 153 86 inf_thick = .FALSE. 154 87 ELSE … … 188 121 cell_gamma = CELL(4)*DEG2RAD 189 122 C fill common layer stuff - atoms & symm 190 C print *,NL,LNUM,NU,LSYM191 123 DO I=1,NATM 192 124 IL = NINT(ATMXOU(1,I)) 193 125 IA = NINT(ATMXOU(2,I)) 194 126 a_type(IA,IL) = NINT(ATMXOU(3,I)) 195 C print *,ATMTP(I),IL,IA,a_type(IA,IL),(ATMXOU(j,I),j=4,6)196 127 a_number(IA,IL) = IA 197 128 WRITE(a_name(IA,IL),'(A4)') ATMTP(I) … … 210 141 l_symmetry(IL) = LSYM(IL) 211 142 END DO 212 C print *,IL,high_atom(IL),low_atom(IL)213 143 n_actual = IL 214 144 n_layers = NL … … 250 180 END 251 181 182 SUBROUTINE PYGETSADP(CNTRLS,NSADP,SADP,HKLIM,INCR,NBLK) 183 184 Cf2py intent(in) CNTRLS 185 Cf2py intent(in) NSADP 186 Cf2py intent(in/out) SADP 187 Cf2py depend(NSADP) SADP 188 Cf2py intent(out) HKLIM 189 Cf2py intent(out) INCR 190 Cf2py intent(out) NBLK 191 192 INCLUDE 'DIFFaXsubs/DIFFaX.par' 193 INCLUDE 'DIFFaXsubs/DIFFaX.inc' 194 195 INTEGER*4 CNTRLS(7),NSADP,GET_SYM,i_plane,hk_lim,i,j,k 196 INTEGER*4 HKLIM,NBLK 197 REAL*8 SADP(NSADP),AGLQ16,l_upper,INCR 198 LOGICAL ok 199 200 EXTERNAL AGLQ16,GET_SYM 201 202 i_plane = CNTRLS(2) 203 l_upper = CNTRLS(3) 204 C print *,n_actual,(l_n_atoms(i),i=1,n_actual) 205 C do j=1,n_actual 206 C do i=1,l_n_atoms(j) 207 C print *,a_name(i,j),(a_pos(k,i,j),k=1,3) 208 C end do 209 C end do 210 c print *, recrsv,inf_thick,xplcit,rndm,l_cnt,has_l_mirror 211 C do i=1,n_layers 212 C print *,' layer',i 213 C do j=1,n_layers 214 C print *,'layer',j,l_alpha(i,j),(l_r(k,i,j),k=1,3) 215 C end do 216 C end do 217 ok = .TRUE. 218 219 c print *,cell_a,cell_b,cell_c,cell_gamma,pnt_grp,SymGrpNo 220 c DoSymDump = .TRUE. 221 CALL SPHCST() 222 CALL DETUN() 223 CALL OPTIMZ('GSAS-II',ok) 224 C print *,lambda,max_angle,h_bnd,k_bnd,l_bnd,no_trials, 225 C 1 rad_type,X_RAY,n_atoms 226 C print *,(l_g(j),j=1,n_layers) 227 C do j=1,n_layers 228 C print *,(hx_ky(i,j),i=1,l_n_atoms(j)) 229 C print *,(mat(i,j),i=1,n_layers) 230 C print *,(mat1(i,j),i=1,n_layers) 231 C print *,(l_phi(i,j),i=1,n_layers) 232 C end do 233 CALL GETSAD(AGLQ16,i_plane,l_upper,hk_lim,'GSAS-II',ok) 234 NBLK = sadblock 235 HKLIM = hk_lim+1 236 INCR = dble(SADSIZE/2)/l_upper 237 if (i_plane.eq.1) then 238 INCR = INCR*sqrt(a0/c0) 239 else if (i_plane.eq.2) then 240 INCR = INCR*sqrt(b0/c0) 241 else if (i_plane.eq.3) then 242 INCR = INCR*sqrt((a0+b0+d0)/c0) 243 else if (i_plane.eq.4) then 244 INCR = INCR*sqrt((a0+b0-d0)/c0) 245 end if 246 do I=1,NSADP 247 SADP(i) = spec(i) 248 end do 249 RETURN 250 END 251 252 252
Note: See TracChangeset
for help on using the changeset viewer.