code: def update_ebounds(hdu_in, hdu=None):
      
      if hdu is None:
          hdu = fits.BinTableHDU(
              data=hdu_in.data, header=hdu_in.header, name=hdu_in.name)
      else:
          for col in ['CHANNEL', 'E_MIN', 'E_MAX']:
              if (hdu.data[col] != hdu_in.data[col]).any():
                  raise ValueError("Energy bounds do not match : %s %s" %
                                   (hdu.data[col], hdu_in.data[col]))
      return hdu
docs: 'Update' the EBOUNDS HDU
  
      This checks hdu exists and creates it from hdu_in if it does not.
      If hdu does exist, this raises an exception if it doesn not match hdu_in