code: def _correct_dims(data):
          
          if not hasattr(data, 'dims'):
              raise TypeError("Data must have a 'dims' attribute.")
  
          # doesn't actually copy the data underneath
          # we don't want our operations to change the user's data
          data = data.copy()
  
          if 'y' not in data.dims or 'x' not in data.dims:
              if data.ndim != 2:
                  raise ValueError("Data must have a 'y' and 'x' dimension")
  
              # rename dimensions so we can use them
              # don't rename 'x' or 'y' if they already exist
              if 'y' not in data.dims:
                  # find a dimension that isn't 'x'
                  old_dim = [d for d in data.dims if d != 'x'][0]
                  data = data.rename({old_dim: 'y'})
              if 'x' not in data.dims:
                  # find a dimension that isn't 'y'
                  old_dim = [d for d in data.dims if d != 'y'][0]
                  data = data.rename({old_dim: 'x'})
  
          if "bands" not in data.dims:
              if data.ndim <= 2:
                  data = data.expand_dims('bands')
                  data['bands'] = ['L']
              else:
                  raise ValueError("No 'bands' dimension provided.")
  
          return data
docs: Standardize dimensions to bands, y, and x.