Changeset 4097
 Timestamp:
 Aug 16, 2019 1:10:33 PM (3 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/G2shapes.py
r4095 r4097 379 379 return; 380 380 381 # Establish a volume 381 # Evaluate local bead densities and point density on a notional grid  fast version 382 383 def set_box_fast(aList_beads_x,aList_beads_y,aList_beads_z,\ 384 aList_box_x_all,aList_box_y_all,aList_box_z_all,\ 385 aList_box_score,box_step,dmax,rsearch): 386 387 dmax_over2 = dmax/2.0 388 num_box = int(dmax/box_step)+1 389 390 box_grid = np.zeros((num_box,num_box,num_box),dtype=int) 391 aList_beads_xyz_loc = np.array([(np.array(aList_beads_x)+dmax_over2)/box_step, 392 (np.array(aList_beads_y)+dmax_over2)/box_step, 393 (np.array(aList_beads_z)+dmax_over2)/box_step],dtype=int) 394 395 for ix,iy,iz in aList_beads_xyz_loc.T: 396 box_grid[ix,iy,iz] += 1 397 398 non_zero = np.argwhere(box_grid) 399 for ix,iy,iz in non_zero: 400 aList_box_x_all.append((ix*box_step)dmax_over2) 401 aList_box_y_all.append((iy*box_step)dmax_over2) 402 aList_box_z_all.append((iz*box_step)dmax_over2) 403 aList_box_score.append(box_grid[ix,iy,iz]) 404 405 return; 406 407 # Establish a volume 382 408 383 409 def set_vol(aList_box_x_all,aList_box_y_all,aList_box_z_all,aList_box_score,\ … … 1489 1515 # rsearch_use = (2.0  scale)*rsearch 1490 1516 1491 set_box (aList_beads_x,aList_beads_y,aList_beads_z,\1517 set_box_fast(aList_beads_x,aList_beads_y,aList_beads_z,\ 1492 1518 aList_box_x_all,aList_box_y_all,aList_box_z_all,\ 1493 1519 aList_box_score,box_step,dmax,rsearch) … … 1795 1821 aList_box_score = [] 1796 1822 1797 set_box (aList_beads_x,aList_beads_y,aList_beads_z,\1823 set_box_fast(aList_beads_x,aList_beads_y,aList_beads_z,\ 1798 1824 aList_box_x_all,aList_box_y_all,aList_box_z_all,\ 1799 1825 aList_box_score,box_step,dmax,rsearch) 
trunk/GSASIIpwdGUI.py
r4095 r4097 53 53 import GSASIIElem as G2elem 54 54 import GSASIIsasd as G2sasd 55 import G2shapes _np55 import G2shapes 56 56 VERY_LIGHT_GREY = wx.Colour(235,235,235) 57 57 WACV = wx.ALIGN_CENTER_VERTICAL … … 5430 5430 5431 5431 elif data['Current'] == 'Shapes': 5432 import G2shapes5433 5432 SaveState() 5434 5433 wx.MessageBox(''' For use of SHAPES, please cite:
Note: See TracChangeset
for help on using the changeset viewer.