Open epaillas opened 4 months ago
Hi! This astype call was to keep the same input type (float32 vs float64). I agree we need to enforce float!
def __call__(self, distance):
"""Return (interpolated) redshift at distance ``distance`` (scalar or array)."""
distance = np.asarray(distance)
if not np.issubdtype(distance.dtype, np.floating): distance = distance.astype(np.float64)
return self.interp(distance).astype(distance.dtype, copy=False)
Do you want to push this?
If you provide an integer to the DistanceToRedshift utility function, it will always spit out an integer redshift:
which I don't think is desired. This is probably caused by the
astype
call function, which I guess you introduced to distinguish between arrays and scalars:Maybe adding a
distance = float(distance)
somewhere internally would take care of this?