This might be a very niche error but I'm just recording it in case anyone else experiences the same issue, and for my own reference if it happens again.
I've found that the curve_fit() used in calib_base.CalibData.fit_calib_data() is not producing a good fit for a dataset of mine. One possible reason for the issue is that I use an empty cell for calibration, so essentially 0 cm-2 and when this is used as the initial guess for curve_fit() it doesn't seem to change with the fitting procedure and all fits are driven through this point, or very close too it (almost like forcing the fit through the origin). Line 467 in calib_base.py is where this guess is defined guess[-1] = min(cds) . I have found that changing this to avoid using the smallest value as the first guess resulted in the fits looking much more like they should: guess[-1] = max(cds). Perhaps this isn't ideal, but I didn't notice any detrimental impact on speed. This may also only be an issue in this specific case (or another possibility is that I have done something wrong elsewhere which is creating this issue...), so I don't know whether it is worth changing in the pyplis code..
This might be a very niche error but I'm just recording it in case anyone else experiences the same issue, and for my own reference if it happens again.
I've found that the
curve_fit()
used incalib_base.CalibData.fit_calib_data()
is not producing a good fit for a dataset of mine. One possible reason for the issue is that I use an empty cell for calibration, so essentially 0 cm-2 and when this is used as the initial guess forcurve_fit()
it doesn't seem to change with the fitting procedure and all fits are driven through this point, or very close too it (almost like forcing the fit through the origin).Line 467
incalib_base.py
is where this guess is definedguess[-1] = min(cds)
. I have found that changing this to avoid using the smallest value as the first guess resulted in the fits looking much more like they should:guess[-1] = max(cds)
. Perhaps this isn't ideal, but I didn't notice any detrimental impact on speed. This may also only be an issue in this specific case (or another possibility is that I have done something wrong elsewhere which is creating this issue...), so I don't know whether it is worth changing in the pyplis code..