title: How to write tiff file using rasterio?
body: <p>In the code below, I  am trying to write a dataset. The <code>GTiff</code> file has data and the image is clear but when I run the below code, the result of</p>
  <pre><code>dataset.write(total.astype(rasterio.uint16), 1)
  </code></pre>
  <p>is a black image.</p>
  <p>Please let me know how to read part of a <code>tiff</code> file and write it to a file.</p>
  <p><strong>code</strong>:</p>
  <pre><code>import rasterio
  from rasterio.transform import from_origin
  from rasterio.windows import Window
  import rasterio.features
  import rasterio.warp
  import numpy as np
  
  with rasterio.open('M:/tiffs/MOS_EU_LAEA_2000/MOS_EU_LAEA_2000.tif', 'w+', driver='GTiff', height='360', width='360', count=3, dtype='uint16', transform=from_origin(-180.0, 90.0, 9.5, 9.5)) as dataset:
      print(dataset)
      r,g,b = dataset.read()
      print(r)
      print(g)
      print(b)
  
      total = np.zeros(r.shape)
      print(total)
      for band in r, g, b:
          total += band
      total /= 3
      print(dataset.profile)
      dataset.write(total.astype(rasterio.uint16), 1)
  </code></pre>