'Size (in bytes) of the data portion of the HDU.'

@property
def size(self):

    size = 0
    naxis = self._header.get('NAXIS', 0)
    if (naxis > 0):
        size = 1
        for idx in range(naxis):
            size = (size * self._header[('NAXIS' + str((idx + 1)))])
        bitpix = self._header['BITPIX']
        gcount = self._header.get('GCOUNT', 1)
        pcount = self._header.get('PCOUNT', 0)
        size = (((abs(bitpix) * gcount) * (pcount + size)) // 8)
    return size
