Closed kevinsmia1939 closed 1 year ago
Which kind of background are you using? Seems working fine with tougaard as well as with tougaard+ polynomial as well as with using active shirley.
I assume, that the problem occurs using static backgrounds? For static backgrounds, the concept of keeping the background fixed does not make so much sense, because using static backgrounds calculates the background and removes it before starting the actual fitting procedure.
However, I assume the error needs to be catched and we need explanation for that. If you want to try out a set of shirley parameters, you could use the active shirley and then tick the 'keep backgorund fixed' option as a workaround :)
I think I might have chosen static shirley bg which crash it. So I think simple grey out the fixed bg check box should be fine.
I found that if I add this,
def clickOnBtnBG(self):
checked_actions = [action for action in self.bgMenu.actions() if action.isChecked()]
idx_bg = set()
for checked_action in checked_actions:
if checked_action.text() == '&Static &Shirley BG':
idx_bg.add(0)
self.fixedBG.setChecked(False)
self.fixedBG.setEnabled(False)
The fixed bg button is disable when static sherley is selected, but I don't know how to enable when select back to active.
Solved for now, but I think about fixing the problem using a different approach in the future. The crash is caused by the params being None if only static backgrounds were used. Maybe its much more elegant if we check whether the params are None and if yes ignore the given condition and only apply the fixed background to all other background parameters.
We need to check btw if both static backgrounds are checked and take care if such a case occurs. Saving it for later here because it's closely connected to the topic.
I experience crashing when I check "keep background fixed" and try to fit two or more peaks.