Skip to content

Commit

Permalink
corrected block data type now converted in to_rio_dataset()
Browse files Browse the repository at this point in the history
  • Loading branch information
dugalh committed Feb 20, 2024
1 parent d41c9ad commit 31e05c1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions homonim/fuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def create_out_profile(
dtype: str, optional
Output image data type. One of: uint8|uint16|int16|uint32|int32|float32|float64.
nodata: float, optional
Output image nodata value.
Output image nodata value. If set to None, an internal mask is written (recommended when
``creation_options`` are configured for lossy, e.g. JPEG, compression).
creation_options: dict, optional
Driver specific creation options e.g. ``dict(compression='deflate')``.
See the `GDAL docs <https://gdal.org/drivers/raster/index.html>`_ for available keys and values.
Expand Down Expand Up @@ -304,10 +305,8 @@ def _process_block(
param_ra = model.fit(src_ra, ref_ra)
corr_ra = model.apply(src_ra, param_ra)

# convert corrected dtype and change nodata value for corr_im
corr_ra.convert_dtype(corr_im.dtypes[0], nodata=corr_im.nodata)

with self._corr_lock: # write the corrected block
# write the corrected block
with self._corr_lock:
corr_ra.to_rio_dataset(corr_im, indexes=block_pair.band_i + 1, window=block_pair.src_out_block)

if param_im:
Expand Down

0 comments on commit 31e05c1

Please sign in to comment.