nexusformat / definitions

Definitions of the NeXus Standard File Structure and Contents
https://manual.nexusformat.org/
Other
26 stars 55 forks source link

NXslit: transformation with respect to custom reference frame #1270

Open woutdenolf opened 1 year ago

woutdenolf commented 1 year ago

I have an energy-dispersive X-ray detector with slits in front of it. I want to position them with respect to a custom reference frame (see code below). Two things are unclear:

  1. According to the docs the Z-axis is perpendicular to the slit. If the reference frame is chosen to be "beam along X and gravity along -Z", does this mean I first need to rotate the slits around [0, 1, 0] with 90 degrees so that the beam is perpendicular to the slits?

  2. When defining the directions of gravity and beam, I set the value of the transformation dataset to 'nan' because it is irrelevant (we define a direction, not a translation or rotation). Is that the correct?

PeterC-DLS commented 1 year ago

See NXbeam for how to define its direction.

woutdenolf commented 1 year ago

As for point 2

DIRECTION: (optional) [NX_NUMBER](https://manual.nexusformat.org/nxdl-types.html#nx-number) {units=[NX_TRANSFORMATION](https://manual.nexusformat.org/nxdl-types.html#nx-transformation)}

    Direction of beam vector, its value is ignored. If missing, then the beam direction is defined as [0,0,1] and passes through the origin

    @transformation_type: (optional) [NX_CHAR](https://manual.nexusformat.org/nxdl-types.html#nx-char)

        Obligatory value: translation

Direction of beam vector, its value is ignored

So yes I can choose NaN.

woutdenolf commented 1 year ago

See NXbeam for how to define its direction.

I guess this refers to point 1. Not sure how. Can you give an example of a slit perpendicular to the beam on the sample positition for a reference frame with "+X the beam direction and -Z in the direction of gravity"?

PeterC-DLS commented 1 year ago

No, I meant point 2. For point 1, I think if you use a different coordinate system then you could depend on the local beam direction or add a normal direction, and also add the slit orientation.