Skip to content

Commit

Permalink
add a pretty argument to central_wavelength for GMOS to help with the…
Browse files Browse the repository at this point in the history
… group_id when the float representation.
  • Loading branch information
KathleenLabrie committed Sep 12, 2023
1 parent 70f95b9 commit 3784ad7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gemini_instruments/gmos/adclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def array_name(self):
return self.hdr.get('AMPNAME')

@astro_data_descriptor
def central_wavelength(self, asMicrometers=False, asNanometers=False, asAngstroms=False):
def central_wavelength(self, asMicrometers=False, asNanometers=False,
asAngstroms=False, pretty=False):
"""
Returns the central wavelength in meters or specified units
Expand All @@ -219,6 +220,8 @@ def central_wavelength(self, asMicrometers=False, asNanometers=False, asAngstrom
If True, return the wavelength in nanometers
asAngstroms : bool
If True, return the wavelength in Angstroms
pretty : bool
If True, return a round up value to the nearest Angstrom.
Returns
-------
Expand Down Expand Up @@ -249,6 +252,10 @@ def central_wavelength(self, asMicrometers=False, asNanometers=False, asAngstrom
if central_wavelength <= 0.0:
return None
else:
if pretty:
# round it up to the nearest Angstrom.
central_wavelength = round(central_wavelength*1e10)/1e10

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

Expand Down Expand Up @@ -703,7 +710,7 @@ def group_id(self):
unique_id_descriptor_list_all.append('disperser')

# List to format descriptor calls using 'pretty=True' parameter
call_pretty_version_list = ['filter_name', 'disperser']
call_pretty_version_list = ['filter_name', 'disperser', 'central_wavelength']

# Force this to be a list
force_list = ['amp_read_area']
Expand Down

0 comments on commit 3784ad7

Please sign in to comment.