docstr: Get digital elevation map data for our granule with ocean fill value set to 0.
docstr_tok: ["Get","digital","elevation","map","data","for","our","granule","with","ocean","fill","value","set","to","0","."]
code: def _height_from_avg_elevation(
      self, avg_elevation: Optional[np.ndarray]
  ) -> da.Array | float:
      """Get digital elevation map data for our granule with ocean fill value set to 0."""
      if avg_elevation is None:
          LOG.debug(
              "No average elevation information provided in CREFL"
          )
          # height = np.zeros(lon.shape, dtype=np.float64)
          height = 0.0
      else:
          LOG.debug(
              "Using average elevation information provided to CREFL"
          )
          lon, lat = self._refl.attrs["area"].get_lonlats(
              chunks=self._refl.chunks
          )
          height = da.map_blocks(
              _space_mask_height,
              lon,
              lat,
              avg_elevation,
              chunks=lon.chunks,
              dtype=avg_elevation.dtype,
          )
      return height
  
imports: from __future__ import annotations
  import logging
  from typing import Optional, Type, Union
  import dask.array
  import numpy
  import xarray
  from satpy.dataset.dataid import WavelengthRange
label_desc: Use image node_id 5 for calling the _CREFLRunner obj's underlying member method code with example usage: obj._height_from_avg_elevation(avg_elevation) and returns: height