Descriptors are designed such that essential keyword values that describe a particular concept can be accessed from the headers of any dataset in a consistent manner, regardless of which instrument was used to obtain the data. This is particularly useful for Gemini data, since the majority of keywords used to describe a particular concept at Gemini are not uniform between the instruments.
airmass
amp_read_area
array_section
azimuth
bias_level
camera
cass_rotator_pa
central_wavelength
coadds
data_label
data_section
decker
dec
detector_name
detector_roi_setting
detector_rois_requested
detector_section
detector_x_bin
detector_y_bin
disperser
dispersion_axis
dispersion
elevation
exposure_time
filter_name
focal_plane_mask
gain
gain_setting
grating
group_id
instrument
local_time
mdf_row_id
nod_count
nod_pixels
nominal_atmospheric_extinction
nominal_photometric_zeropoint
non_linear_level
object
observation_class
observation_epoch
observation_id
observation_type
overscan_section
pixel_scale
prism
program_id
pupil_mask
qa_state
ra
raw_bg
raw_cc
raw_iq
raw_wv
read_mode
read_noise
read_speed_setting
requested_bg
requested_cc
requested_iq
requested_wv
saturation_level
slit
telescope
ut_date
ut_datetime
ut_time
wavefront_sensor
wavelength_band
wavelength_reference_pixel
well_depth_setting
x_offset
y_offset
The example function below is auto-generated by the mkCalculatorInterface script. The CalculatorInterface_GEMINI.py file should never be edited directly.
def airmass(self, format=None, **args):
"""
Return the airmass value
:param dataset: the data set
:type dataset: AstroData
:param format: the return format
:type format: string
:rtype: float as default (i.e., format=None)
:return: the mean airmass of the observation
"""
try:
self._lazyloadCalculator()
keydict = self.descriptor_calculator._specifickey_dict
key = "key_airmass"
keyword = None
if key in keydict.keys():
keyword = keydict[key]
if not hasattr(self.descriptor_calculator, "airmass"):
if keyword is not None:
retval = self.phu_get_key_value(keyword)
if retval is None:
if hasattr(self, "exception_info"):
raise Errors.DescriptorError(self.exception_info)
else:
msg = ("Unable to find an appropriate descriptor "
"function or a default keyword for airmass")
raise Errors.DescriptorError(msg)
else:
try:
retval = self.descriptor_calculator.airmass(self, **args)
except Exception as e:
raise Errors.DescriptorError(e)
ret = DescriptorValue( retval,
format = format,
name = "airmass",
keyword = keyword,
ad = self,
pytype = float )
return ret
except Errors.DescriptorError:
if self.descriptor_calculator.throwExceptions == True:
raise
else:
if not hasattr(self, \"exception_info\"):
setattr(self, \"exception_info\", sys.exc_info()[1])
return None
except:
raise
from astrodata import Errors
from GMOS_Keywords import GMOS_KeyDict
from GEMINI_Descriptors import GEMINI_DescriptorCalc
class GMOS_DescriptorCalc(GEMINI_DescriptorCalc):
# Updating the global key dictionary with the local key dictionary
# associated with this descriptor class
_update_stdkey_dict = GMOS_KeyDict
def __init__(self):
GEMINI_DescriptorCalc.__init__(self)
def detector_x_bin(self, dataset, **args):
# Since this descriptor function accesses keywords in the headers of
# the pixel data extensions, always return a dictionary where the key
# of the dictionary is an (EXTNAME, EXTVER) tuple
ret_detector_x_bin = {}
# Determine the ccdsum keyword from the global keyword dictionary
keyword = self.get_descriptor_key("key_ccdsum")
# Get the value of the ccdsum keyword from the header of each pixel
# data extension as a dictionary
ccdsum_dict = gmu.get_key_value_dict(dataset, keyword)
if ccdsum_dict is None:
# The get_key_value_dict() function returns None if a value
# cannot be found and stores the exception info. Re-raise the
# exception. It will be dealt with by the CalculatorInterface.
if hasattr(dataset, "exception_info"):
raise dataset.exception_info
for ext_name_ver, ccdsum in ccdsum_dict.iteritems():
if ccdsum is None:
detector_x_bin = None
else:
# Use the binning of the x-axis integer as the value
detector_x_bin, detector_y_bin = ccdsum.split()
# Update the dictionary with the binning of the x-axis value
ret_detector_x_bin.update({ext_name_ver:detector_x_bin})
return ret_detector_x_bin