Skip to content

Commit

Permalink
actually prettify central_wavelength instead of just faking it. previ…
Browse files Browse the repository at this point in the history
…ous commit did not do the job.
  • Loading branch information
KathleenLabrie committed Sep 12, 2023
1 parent 3784ad7 commit 5f4fa42
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gemini_instruments/gmos/adclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,17 @@ def central_wavelength(self, asMicrometers=False, asNanometers=False,
if central_wavelength <= 0.0:
return None
else:
converted_central_wavelength = \
gmu.convert_units('nanometers', central_wavelength,
output_units)
if pretty:
# round it up to the nearest Angstrom.
central_wavelength = round(central_wavelength*1e10)/1e10
power = gmu.unitDict[output_units] - gmu.unitDict['angstroms']
factor = math.pow(10, power)
converted_central_wavelength = round(converted_central_wavelength*factor)/factor

return converted_central_wavelength

return gmu.convert_units('nanometers', central_wavelength,
output_units)

@astro_data_descriptor
def detector_name(self, pretty=False):
Expand Down

0 comments on commit 5f4fa42

Please sign in to comment.