<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_FITS_cols(infile, cols=None):
 # noqa: N802 """ Read columns from FITS table """

    with fits.open(infile, memmap=False) as ftab:
        extnum = 0
        extfound = False
        for extn in ftab:
            if 'tfields' in extn.header:
                extfound = True
                break
            extnum += 1

        if not extfound:
            print('ERROR: No catalog table found in ', infile)
            raise ValueError

        # Now, read columns from the table in this extension if no column names
        # were provided by user, simply read in all columns from table
        if _is_str_none(cols[0]) is None:
            cols = ftab[extnum].data.names

        # Define the output
        outarr = [ftab[extnum].data.field(c) for c in cols]

    return outarr