class_docstr: Test the GeoTIFF Writer class.
class_docstr_tok: ["Test","the","GeoTIFF","Writer","class","."]
docstr: Test that geotiffs can be written as floats and convert units.
docstr_tok: ["Test","that","geotiffs","can","be","written","as","floats","and","convert","units","."]
code: def test_float_write_with_unit_conversion(self, tmp_path):
      """Test that geotiffs can be written as floats and convert units."""
      from satpy.writers.geotiff import GeoTIFFWriter
  
      dataset = _get_test_datasets_2d()[0]
      dtype = np.float32
      w = GeoTIFFWriter(base_dir=tmp_path, enhance=False, dtype=dtype)
      filename = tmp_path / "data_in_C.tif"
      w.save_dataset(dataset, filename=filename, units="degC")
      ds = xr.open_dataset(filename, engine="rasterio")
      assert ds["band_data"].dtype == dtype
      np.testing.assert_allclose(ds["band_data"], -273.15)
  
imports: from datetime import datetime
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
label_desc: Use image node_id 12 for calling the TestGeoTIFFWriter obj's underlying member method code with example usage: obj.test_float_write_with_unit_conversion(tmp_path) without return types