MJOLNIRPackage / MJOLNIR

Neutron scattering software to be used at Multiplexing Joint Organization
Mozilla Public License 2.0
4 stars 5 forks source link

Tutorial Plotting a Q plane for constant energy: reverse axis? #31

Closed SJanas closed 5 years ago

SJanas commented 5 years ago

Using the Tutorial on Plotting a Q plane for constant energy for non-rectangular rlu. Plotting axis appear reversed. When setting ax.set_xlim(-2,3) ax.set_ylim(-2,3) I seem to get a reverse y-axis going from -3 (top) to +2 (bottom) instead: figure0

Might be intended behaviour, but was not as expected :)

Jakob-Lass commented 5 years ago

There are two possible issues in the above:

  1. The values on the axis are not agreeing completely with the provided limits Setting the axis manually might result in unforeseen limits as the axis itself uses the instrument view to plot and the limits are thus in units of 1/AA. Instead one could make use of the custom method ax.set_axis(v1,v2) taking two HKL vectors as input. This will then calculate the corresponding lengths in actually 1/A units such that the two vectors are inside of the axis.
  2. The values on the y-axis are negative This stems from the fact that during the calculation of the scattering plane, the maximal value of a reciprocal lattice vector in the plane is chosen to be positive. As to not mirror the actual measurement points (possibly obscuring instrument effects) the y-axis becomes negative. This can be changed if needed.
Jakob-Lass commented 5 years ago

Keeping the axis positive and the projection vector with its original sign is achieved in bff944507f4d3b6b5ba9a5e213ec61c98ad3336d. This might then results in axis where projection vectors are both negative. More padding is also introduced to avoid overlab between colorbar and the added tick marks to the right of RLU axes (82e9d8042c61166c9536f82472207f3aa99f8828).