docs: def get_axis_map(ds, variable):
      '''
      Returns an axis_map dictionary that contains an axis key and the coordinate
      names as values.
  
      For example::
  
          {'X': ['longitude'], 'Y': ['latitude'], 'T': ['time']}
  
      The axis C is for compressed coordinates like a reduced grid, and U is for
      unknown axis. This can sometimes be physical quantities representing a
      continuous discrete axis, like temperature or density.
  
      :param netCDF4.Dataset nc: An open netCDF dataset
      :param str variable: Variable name
      '''
      all_coords = get_coordinate_variables(ds) + get_auxiliary_coordinate_variables(ds)
  
      latitudes = get_latitude_variables(ds)
      longitudes = get_longitude_variables(ds)
      times = get_time_variables(ds)
      heights = get_z_variables(ds)
  
      coordinates = getattr(ds.variables[variable], "coordinates", None)
      if not isinstance(coordinates, basestring):
          coordinates = ''
  
      # For example
      # {'x': ['longitude'], 'y': ['latitude'], 't': ['time']}
      axis_map = defaultdict(list)
      for coord_name in all_coords:
          if is_compression_coordinate(ds, coord_name):
              axis = 'C'
          elif coord_name in times:
              axis = 'T'
          elif coord_name in longitudes:
              axis = 'X'
          elif coord_name in latitudes:
              axis = 'Y'
          elif coord_name in heights:
              axis = 'Z'
          else:
              axis = 'U'
  
          if coord_name in ds.variables[variable].dimensions:
              if coord_name not in axis_map[axis]:
                  axis_map[axis].append(coord_name)
  
          elif coord_name in coordinates:
              if coord_name not in axis_map[axis]:
                  axis_map[axis].append(coord_name)
      return axis_map