code: def simplify(
          self,
          tolerance: float,
          altitude: Optional[str] = None,
          z_factor: float = 3.048,
          return_type: Type[Mask] = Type["Flight"],
      ) -> Mask:
          
          # returns a mask
          mask = douglas_peucker(
              df=self.data,
              tolerance=tolerance,
              lat="latitude",
              lon="longitude",
              z=altitude,
              z_factor=z_factor,
          )
          if return_type == Type["Flight"]:
              return self.__class__(self.data.loc[mask])
          else:
              return mask
docs: Simplifies a trajectory with Douglas-Peucker algorithm.
  
          The method uses latitude and longitude, projects the trajectory to a
          conformal projection and applies the algorithm. By default, a 2D version
          is called, unless you pass a column name for altitude (z parameter). You
          may scale the z-axis for more relevance (z_factor); the default value
          works well in most situations.
  
          The method returns a Flight unless you specify a np.ndarray[bool] as
          return_type for getting a mask.