Several of the field angle projections explicitly handle (u,v) = (0,0) as a special case for scalar u and v, but cause floating-point errors when (u,v) = (0,0) is included via array args:
np.seterr(all='raise')
for proj in 'postel', 'zemax', 'gnomonic', 'stereographic', 'lambert', 'orthographic':
try:
batoid.utils.fieldToDirCos(0., 0., projection=proj)
except FloatingPointError:
print(f'{proj} failed with scalar')
try:
batoid.utils.fieldToDirCos(np.zeros(3), 0., projection=proj)
except FloatingPointError:
print(f'{proj} failed with array')
The results are:
postel failed with array
stereographic failed with array
lambert failed with array
Several of the field angle projections explicitly handle (u,v) = (0,0) as a special case for scalar u and v, but cause floating-point errors when (u,v) = (0,0) is included via array args:
The results are: