I suggest two changes to fix the conversion from SOFA HRIRs to DAFF files:
The HRIRs are only zero-padded if their lengths are not divisible by 4.
When the source positions of the SOFA file given in degrees are recalculated in radians, small numerical inaccuracies arise. This leads to counting too many angles as "unique" and therefore changing the grid of directions. The result is a dataset with a lot more HRIR directions than before (filled with nearest neighbour impulse responses). I suggest to use the default tolerance of
unique()to fix this.
What do you think?