def write(self, img, start=<NUM_LIT:0>, **keys):
dims = self.get_dims()<EOL>if img.dtype.fields is not None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if img.size == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not img.flags['<STR_LIT>']:<EOL><INDENT>img_send = numpy.ascontiguousarray(img)<EOL>array_to_native(img_send, inplace=True)<EOL><DEDENT>else:<EOL><INDENT>img_send = array_to_native(img, inplace=False)<EOL><DEDENT>if IS_PY3 and img_send.dtype.char == '<STR_LIT>':<EOL><INDENT>img_send = img_send.astype('<STR_LIT:S>', copy=False)<EOL><DEDENT>if not numpy.isscalar(start):<EOL><INDENT>offset = _convert_full_start_to_offset(dims, start)<EOL><DEDENT>else:<EOL><INDENT>offset = start<EOL><DEDENT>if self.has_data():<EOL><INDENT>self._expand_if_needed(dims, img.shape, start, offset)<EOL><DEDENT>self._FITS.write_image(self._ext+<NUM_LIT:1>, img_send, offset+<NUM_LIT:1>)<EOL>self._update_info()<EOL>
Write the image into this HDU

If data already exist in this HDU, they will be overwritten.  If the
image to write is larger than the image on disk, or if the start
position is such that the write would extend beyond the existing
dimensions, the on-disk image is expanded.

parameters
----------
img: ndarray
    A simple numpy ndarray
start: integer or sequence
    Where to start writing data.  Can be an integer offset
    into the entire array, or a sequence determining where
    in N-dimensional space to start.