code: def to_czml(
      traffic: Union[Traffic, SO6],
      filename: Union[str, Path],
      minimum_time: Optional[timelike] = None,
  ) -> None:
      
  
      if isinstance(traffic, Traffic):
          if "baro_altitude" in traffic.data.columns:
              traffic = traffic.query("baro_altitude == baro_altitude")
          elif "altitude" in traffic.data.columns:
              traffic = traffic.query("altitude == altitude")
  
      if minimum_time is not None:
          minimum_time = to_datetime(minimum_time)
          traffic = cast(Traffic, traffic.query(f"timestamp >= '{minimum_time}'"))
  
      if isinstance(filename, str):
          filename = Path(filename)
  
      if not filename.parent.exists():
          filename.parent.mkdir(parents=True)
  
      start = format_ts(traffic.start_time)
      availability = f"{start}/{format_ts(traffic.end_time)}"
      export = [
          {
              "id": "document",
              "name": f"Traffic_{start}",
              "version": "1.0",
              "author": getpass.getuser(),
              "clock": {
                  "interval": availability,
                  "currentTime": start,
                  "multiplier": _CZML_Params.default_time_multiplier,
              },
          }
      ]
      for flight in traffic:
          for elt in export_flight(flight):
              export.append(elt)
  
      with filename.open("w") as fh:
          json.dump(export, fh, indent=2)
  
      logging.info(f"Scenario file {filename} written")
docs: Generates a CesiumJS scenario file.