This page documents the history of releases, including bug identification and resolution.
Version 2.0.8, Released 2022-05-04
#11 in Bitbucket issue tracker (NaN for lowest energy bin in certain circumstances)
#7 in Bitbucket issue tracker (added a docstring for the init method of the Spek() class)
No previous predictions should be modified due to the update, although, depending on precise inputs (kvp, dk, shift), there may be one less energy bin (the first bin is dropped if the lower bin limit is not higher than 1 keV).
Version 2.0.7, Released 2022-01-19
Minor release correcting some small bugs and adding functionality etc.
Additions. Addition of an extra physics mode called 'classical'. This is the same as 'uni' except for it uses Kramers' classical thin target bremsstrahlung cross-section instead of the NIST cross-section. This was included for educational reasons, to support material in our forthcoming book.
Bug fix. Corrected a bug that manifested when exporting a spectra elsewhere than the current working directory. Many thanks to Josef Lundman for pointing this out.
Bug fix. While correcting the export bug, I noticed an issue with loading a spectrum from a file when running SpekPy in an interpreter (rather than from a script). Now corrected.
Bug fix. Dialogue with a user brought to light a bug in the characteristic spectrum. A very small contribution was present in the maximum energy bin for physics models including L-lines. This occurred because the lowest L1 line has an energy lower than 1 keV (the array index ended up as -1). Now fixed. Thanks to Scott Elliott for the discussion leading to this bug fix.
Behaviour change. If a path isn't specified the export/import of a spectrum to/from a file uses the current working directory rather than the directory of the script.
Other. Changed the way spectrum results are passed to the methods of the state class (now explicitly passed to methods rather than adding to state object in ad hoc fashion). No behaviour change, but the code is less horrible!
Version 2.0.6, Released 2021-10-06
Bug fix. The density of uranium (U.comp) is corrected. It was a factor 10 too low. Thanks go to Andy Soundy for bringing this to our attention.
Change in default behaviour. The default for get_kerma() is to provide output as uGy rather than uGy per mAs (the default for the "norm" keyword is now False). Thanks go to "Former user" for bringing the inconsistency with the summarize() method to our attention.
Bug fix. In physics='kqp' mode, if a z value was passed to a method, SpekPy threw an error. This has now been corrected.
Improvement. show_states() and show_matls() now output entries alphabetically
Addition. Copies of some materials have been added with short names: Water, Concrete, Lexan, Mylar, Perspex, Delrin, Teflon, Cellophane, Kapton. Thanks go to "Former user" for the suggestion.
Addition. The get_spectrum() method now has an extra keyword "addend". When set to True, it adds an extra bin to the spectrum array, to include a zero fluence point. Sometimes this is useful for plotting spectra
Version 2.0.5, Released 2021-05-19
Bug fix. The use of the function scipy.interpolate.interp1d was causing an error, for some versions of scipy. The only observed problem was for mu_data_source="pene", for Pb, at photon energies just below the K-edge (around 80-88 keV). Solved in this release.
Thanks go to Lidiane Évora dos Reis for pointing out the bug.
Version 2.0.4, Released 2021-04-11
Two minor additions to assist in comparison of SpekPy with external spectra:
(1) A new optional keyword parameter, sig, has been added for the get_spectrum() method. The energy resolution of the predictions are degraded by a Gaussian of the requested width. This allows predictions to be matched to the resolution of a detector (Full-Width-Half-Maximum = 2.355 x sig). NB: this addition was suggested by an anonymous reviewer.
(2) A new optional keyword parameter, shift, has been added for the Spek class. This allows the bin centres to be shifted by up to +/- 0.5 times the bin width. The bin centres in SpekPy were chosen for good reasons, but it was annoying when they did not coincide with other spectra (other models or measured).
Version 2.0.3, Released 2020-12-15
Additional electron penetration data added. Initial energies tabulated are now: (20, 30, 40, 50, 75, 100, 150, 300 keV) for tungsten and (20, 25, 30, 35, 50 keV) for Mo/Rh.
Changes in the interpolation between energies (for e.g. kerma and HVL) should be minimal in all cases (much less than 1%).
The lower limit on the tube potential for the v2 models is now reduced to 20 kV for tungsten (from 30 kV previously).
Version 2.0.2, Released 2020-12-04
Improved interpolation between tabulated incident electron energies (30, 50, 75, 100, 150, 300 keV) for the physics models added in version 2. This only affects the total fluence, not the spectrum shape, and the total fluence remains unchanged for tube potentials corresponding to the initial electron energies above.
Version 2.0.1, Released 2020-07-05
Very minor revision. The online Jupyter notebook displayed a warning in Version 2.0.0, due to a deprecated feature in the NumPy library. This has been corrected.
Version 2.0.0, Released 2020-07-03
Major upgrade based on Omar et al. (2020) Part I and Part II (see references). Extra physics models have been added and the default model has changed.
In the new physics modes ('casim' is the new default) the model covers tungsten anodes (30 to 300 kV) and molybdenum and rhodium anodes (20 to 50 kV). All the new models incorporate the improved characterstic x-ray model of Omar et al. (2018) (see references).
The new methods get_eflu (to return energy fluence) and get_hvl (which returns same result as get_hvl1()) have been added. The method get_spectrum now has additional optional inputs allowing the energy-fluence spectrum to be returned as well as the non-differential fluence and energy-fluence spectra (i.e. number of photons per bin not number per keV).
Backwards compatability with v1 has been maintained, except that if no physics model was previously specified, to get the same results you must now specify: physics='spekpy-v1' or equivalently (though not recommended because the name is misleading) physics='default'.
Version 1.0.1, Released 2019-11-06
Minor bug fix (get_matl: see issue).
Version 1.0.0, Released 2019-11-04
Initial public release.