docs: def map_frames(self, old_indices):
          '''Rewrite the feature indexes based on the next frame's identities
  
          old_indices - for each feature in the new frame, the index of the
                        old feature
          '''
          nfeatures = len(old_indices)
          noldfeatures = len(self.state_vec)
          if nfeatures > 0:
              self.state_vec = self.state_vec[old_indices]
              self.state_cov = self.state_cov[old_indices]
              self.noise_var = self.noise_var[old_indices]
              if self.has_cached_obs_vec:
                  self.obs_vec = self.obs_vec[old_indices]
              if self.has_cached_predicted_state_vec:
                  self.p_state_vec = self.p_state_vec[old_indices]
              if len(self.state_noise_idx) > 0:
                  #
                  # We have to renumber the new_state_noise indices and get rid
                  # of those that don't map to numbers. Typical index trick here:
                  # * create an array for each legal old element: -1 = no match
                  # * give each old element in the array the new number
                  # * Filter out the "no match" elements.
                  #
                  reverse_indices = -np.ones(noldfeatures, int)
                  reverse_indices[old_indices] = np.arange(nfeatures)
                  self.state_noise_idx = reverse_indices[self.state_noise_idx]
                  self.state_noise = self.state_noise[self.state_noise_idx != -1,:]
                  self.state_noise_idx = self.state_noise_idx[self.state_noise_idx != -1]