hexrd icon indicating copy to clipboard operation
hexrd copied to clipboard

Origin keyword foes nothing for planar detectors

Open saransh13 opened this issue 2 years ago • 2 comments

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

saransh13 avatar Nov 07 '23 03:11 saransh13

@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.

ZackAttack614 avatar Jul 30 '24 18:07 ZackAttack614

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);
    }

donald-e-boyce avatar Jul 30 '24 20:07 donald-e-boyce