Prevent warnings during direction reconstruction

Do additional checks for possible invalid values.
e.g. prevent devision by zero and invalid values for arcsin..
Set theta/phi to nan first then assign the reconstructed value, if
possible.
Update reference to equation for theta in Fokkema2012.

This should ensure that Travis tests do not hang on warnings.