class_docstr: File handler for MODIS HDF-EOS Level 2 files.
  
  Includes error handling for files produced by IMAPP produced files.
class_docstr_tok: ["File","handler","for","MODIS","HDF-EOS","Level","2","files",".","Includes","error","handling","for","files","produced","by","IMAPP","produced","files","."]
docstr: Load a dataset from HDF-EOS level 2 file.
docstr_tok: ["Load","a","dataset","from","HDF-EOS","level","2","file","."]
code: def _select_hdf_dataset(self, hdf_dataset_name, byte_dimension):
      """Load a dataset from HDF-EOS level 2 file."""
      dataset = self.sd.select(hdf_dataset_name)
      dask_arr = from_sds(dataset, chunks=CHUNK_SIZE)
      attrs = dataset.attributes()
      dims = ["y", "x"]
      if byte_dimension == 0:
          dims = ["i", "y", "x"]
          dask_arr = dask_arr.astype(np.uint8)
      elif byte_dimension == 2:
          dims = ["y", "x", "i"]
          dask_arr = dask_arr.astype(np.uint8)
      dataset = xr.DataArray(dask_arr, dims=dims, attrs=attrs)
      if "i" in dataset.dims:
          # Reorder dimensions for consistency
          dataset = dataset.transpose("i", "y", "x")
      return dataset
  
imports: import logging
  import dask.array
  import numpy
  import xarray
  from satpy.readers.hdf4_utils import from_sds
  from satpy.readers.hdfeos_base import HDFEOSGeoReader
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 6 for calling the ModisL2HDFFileHandler obj's underlying member method code with example usage: obj._select_hdf_dataset(hdf_dataset_name, byte_dimension) and returns: dataset