class_docstr: Class for testing enhancements in satpy.enhancements.
class_docstr_tok: ["Class","for","testing","enhancements","in","satpy.enhancements","."]
docstr: Test the colorize enhancement function.
code: def test_colorize(self):
      """Test the colorize enhancement function."""
      from trollimage.colormap import brbg
  
      from satpy.enhancements import colorize
  
      expected = np.array(
          [
              [
                  [
                      np.nan,
                      3.29411723e-01,
                      3.29411723e-01,
                      3.21825881e-08,
                      3.21825881e-08,
                  ],
                  [
                      3.21825881e-08,
                      3.21825881e-08,
                      3.21825881e-08,
                      3.21825881e-08,
                      3.21825881e-08,
                  ],
              ],
              [
                  [
                      np.nan,
                      1.88235327e-01,
                      1.88235327e-01,
                      2.35294109e-01,
                      2.35294109e-01,
                  ],
                  [
                      2.35294109e-01,
                      2.35294109e-01,
                      2.35294109e-01,
                      2.35294109e-01,
                      2.35294109e-01,
                  ],
              ],
              [
                  [
                      np.nan,
                      1.96078164e-02,
                      1.96078164e-02,
                      1.88235281e-01,
                      1.88235281e-01,
                  ],
                  [
                      1.88235281e-01,
                      1.88235281e-01,
                      1.88235281e-01,
                      1.88235281e-01,
                      1.88235281e-01,
                  ],
              ],
          ]
      )
      run_and_check_enhancement(
          colorize, self.ch1, expected, palettes=brbg
      )
  
imports: import contextlib
  import os
  from tempfile import NamedTemporaryFile
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.enhancements import create_colormap, on_dask_array, on_separate_bands, using_map_blocks
label_desc: Use image node_id 6 for calling the TestEnhancementStretch obj's underlying member method code with example usage: obj.test_colorize() without return types