Analytic functions with blackbody

See #3077 
But if you look inside `nan_to_num` you see the same type of mask being created, for `NaN`, `inf`, `-inf`. And all that on a copy of the input. So, it will in fact take longer and use more memory...  That said, please do check the above is safe for scalars... I think you may need
```
if flux.isscalar:
    return flux if flux != np.nan else 0.:
```