Dear Dominik,
thank you.
That helped and things work thought the results are not fully consisten with the experiment, but it might be
some little error that I hope I will figure out myself with a more careful look at.
One more thing. To check the results I understand that I could use Q2Ang.
I expect the return values of Q2Ang should match the experimental values.
Where from the Q2Ang gets the sample orientation?
In the example xrayutilities_angular2hkl_conversion.py there is:
[om, chi, phi, tt] = hxrd.Q2Ang(mat.Q(H, K, L))
Is there a way to set the sample orientation?
Thank you
Best regards
Ruggero
> On 11 Dec 2020, at 00:37, Dominik Kriegner <dom...@gm...> wrote:
>
> Dear Ruggero,
>
> I think you seemed to look more or less in the right places. I see three problems in the the dummy script you sent:
>
> 1) I am not sure which version or xrayutilities you are using but reasonable up to date versions the material definition would need to be
> sam = xu.materials.material.Crystal('sample1', xu.materials.SGLattice(1, *abcabg))
>
> 2) Since you say you are describing a four circle machine you should likely use FourC
> hxrd = xu.FourC(sam.Q(-2, 0, 0), sam.Q(0, 0, -4), en=energy)
> you then will need to specify chi and phi in your call to Ang2HKL
>
> 3) Ang2HKL takes an optional parameter dettype [1]. This should in your case likely be set to 'area'
> h,k,l = hxrd.Ang2HKL(omega, chi, phi, towtheta, U=ubmat, dettype='area')
>
> h,k,l should then be matrices of the shape (Nch1, Nch2) for every angular position you specify. If you specify arrays of angles h,k,l will be three dimensional arrays with according dimensions.
>
> I hope this helps.
>
> kind regards
> Dominik
>
> [1] https://xrayutilities.sourceforge.io/xrayutilities.html?highlight=ang2hkl#xrayutilities.experiment.Experiment.Ang2HKL
>
> On Thu, Dec 10, 2020 at 6:38 PM ruggero frison <rug...@uz...> wrote:
> >
> > Hello,
> >
> > I would need some help, I am trying to index a frame of an Area detector into hkl coordinateds following the example provided in Appendix B of the reference paper and in some scripts provided in the example folder of the distribution.
> >
> > I have some frames of an area detector with a 4-circles Eulerian cradle.
> >
> > I paste below a dummy script, which
> > I prepared a script building on the examples but it does not give results, I do not understand why.
> > I guess because I do not understand the underlying action of xrayutilities.
> >
> > I understand that Ang2HKL would create the arrays of hkl vlaues using the experimental angles.
> > Thus I could feed it with the scan parameters I retrieve from the scan files and the UB matrix determined during the sample alignment.
> >
> > Would that work or I am getting wrong?
> >
> > I paste below a dummy script to avoid useless details.
> >
> > Thanks
> >
> > Best regards
> >
> > Ruggero
> >
> >
> > ##__set the material
> > abcabg = [a,b,c,alpha, beta, gamma]
> > sam = xru.materials.material.Crystal(’sample1', abcabg)
> >
> > ##__the UB matrix is retrieved during the experiment
> > ubmat = np.array([[1.364,-0.131,0.270],[-0.044, 1.639, 0.083],[-0.950, -0.264, 0.384]])
> >
> >
> > ##__load the frame and associated parameter file to get scan parameters,
> > omega, twotheta, chi, phi, energy, detector_distance = ...
> >
> > ##__fix detector spec
> >
> > #__define experiment geometry
> > hxrd = xru.HXRD(sam.Q(-2, 0, 0), sam.Q(0, 0, -4), en=energy)
> >
> > ##__assign orientation matrix
> > hxrd.Ang2Q.init_area('z+','x+', cch1=cpix, cch2=cpiy, Nch1=npix, Nch2=npiy,
> > pwidth1=xpix, pwidth2=ypix, distance=sam_det)
> >
> > ## conversion to h,k,l
> > h,k,l = hxrd.Ang2HKL(omega, towtheta, U=ubmat)
> >
> >
> >
> > ==================================================================
> > Ruggero Frison
> > University of Zurich, Physik Institut
> >
> > Winterthurerstrasse 190
> > CH-8057 Zurich, Switzerland
> > Office: Y36-H-76
> > Phone: +41 44 635 5780
> > ==================================================================
> >
> >
> >
> >
> > _______________________________________________
> > xrayutilities-users mailing list
> > xra...@li...
> > https://lists.sourceforge.net/lists/listinfo/xrayutilities-users
|