Description
Hi @willend,
I was trying to debug a weird behavior of Source_gen4
component with a flux_file
, when I found out that the root of the problem was in Table_value
returning the wrong value for the flux from the table. The file Lambda/Brilliance I was using had a constant step of 0.1 AA and the values of Lambda in decreasing order from 15AA to 0.2 AA. Now this is what was happening:
Source_gen4
extracts a lambda between Lmin and Lmax, let's say 1.9AA- When
Source_gen4
callsTable_value
to fix the weight, the constant-time lookup is satisfiedMcCode/common/lib/share/read_table-lib.c
Lines 837 to 842 in 7f77bfb
- This ultimately breaks when the code checks for the linear search
McCode/common/lib/share/read_table-lib.c
Lines 862 to 870 in 7f77bfb
So it seems to me that the function requires monotonically increasing X bins to work, but this is neither enforced anywhere nor documented (as far as I could search). So maybe a flag could be added in 'Table_value' or 'Table_Stat' ?
I could help with that in case,
Best
Nico