[GH2][Correct] Gain constant needs to be float32
This fixes the reported issue at https://redmine.xfel.eu/issues/147905
Description
Corrections were failing because the Cython correction function expected float32 constants. As the gain constant was injected as float64, I made sure that the gain constant is converted to the right type before being used for correction.
Marco was also notified and he will make sure that notebook is injecting gain constant of the expected type.
How Has This Been Tested?
Tested locally and hotfixed in production
Relevant Documents (optional)
Types of changes
- Bug fix (non-breaking change which fixes an issue)
Checklist:
Reviewers
Merge request reports
Activity
assigned to @ahmedk
326 326 " mask[index, ...],\n", 327 327 " g,\n", 328 328 " const_data[mod][\"Offset\"],\n", 329 " const_data[mod][\"RelativeGain\"],\n", 329 " const_data[mod][\"RelativeGain\"].astype(np.float32),\n", This should save making a new array if it's already the right dtype. From the docs:
By default, astype always returns a newly allocated array. If this is set to false, and the dtype, order, and subok requirements are satisfied, the input array is returned instead of a copy.
changed this line in version 2 of the diff
enabled an automatic merge when the pipeline for bd593655 succeeds
mentioned in commit 43af30c3