in apply_along_axes, empty selection -> nan (which should become masked
if we make a MaskedImage class eventually)