class_docstr: Base reader for ABI L1B  L2+ NetCDF4 files.
class_docstr_tok: ["Base","reader","for","ABI","L1B","L2+","NetCDF4","files","."]
docstr: Adjust data with typing, scaling and filling.
docstr_tok: ["Adjust","data","with","typing",",","scaling","and","filling","."]
code: def _adjust_data(self, data, item):
      """Adjust data with typing, scaling and filling."""
      factor = data.attrs.get("scale_factor", 1)
      offset = data.attrs.get("add_offset", 0)
      fill = data.attrs.get("_FillValue")
      unsigned = data.attrs.get("_Unsigned", None)
  
      def is_int(val):
          return (
              np.issubdtype(val.dtype, np.integer)
              if hasattr(val, "dtype")
              else isinstance(val, int)
          )
  
      # Ref. GOESR PUG-L1B-vol3, section 5.0.2 Unsigned Integer Processing
      if unsigned is not None and unsigned.lower() == "true":
          # cast the data from int to uint
          data = data.astype("u%s" % data.dtype.itemsize)
  
          if fill is not None:
              fill = fill.astype("u%s" % fill.dtype.itemsize)
      if fill is not None:
          # Some backends (h5netcdf) may return attributes as shape (1,)
          # arrays rather than shape () scalars, which according to the netcdf
          # documentation at <URL:https://www.unidata.ucar.edu
          # /software/netcdf/docs/netcdf_data_set_components.html#attributes>
          # is correct.
          if np.ndim(fill) > 0:
              fill = fill.item()
          if is_int(data) and is_int(factor) and is_int(offset):
              new_fill = fill
          else:
              new_fill = np.float32(np.nan)
          data = data.where(data != fill, new_fill)
      if factor != 1 and item in ("x", "y"):
          # be more precise with x/y coordinates
          # see get_area_def for more information
          data = data * np.round(float(factor), 6) + np.round(
              float(offset), 6
          )
      elif factor != 1:
          data = data * np.float32(factor) + np.float32(offset)
      return data
  
imports: import logging
  import math
  from contextlib import suppress
  from datetime import datetime
  import dask
  import numpy
  import xarray
  from pyresample import geometry
  from satpy._compat import cached_property
  from satpy.readers import open_file_or_filename
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.utils import get_dask_chunk_size_in_bytes
label_desc: Use image node_id 7 for calling the NC_ABI_BASE obj's underlying member method code with example usage: obj._adjust_data(data, item) and returns: data, unknown