code: def _countEXT(self,extname="SCI"):
          
          count=0 #simple fits image
  
          if (self._image['PRIMARY'].header["EXTEND"]):
              for i,hdu in enumerate(self._image):
                  if i > 0:
                      hduExtname = False
                      if 'EXTNAME' in hdu.header:
                          self._image[i].extnum=i
                          self._image[i].extname=hdu.header["EXTNAME"]
                          hduExtname = True
                      if 'EXTVER' in hdu.header:
                          self._image[i].extver=hdu.header["EXTVER"]
                      else:
                          self._image[i].extver = 1
  
                      if ((extname is not None) and \
                              (hduExtname and (hdu.header["EXTNAME"] == extname))) \
                              or extname is None:
                          count=count+1
          return count
docs: Count the number of extensions in the file with the given name
          (``EXTNAME``).