DiamondLightSource / fast_dp

Fast DP: Fast Data Processsing with XDS
https://pypi.python.org/pypi/fast_dp
Apache License 2.0
7 stars 12 forks source link

refined beam x and y flipped? #53

Open dsclassen opened 2 years ago

dsclassen commented 2 years ago

If you look at line 306-309 of fast_dp.py:

            self._refined_beam = (
                beam_pixels[1] * float(self._xds_inp["QY"]),
                beam_pixels[0] * float(self._xds_inp["QX"]),
            )

It appears to me that the refined beam is being ordered with Y first and X second. I think this is propagating into the fast_dp.xml file where refinedXBeam and refinedYBeam are swapped with respect to the starting values. SynchWeb (master branch) has been written to accept these swapped beam centres, but the changes that were made to Synchweb in order to display things properly for fast_dp means that, at least for me, the other pipeline results (autoPROC, xia2-3d, xia2-dials) indicate a badly misaligned beam_xy in my image headers... which I know they are not.

graeme-winter commented 2 years ago

Fair call

I'll suspect that this is because the beam centres in ISPyB were written in the "mosflm" convention i.e. y, x (or slow, fast) but XDS works as x, y (i.e. fast, slow)

However, the number of transpositions to use may have been lost in the mists of time. I will check. I hae a feeling though that this "works for us" unless we have another nasty swap somewhere.

dsclassen commented 2 years ago

This is the "fix" in SyncWeb client/src/js/templates/dc/dc_autoproc.html that I was referring to:

                <th>Beam Centre</th>
                <th>X</th>
                <th>Y</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Start</td>
                <td><%- BEAM.XBEAM ? BEAM.XBEAM : '- -' %></td>
                <td><%- BEAM.YBEAM ? BEAM.YBEAM : '- -' %></td>
            </tr>
            <!-- these are flipped, not sure why? -->
            <tr>
                <td>Refined</td>
                <td><%- BEAM.REFINEDYBEAM ? BEAM.REFINEDYBEAM : '- -' %></td>
                <td><%- BEAM.REFINEDXBEAM ? BEAM.REFINEDXBEAM : '- -' %></td>
            </tr>

...and some dubious delta calculations a few lines below:

                <td>&Delta;</td>
                <td><%- BEAM.REFINEDYBEAM && BEAM.XBEAM ? (BEAM.XBEAM - BEAM.REFINEDYBEAM).toFixed(2) : '- -' %></td>
                <td><%- BEAM.YBEAM && BEAM.REFINEDXBEAM ? (BEAM.YBEAM - BEAM.REFINEDXBEAM).toFixed(2) : '- -' %></td>

Ultimately, I think this doesn't affect the processed data - just the presentation within SyncWeb.