code: def putData(self,data=None,exten=None):
          
  
          if data is None:
              log.warning("No data supplied")
          else:
              extnum = _interpretExten(exten)
              ext = self._image[extnum]
              # update the bitpix to the current datatype, this aint fancy and
              # ignores bscale
              ext.header['BITPIX'] = _NUMPY_TO_IRAF_DTYPES[data.dtype.name]
              ext.data = data
docs: Now that we are removing the data from the object to save memory,
              we need something that cleanly puts the data array back into
              the object so that we can write out everything together  using
              something like fits.writeto....this method is an attempt to
              make sure that when you add an array back to the .data section
              of the hdu it still matches the header information for that
              section ( ie. update the bitpix to reflect the datatype of the
              array you are adding). The other header stuff is up to you to verify.
  
              Data should be the data array exten is where you want to stick it,
              either extension number or a string like 'sci,1'