Beispiel #1
0
	if dims[2]>1:
		self.size3 = dims[2]
	else:
		self.size3 = 1
	self.dx=1./self.size1
	self.dy=1./self.size2
	self.dz=1./self.size3

	r=nd.mgrid[ (self.size1-1)*self.dx:-self.dx:-self.dx, \
		    0:self.size2*self.dy:self.dy, 0:self.size3*self.dz:self.dz]

	r.shape=3,self.size1*self.size2*self.size3
	r=r.transpose()

	self.coords = nd.dot(r, self.T)
#	print coords

	return self.coords

if __name__=="__main__":


  coord=CoordSystem()
  coord.exec_param_file("/Users/rharder/PhasingProjects/pp310/22/phasingparams.py")
  coord.GetCoordSystem( (3,3,3) )
  coord.configure_traits()

  import cstuff as c
  ccoord=c.Sp4Array()
  c.ThCoordTrans(ccoord, 3, 3, 3, .13933 ,30.5*m.pi/180, 1.0*m.pi/180, 20e-6/1.78, 40e-6/1.78, .005*m.pi/180,1.0/3,1.0/3,1.0/3, c.DIRECT)
Beispiel #2
0
#c.ExtractArray(support, supcrop, size1/2-extractX/2, extractX, size2/2-extractY/2, extractY,size3/2-extractZ/2, extractZ)

size1 = c.Sp4ArrayGetDim(dDcrop,0)[1]
size2 = c.Sp4ArrayGetDim(dDcrop,1)[1]
size3 = c.Sp4ArrayGetDim(dDcrop,2)[1]

#define the dimensions in real space
dx = 1.0/c.Sp4ArrayGetDim(diffData,0)[1]
dy = 1.0/c.Sp4ArrayGetDim(diffData,1)[1]
dz = 1.0/c.Sp4ArrayGetDim(diffData,2)[1]

print size1,size2,size3

#Translate coordinates
if dtilt ==0.0:
	 c.ThCoordTrans(NewCoords, size1, size2, size3, lam, delta, gam, dpx, dpy, dth,dx ,dy,dz,c.DIRECT)
	 print "theta rocking curve coordinate tranform"
elif dth == 0.0:
	 c.TiltCoordTrans(NewCoords, size1, size2, size3, lam, delta, gam, dpx, dpy, dtilt,dx,dy,dz,c.DIRECT)
	 print "chi rocking curve coordinate transform"
else:
	 print "dth/dtilt has been set incorrectly"


#Ross added the Q-vector output 3/08
c.ShiftCoordOrigin(NewCoords, size1/2, size2/2, size3/2)

s1=filename		#seqdata.filenameroot+"dist%04d"%seqdata.iterationscompleted

#s='%d_Support_%dPC-HIO_%dPO-ER'%(SequenceNumber,numHIOiter,numERiter)
#s=seqdata.filenameroot+"_Support"