@classmethod
def from_block(cls, block, section_name, output_name=None):
    """Load kernel from cosmosis datablock"""
    if output_name == None:
        output_name = section_name
    if block.has_value(section_name, 'z_mid'):
        z_mid = block[section_name, 'z_mid']
        z_low = block[section_name, 'z_low']
        z_high = block[section_name, 'z_high']
    else:
        z_mid = block[section_name, 'z']
        dz = z_mid[2] - z_mid[1]
        z_low = z_mid - 0.5 * dz
        z_high = z_mid + 0.5 * dz
    nzs = []
    for i in range(1, 99999):
        bin_name = 'bin_%d' % i
        if block.has_value(section_name, bin_name):
            nzs.append(block[section_name, bin_name])
        else:
            break
    N = cls(output_name, z_low, z_mid, z_high, nzs)
    return N
