@@ -542,7 +542,7 @@ def GetDetectorXY2(dsp,azm,data):
542542 radius = (P + Q )/ R
543543 xy = np .array ([radius * cosd (azm ),radius * sind (azm )])
544544 xy += cent
545- else : #hyperbola - both branches (one is way off screen!)
545+ else : #hyperbola - both branches (one is way off screen!) - not correct
546546 sinb = abs (sind (tilt ))
547547 tanb = abs (tand (tilt ))
548548 f = dist * tanb * stth / (cosb + stth )
@@ -556,21 +556,13 @@ def GetDetectorXY2(dsp,azm,data):
556556 else :
557557 offset = - f
558558 xy = [- R * cosd (azm - phi )- offset ,2. * R * sind (azm - phi )]
559- print (azm ,R ,offset ,cosd (azm - phi ),sind (azm - phi ),xy )
559+ print (azm ,ecc , R ,offset ,cosd (azm - phi ),sind (azm - phi ),xy )
560560 xy = - np .array ([xy [0 ]* cosd (phi )+ xy [1 ]* sind (phi ),xy [0 ]* sind (phi )- xy [1 ]* cosd (phi )])
561561 xy += cent
562562 if data ['det2theta' ]:
563563 xy [0 ] += dist * nptand (data ['det2theta' ]+ data ['tilt' ]* npsind (data ['rotation' ]))
564564 return xy
565565
566- # def GetDetXYfromThAzm(Th,Azm,data):
567- # '''Computes a detector position from a 2theta angle and an azimultal
568- # angle (both in degrees) - apparently not used!
569- # '''
570- # dsp = data['wavelength']/(2.0*npsind(Th))
571- # return GetDetectorXY(dsp,Azm,data)
572-
573- # this suite not used for integration - only image plotting & mask positioning
574566def GetTthAzmDsp2 (x ,y ,data ): #expensive
575567 '''Computes a 2theta, etc. from a detector position and calibration constants - checked
576568 OK for ellipses & hyperbola.
@@ -1647,7 +1639,7 @@ def ImageIntegrate(image,data,masks,blkSize=128,returnN=False,useTA=None,useMask
16471639 if 'SASD' not in data ['type' ]:
16481640 H0 *= np .array (G2pwd .Polarization (data ['PolaVal' ][0 ],H2 [:- 1 ],0. )[0 ])
16491641 # if np.abs(data['det2theta']) < 1.0: #small angle approx only; not appropriate for detectors at large 2-theta
1650- H0 /= np .abs (npcosd (H2 [:- 1 ]- np .abs (data ['det2theta' ])))** 4 #parallax correction (why **4?)
1642+ H0 /= np .abs (npcosd (H2 [:- 1 ]+ data [ 'tilt' ] - np .abs (data ['det2theta' ])))** 4 #parallax correction (why **4?)
16511643 if 'SASD' in data ['type' ]:
16521644 H0 /= npcosd (H2 [:- 1 ]) #one more for small angle scattering data?
16531645 if data ['Oblique' ][1 ]:
0 commit comments