class_docstr: Implementation class for the unified LI L2 satpy reader.
class_docstr_tok: ["Implementation","class","for","the","unified","LI","L2","satpy","reader","."]
docstr: Obtain the accumulated products as a (sparse) 2-d array.
  
  The array has the shape of the FCI 2 km grid (5568x5568px),
  and will have an AreaDefinition attached.
docstr_tok: ["Obtain","the","accumulated","products","as","a","(","sparse",")","2-d","array",".","The","array","has","the","shape","of","the","FCI","2","km","grid","(","5568x5568px",")",",","and","will","have","an","AreaDefinition","attached","."]
code: def get_array_on_fci_grid(self, data_array: xr.DataArray):
      """Obtain the accumulated products as a (sparse) 2-d array.
  
      The array has the shape of the FCI 2 km grid (5568x5568px),
      and will have an AreaDefinition attached.
      """
      # Integer values without the application of scale_factor and add_offset
      # hence no projection/index calculation.
      # Note that x and y have origin in the south-west corner of the image
      # and start with index 1.
  
      rows = self.get_measured_variable("y")
      cols = self.get_measured_variable("x")
      attrs = data_array.attrs
  
      rows, cols = da.compute(rows, cols)
  
      # origin is in the south-west corner, so we flip the rows (applying
      # offset of 1 implicitly)
      # And we manually offset the columns by 1 too:
      rows = LI_GRID_SHAPE[0] - rows.astype(int)
      cols = cols.astype(int) - 1
  
      # Create an empyt 1-D array for the results
      flattened_result = np.nan * da.zeros(
          (LI_GRID_SHAPE[0] * LI_GRID_SHAPE[1]), dtype=data_array.dtype
      )
      # Insert the data. Dask doesn't support this for more than one dimension at a time, so ...
      flattened_result[rows * LI_GRID_SHAPE[0] + cols] = data_array
      # ... reshape to final 2D grid
      data_2d = da.reshape(flattened_result, LI_GRID_SHAPE)
      xarr = xr.DataArray(
          da.asarray(data_2d, CHUNK_SIZE), dims=("y", "x")
      )
      xarr.attrs = attrs
  
      return xarr
  
file_path: satpy/satpy/readers/li_l2_nc.py
imports: import logging
  import dask.array
  import numpy
  import xarray
  from satpy.readers.li_base_nc import LINCFileHandler
  from satpy.resample import get_area_def
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 5 for calling the LIL2NCFileHandler obj's underlying member method code with example usage: obj.get_array_on_fci_grid(data_array) and returns: xarr