code: def _get_coordinatenames(self):
          
          validnames = ("direction", "spectral", "linear", "stokes", "tabular")
          self._names = [""] * len(validnames)
          n = 0
          for key in self._csys.keys():
              for name in validnames:
                  if key.startswith(name):
                      idx = int(key[len(name):])
                      self._names[idx] = name
                      n += 1
          # reverse as we are c order in python
          self._names = self._names[:n][::-1]
  
          if len(self._names) == 0:
              raise LookupError("Coordinate record doesn't contain valid coordinates")
docs: Create ordered list of coordinate names