You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting physical to digital sample arrays, we must replace NaN
values with the appropriate invalid-sample sentinel value.
To do this, we need to call np.isnan and use the result as a mask to
replace entries in the output array. (Although the function
np.nan_to_num also exists, it's less efficient: it literally does just
this, but also handles infinities.)
What we don't need to do is to call any() to check whether there are
any true entries - that just means we're iterating through the same
array three times rather than once. Furthermore, np.copyto can
broadcast d_nans across the rows of p_signal, so all the channels can
be handled at once.
Also use copyto in adc_inplace_1d for consistency.
0 commit comments