Engineering Diffraction Interface doesn't recalculate Van Norm Focus if one with the correct name is already in the ADS #38879
Labels
Bug
Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)
Diffraction
Issues and pull requests related to diffraction
Milestone
Describe the bug
Bug found when changing the
Custom Cal File
implementation in Engineering Diffraction.Currently, when you supply a
Custom CalFile
in Crop Calibration and then hitCalibrate
the ADS is populated with files with the suffix_Custom
.When you then run focus, the Vanadium focussing checks to see if
engggui_curves_Custom
exists and if so, just loads it in, otherwise it calculates it.This means if you run a calibration for a custom
.cal
file and focus it, then change your mind and rerun the calibration with a different custom.cal
file, when you now focus again, it will use the original calibration.This is also a problem (probably more so) for using the
Crop to Spectra
Fortunately, for
Custom CalFiles
if there are different numbers of detector groups in the two custom files you get an errorError in execution of algorithm Divide: Number of histograms not identical.
, but if you happen to provide the same number of groups (like Crop To Spectra which always combines spectra into one group) you would likely not notice and it can make a big difference to the intensities:To Reproduce
You can create some custom cal files using:
Custom Cal Files:
Create New Calibration
305738
Crop Calibration
Custom CalFile
Custom CalFile
to(rf"{tmp_dir}/example_cal_file.cal"
305761
307521
Custom CalFile
to(rf"{tmp_dir}/third_cal_file.cal"
305761
307521
Custom CalFile
to(rf"{tmp_dir}/example_cal_file.cal"
305761
307521
Custom CalFile
to(rf"{tmp_dir}/another_cal_file.cal"
305761
307521
Custom Crop To Spectra:
Create New Calibration
305738
Crop Calibration
Crop To Spectra
Custom Spectra
to2-102
305761
307521
Custom Spectra
to500-900
305761
307521
Custom Spectra
back to2-102
305761
307521
Expected behavior
Each time you run a calibration, you should expect to use that calibration for focussing, regardless of what junk is already in the ADS
Screenshots
Platform/Version (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: