class_docstr: Base class used as parent for the concrete LI reader classes.
class_docstr_tok: ["Base","class","used","as","parent","for","the","concrete","LI","reader","classes","."]
docstr: Apply the use_rescaling transform on a given array.
docstr_tok: ["Apply","the","use_rescaling","transform","on","a","given","array","."]
code: def apply_use_rescaling(self, data_array, ds_info=None):
      """Apply the use_rescaling transform on a given array."""
      # Here we should apply the rescaling except if it is explicitly requested not to rescale
      if (
          ds_info is not None
          and ds_info.get("use_rescaling", True) is not True
      ):
          return data_array
  
      # Check if we have the scaling elements:
      attribs = data_array.attrs
      if (
          "scale_factor" in attribs
          or "scaling_factor" in attribs
          or "add_offset" in attribs
      ):
          # TODO remove scaling_factor fallback after issue in NetCDF is fixed
          scale_factor = attribs.setdefault(
              "scale_factor", attribs.get("scaling_factor", 1)
          )
          add_offset = attribs.setdefault("add_offset", 0)
  
          data_array = (data_array * scale_factor) + add_offset
  
          # rescale the valid range accordingly
          if "valid_range" in attribs.keys():
              attribs["valid_range"] = (
                  attribs["valid_range"] * scale_factor + add_offset
              )
  
      data_array.attrs.update(attribs)
  
      return data_array
  
imports: import logging
  import re
  import dask.array
  import netCDF4
  import numpy
  import xarray
  from pyproj import Proj
  from satpy.readers.netcdf_utils import NetCDF4FileHandler
label_desc: Use image node_id 26 for calling the LINCFileHandler obj's underlying member method code with example usage: obj.apply_use_rescaling(data_array, ds_info) and returns: data_array, data_array