Esempio n. 1
0
def test_complex():
    p = pointsmodelpy.new_pdbmodel()
    pointsmodelpy.pdbmodel_add(p,"ff0.pdb")

    vp = pointsmodelpy.new_point3dvec()
    pointsmodelpy.get_pdbpoints(p,vp);

    pointsmodelpy.get_pdb_pr(p,vp)
    pointsmodelpy.save_pdb_pr(p,"testcomplex.pr")

    iq = iqPy.new_iq(100,0.001, 0.3)
    pointsmodelpy.get_pdb_iq(p,iq)

    iqPy.OutputIQ(iq,"testcomplex.iq")

    a = geoshapespy.new_sphere(10)
    lm = pointsmodelpy.new_loresmodel(0.1)
    pointsmodelpy.lores_add(lm,a,1.0)

    vpcomplex = pointsmodelpy.new_point3dvec();
    complex = pointsmodelpy.new_complexmodel()
    pointsmodelpy.complexmodel_add(complex,p,"PDB");
    pointsmodelpy.complexmodel_add(complex,lm,"LORES");
    
    pointsmodelpy.get_complexpoints(complex,vpcomplex);
    pointsmodelpy.get_complex_pr(complex,vpcomplex);
    pointsmodelpy.save_complex_pr(complex,"testcomplex1.pr");

    iqcomplex = iqPy.new_iq(100,0.001, 0.3)
    pointsmodelpy.get_complex_iq(complex,iqcomplex);

    iqPy.OutputIQ(iq,"testcomplex1.iq")
Esempio n. 2
0
def test_lores2d(phi):
  from sasModeling.pointsmodelpy import pointsmodelpy 
  from sasModeling.iqPy import iqPy
  from sasModeling.geoshapespy import geoshapespy

  #lores model is to hold several geometric objects
  lm = pointsmodelpy.new_loresmodel(0.1)

  #generate single geometry shape
  c = geoshapespy.new_cylinder(10,40)
  geoshapespy.set_center(c,1,1,1)
  geoshapespy.set_orientation(c,0,0,0)

  #add single geometry shape to lores model
  pointsmodelpy.lores_add(lm,c,3.0)

  #retrieve the points from lores model for sas calculation
  vp = pointsmodelpy.new_point3dvec()
  pointsmodelpy.get_lorespoints(lm,vp)

  #Calculate I(Q) and P(r) 2D
  pointsmodelpy.distdistribution_xy(lm,vp)
  pointsmodelpy.outputPR_xy(lm,"out_xy.pr")
  iq = iqPy.new_iq(100,0.001, 0.3)
  pointsmodelpy.calculateIQ_2D(lm,iq,phi)
  iqPy.OutputIQ(iq, "out_xy.iq")
Esempio n. 3
0
def test_complex3():
  pdb = pointsmodelpy.new_pdbmodel()

  lores = pointsmodelpy.new_loresmodel(0.1)
  sph = geoshapespy.new_sphere(10)
  pointsmodelpy.lores_add(lores,sph,1.0)

  complex = pointsmodelpy.new_complexmodel()	
  pointsmodelpy.complexmodel_add(complex,pdb,"PDB");
  pointsmodelpy.complexmodel_add(complex,lores,"LORES")

  points = pointsmodelpy.new_point3dvec()
  pointsmodelpy.get_complexpoints(complex,points)

  pointsmodelpy.get_complex_pr(complex,points);
  pointsmodelpy.save_complex_pr(complex,"testcomplex3.pr")

  iqcomplex = iqPy.new_iq(100,0.001, 0.3)
  pointsmodelpy.get_complex_iq(complex,iqcomplex)

  iqPy.OutputIQ(iqcomplex,"testcomplex3.iq")

  print "p(r) is saved in testcomplex3.pr"
  print "I(Q) is saved in testcomplex3.iq"
  print "pass"
Esempio n. 4
0
def test_lores2d(phi):
    from sasModeling.pointsmodelpy import pointsmodelpy
    from sasModeling.iqPy import iqPy
    from sasModeling.geoshapespy import geoshapespy

    #lores model is to hold several geometric objects
    lm = pointsmodelpy.new_loresmodel(0.1)

    #generate single geometry shape
    c = geoshapespy.new_cylinder(10, 40)
    geoshapespy.set_center(c, 1, 1, 1)
    geoshapespy.set_orientation(c, 0, 0, 0)

    #add single geometry shape to lores model
    pointsmodelpy.lores_add(lm, c, 3.0)

    #retrieve the points from lores model for sas calculation
    vp = pointsmodelpy.new_point3dvec()
    pointsmodelpy.get_lorespoints(lm, vp)

    #Calculate I(Q) and P(r) 2D
    pointsmodelpy.distdistribution_xy(lm, vp)
    pointsmodelpy.outputPR_xy(lm, "out_xy.pr")
    iq = iqPy.new_iq(100, 0.001, 0.3)
    pointsmodelpy.calculateIQ_2D(lm, iq, phi)
    iqPy.OutputIQ(iq, "out_xy.iq")
Esempio n. 5
0
def test_complex4():

    a = geoshapespy.new_sphere(10)
    lm = pointsmodelpy.new_loresmodel(0.1)
    pointsmodelpy.lores_add(lm, a, 1.0)

    vpcomplex = pointsmodelpy.new_point3dvec()
    complex = pointsmodelpy.new_complexmodel()
    pointsmodelpy.complexmodel_add(complex, lm, "LORES")

    pointsmodelpy.get_complexpoints(complex, vpcomplex)

    print(pointsmodelpy.get_complex_iq_2D(complex, vpcomplex, 0.1, 0.1))
    print(pointsmodelpy.get_complex_iq_2D(complex, vpcomplex, 0.01, 0.1))
Esempio n. 6
0
def test_complex4():


    a = geoshapespy.new_sphere(10)
    lm = pointsmodelpy.new_loresmodel(0.1)
    pointsmodelpy.lores_add(lm,a,1.0)

    vpcomplex = pointsmodelpy.new_point3dvec();
    complex = pointsmodelpy.new_complexmodel()
    pointsmodelpy.complexmodel_add(complex,lm,"LORES");
    
    pointsmodelpy.get_complexpoints(complex,vpcomplex);
 
    print pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.1,0.1);
    print pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.01,0.1);
Esempio n. 7
0
def get2d_2():
  from math import pi
  from Numeric import arange,zeros
  from enthought.util.numerix import Float,zeros
  from sasModeling.file2array import readfile2array
  from sasModeling.pointsmodelpy import pointsmodelpy
  from sasModeling.geoshapespy import geoshapespy

  lm = pointsmodelpy.new_loresmodel(0.1)
  cyn = geoshapespy.new_cylinder(5,20)
  geoshapespy.set_orientation(cyn,0,0,90)
  pointsmodelpy.lores_add(lm,cyn,1.0)

  vp = pointsmodelpy.new_point3dvec()
  pointsmodelpy.get_lorespoints(lm,vp)

  pointsmodelpy.distdistribution_xy(lm,vp)

  value_grid = zeros((100,100),Float)
  width, height = value_grid.shape
  print(width,height)

  I = pointsmodelpy.calculateI_Qxy(lm,0.00001,0.000002)
  print(I)

  Imax = 0
  for i in range(width):
    for j in range(height):
      qx = float(i-50)/200.0
      qy = float(j-50)/200.0
      value_grid[i,j] = pointsmodelpy.calculateI_Qxy(lm,qx,qy)
      if value_grid[i][j] > Imax:
        Imax = value_grid[i][j]

  for i in range(width):
    for j in range(height):
      value_grid[i][j] = value_grid[i][j]/Imax

  value_grid[50,50] = 1
  return value_grid
Esempio n. 8
0
def get2d_2():
    from math import pi
    from Numeric import arange, zeros
    from enthought.util.numerix import Float, zeros
    from sasModeling.file2array import readfile2array
    from sasModeling.pointsmodelpy import pointsmodelpy
    from sasModeling.geoshapespy import geoshapespy

    lm = pointsmodelpy.new_loresmodel(0.1)
    cyn = geoshapespy.new_cylinder(5, 20)
    geoshapespy.set_orientation(cyn, 0, 0, 90)
    pointsmodelpy.lores_add(lm, cyn, 1.0)

    vp = pointsmodelpy.new_point3dvec()
    pointsmodelpy.get_lorespoints(lm, vp)

    pointsmodelpy.distdistribution_xy(lm, vp)

    value_grid = zeros((100, 100), Float)
    width, height = value_grid.shape
    print(width, height)

    I = pointsmodelpy.calculateI_Qxy(lm, 0.00001, 0.000002)
    print(I)

    Imax = 0
    for i in range(width):
        for j in range(height):
            qx = float(i - 50) / 200.0
            qy = float(j - 50) / 200.0
            value_grid[i, j] = pointsmodelpy.calculateI_Qxy(lm, qx, qy)
            if value_grid[i][j] > Imax:
                Imax = value_grid[i][j]

    for i in range(width):
        for j in range(height):
            value_grid[i][j] = value_grid[i][j] / Imax

    value_grid[50, 50] = 1
    return value_grid
Esempio n. 9
0
def test_complex2():
  pdb = pointsmodelpy.new_pdbmodel()
  pointsmodelpy.pdbmodel_add(pdb,"ff0.pdb")

  lores = pointsmodelpy.new_loresmodel(0.1)

  complex = pointsmodelpy.new_complexmodel()	
  pointsmodelpy.complexmodel_add(complex,pdb,"PDB");
  pointsmodelpy.complexmodel_add(complex,lores,"LORES")

  points = pointsmodelpy.new_point3dvec()
  pointsmodelpy.get_complexpoints(complex,points)

  pointsmodelpy.get_complex_pr(complex,points);
  pointsmodelpy.save_complex_pr(complex,"testcomplex2.pr")

  iqcomplex = iqPy.new_iq(100,0.001, 0.3)
  pointsmodelpy.get_complex_iq(complex,iqcomplex)

  iqPy.OutputIQ(iqcomplex,"testcomplex2.iq")

  print "p(r) is saved in testcomplex2.pr"
  print "I(Q) is saved in testcomplex2.iq"
  print "pass"
Esempio n. 10
0
    print
    print "module information:"
    print "    file:", pointsmodelpy.__file__
    print "    doc:", pointsmodelpy.__doc__
    print "    contents:", dir(pointsmodelpy)
    print "    contents:", dir(geoshapespy)

#    a = geoshapespy.new_singlehelix(10,2,30,2)
    #a = geoshapespy.new_sphere(20)
    
    iq = iqPy.new_iq(100,0.001, 0.3)

#    geoshapespy.set_orientation(a,20,40,60)
#    geoshapespy.set_center(a,0,0,0)
    lm = pointsmodelpy.new_loresmodel(0.1)
#    pointsmodelpy.lores_add(lm,a,1.0)

#    b = geoshapespy.new_sphere(15)
#    geoshapespy.set_center(b,15,15,15)
#    pointsmodelpy.lores_add(lm,b,2.0)

    
    c = geoshapespy.new_cylinder(10,40)
    geoshapespy.set_center(c,1,1,1)
    geoshapespy.set_orientation(c,0,0,0)
    pointsmodelpy.lores_add(lm,c,3.0)
    
#    d = geoshapespy.new_ellipsoid(10,8,6)
#    geoshapespy.set_center(d,3,3,3)
#    geoshapespy.set_orientation(c,30,30,30)
Esempio n. 11
0
if __name__ == "__main__":
    from sasModeling.pointsmodelpy import pointsmodelpy
    from sasModeling.iqPy import iqPy
    from sasModeling.geoshapespy import geoshapespy

    a = geoshapespy.new_sphere(10)
    lm = pointsmodelpy.new_loresmodel(0.0005)
    pointsmodelpy.lores_add(lm, a, 1.0)
    b = geoshapespy.new_sphere(20)
    geoshapespy.set_center(b, 20, 20, 20)
    pointsmodelpy.lores_add(lm, b, -1.0)

    vp = pointsmodelpy.new_point3dvec()
    pointsmodelpy.get_lorespoints(lm, vp)

    pointsmodelpy.get_lores_pr(lm, vp)