'Substitute IERS B values with those from a real IERS B table.
IERS-A has IERS-B values included, but for reasons unknown these
do not match the latest IERS-B values (see comments in #4436).
Here, we use the bundled astropy IERS-B table to overwrite the values
in the downloaded IERS-A table.'

@classmethod
def _substitute_iers_b(cls, table):

    iers_b = IERS_B.open()
    mjd_b = table[u'MJD'][(~ table[u'UT1_UTC_B'].mask)]
    i0 = np.searchsorted(iers_b[u'MJD'].value, mjd_b[0], side=u'left')
    i1 = np.searchsorted(iers_b[u'MJD'].value, mjd_b[(-1)], side=u'right')
    iers_b = iers_b[i0:i1]
    n_iers_b = len(iers_b)
    if (n_iers_b > 0):
        if (not np.allclose(table[u'MJD'][:n_iers_b], iers_b[u'MJD'].value)):
            raise ValueError(u'unexpected    mismatch    when    copying    IERS-B    values    into    IERS-A    table.')
        table[u'UT1_UTC_B'][:n_iers_b] = iers_b[u'UT1_UTC'].value
        table[u'PM_X_B'][:n_iers_b] = iers_b[u'PM_x'].value
        table[u'PM_Y_B'][:n_iers_b] = iers_b[u'PM_y'].value
    return table
