warning on division by zero in exposure filter
the evaluation of exp_filt[idx] += np.exp( -expi / ( 2 * ( (a * freqs**b) + c ) ) )
in the exposure filter (src/pygsg/filter/_exposure.py) results in a divide by zero
warning. This is since the variable freqs
is a frequency space grid with 0.0 at index (0,0,0) and b
by default is -1.665
. The other variables are as follows
expo = wedgelist["exposure"]
a,b,c = wedgelist.get("crit_exp_param", (0.245, -1.665, 2.81))
whereas expi
is expo[i]
. Depending on the values of these variable different conditions would need to be checked in order to make the above evaluation warning-less. In case b
is by definition negative it would be enough to mask the computation of freqs**b
and set the overall result of exp_filt at the masked indices to 0.0
. But in case b
can also be positive it becomes more complicated. what would be the desired behavior?