def check_hdu_table(self):
    'Checks for the HDU index table.'
    t = self.data_store.hdu_table
    m = t.meta
    if (m.get('HDUCLAS1', '') != 'INDEX'):
        (yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS1=INDEX'})
    if (m.get('HDUCLAS2', '') != 'HDU'):
        (yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS2=HDU'})
    for idx in range(len(t)):
        location_info = t.location_info(idx)
        try:
            location_info.get_hdu()
        except KeyError:
            (yield {'level': 'error', 'msg': 'HDU not found: {!r}'.format(location_info.__dict__)})
Checks for the HDU index table.
def check_hdu_table(self):
    
    t = self.data_store.hdu_table
    m = t.meta
    if (m.get('HDUCLAS1', ) != 'INDEX'):
        (yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS1=INDEX'})
    if (m.get('HDUCLAS2', ) != 'HDU'):
        (yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS2=HDU'})
    for idx in range(len(t)):
        location_info = t.location_info(idx)
        try:
            location_info.get_hdu()
        except KeyError:
            (yield {'level': 'error', 'msg': 'HDU not found: {!r}'.format(location_info.__dict__)})