class_docstr: Base reader for ABI L1B  L2+ NetCDF4 files.
class_docstr_tok: ["Base","reader","for","ABI","L1B","L2+","NetCDF4","files","."]
docstr: Get a best-guess optimal chunk size for resolution-based chunking.
  
  First a chunk size is chosen for the provided Dask setting `array.chunk-size`
  and then aligned with a hardcoded on-disk chunk size of 226. This is then
  adjusted to match the current resolution.
  
  This should result in 500 meter data having 4 times as many pixels per
  dask array chunk (2 in each dimension) as 1km data and 8 times as many
  as 2km data. As data is combined or upsampled geographically the arrays
  should not need to be rechunked. Care is taken to make sure that array
  chunks are aligned with on-disk file chunks at all resolutions, but at
  the cost of flexibility due to a hardcoded on-disk chunk size of 226
  elements per dimension.
docstr_tok: ["Get","a","best-guess","optimal","chunk","size","for","resolution-based","chunking",".","First","a","chunk","size","is","chosen","for","the","provided","Dask","setting","`","array.chunk-size","`","and","then","aligned","with","a","hardcoded","on-disk","chunk","size","of","226",".","This","is","then","adjusted","to","match","the","current","resolution",".","This","should","result","in","500","meter","data","having","4","times","as","many","pixels","per","dask","array","chunk","(","2","in","each","dimension",")","as","1km","data","and","8","times","as","many","as","2km","data",".","As","data","is","combined","or","upsampled","geographically","the","arrays","should","not","need","to","be","rechunked",".","Care","is","taken","to","make","sure","that","array","chunks","are","aligned","with","on-disk","file","chunks","at","all","resolutions",",","but","at","the","cost","of","flexibility","due","to","a","hardcoded","on-disk","chunk","size","of","226","elements","per","dimension","."]
code: def _chunk_bytes_for_resolution(self) -> int:
      """Get a best-guess optimal chunk size for resolution-based chunking.
  
      First a chunk size is chosen for the provided Dask setting `array.chunk-size`
      and then aligned with a hardcoded on-disk chunk size of 226. This is then
      adjusted to match the current resolution.
  
      This should result in 500 meter data having 4 times as many pixels per
      dask array chunk (2 in each dimension) as 1km data and 8 times as many
      as 2km data. As data is combined or upsampled geographically the arrays
      should not need to be rechunked. Care is taken to make sure that array
      chunks are aligned with on-disk file chunks at all resolutions, but at
      the cost of flexibility due to a hardcoded on-disk chunk size of 226
      elements per dimension.
  
      """
      num_high_res_elems_per_dim = math.sqrt(
          get_dask_chunk_size_in_bytes() / 4
      )  # 32-bit floats
      # assume on-disk chunk size of 226
      # this is true for all CSPP Geo GRB output (226 for all sectors) and full disk from other sources
      # 250 has been seen for AWS/CLASS CONUS, Mesoscale 1, and Mesoscale 2 files
      # we align this with 4 on-disk chunks at 500m, so it will be 2 on-disk chunks for 1km, and 1 for 2km
      high_res_elems_disk_aligned = round(
          max(num_high_res_elems_per_dim / (4 * 226), 1)
      ) * (4 * 226)
      low_res_factor = int(
          self.filetype_info.get("resolution", 2000) // 500
      )
      res_elems_per_dim = int(
          high_res_elems_disk_aligned / low_res_factor
      )
      return (res_elems_per_dim**2) * 2
  
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 3 for calling the NC_ABI_BASE obj's underlying member method code with example usage: obj._chunk_bytes_for_resolution() and returns: unknown