Skip to content

Commit

Permalink
silly float precision...
Browse files Browse the repository at this point in the history
  • Loading branch information
teutoburg committed Aug 29, 2023
1 parent e6db1a1 commit bbe822c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scopesim/optics/fov.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,15 @@ def waveset(self):
else:
_waveset = self.waverange * u.um

_waveset = np.unique(_waveset)
return _waveset.to(u.um)
# TODO: tie the round to a global precision setting (this is defined
# better in another TODO somewhere...)
# The rounding is necessary to not end up with things like:
# 0.7 um
# 0.7000000000000001 um
# 0.7000000000000002 um
# and yes, that actually happend...
_waveset = np.unique(_waveset.to(u.um).round(10))
return _waveset

@property
def cube_fields(self):
Expand Down

0 comments on commit bbe822c

Please sign in to comment.