HEXRD / hexrd

A cross-platform, open-source library for the analysis of X-ray diffraction data.
Other
56 stars 25 forks source link

Origin keyword foes nothing for planar detectors #575

Open saransh13 opened 10 months ago

saransh13 commented 10 months ago

For the planar_detector.pixel_angles function, passing the origin keyword does not change the results at all.

ZackAttack614 commented 1 month ago

@donald-e-boyce do you have any insight into this? This is related to the tVec_c variable in the detectorXYToGvec function, in old_xfcapi.

donald-e-boyce commented 1 month ago

Not really sure at this point. Trying to track it down led me to the old_capi C code. Digging down, I see tvec_c gets used in detectorXYToGvec_cfunc in setting up the tvec_1 argument. So it should do something, but I don't really understand how the python interface is set up though for the old C-API.

One comment though: in the gvec_to_xy, the input gvec is in crystal components, while in xy_to_gvec, the output gvec is in lab components and doesn't take rmat_c the crystal rotation, but it does take tvec_c the crystal translation. It needs to know the beam source, so tvec-c should make a difference.

  /* Compute shift vector */
  for (j=0; j<3; j++) {
    tVec1[j] = tVec_d[j]-tVec_s[j];
    for (k=0; k<3; k++) {
      tVec1[j] -= rMat_s[3*j+k]*tVec_c[k];
    }
  }

  for (i=0; i<npts; i++) {
        detectorXYToGVecOne_cfunc(xy+2*i, rMat_d, rMat_e, tVec1, bVec, tTh + i, eta + i, gVec_l + 3*i);
    }