Lua math.pow deprecated from 5.3 on
I am processing an HBA calibrator scan and during the aoflagging part the lofar-default.lua
RFI strategy crashed with the following error:
/data2/sweijen/Quasar_Anniek/LINC_calibrator/LINC/rfistrategies/lofar-default.lua:41: attempt to call a nil value (field 'pow')
/data2/sweijen/Quasar_Anniek/LINC_calibrator/LINC/rfistrategies/lofar-default.lua:41: attempt to call a nil value (field 'pow')
/data2/sweijen/Quasar_Anniek/LINC_calibrator/LINC/rfistrategies/lofar-default.lua:41: attempt to call a nil value (field 'pow')
/data2/sweijen/Quasar_Anniek/LINC_calibrator/LINC/rfistrategies/lofar-default.lua:41: attempt to call a nil value (field 'pow')
An unhandled exception occured: An exception occured in the parallel (multi-threaded) processing of the baselines: the RFI strategy will not continue.
If you think this is a bug, please contact offringa@gmail.com
Following https://www.lua.org/manual/5.3/manual.html#8.2, it seems math.pow
is deprecated since 5.3 and my container contains happens to contain Lua 5.4. Adding the small function
function math.pow(x,y) return x^y end
at the top of the strategy fixes the crash. I'm not sure how far backwards compatible this is, but Lua 5.1.4 (outside my container) didn't seem to mind either redefining the function nor using ^
as a power operator from a very quick test.
Does LINC have a minimum/maximum Lua version requirement?