def METHOD_NAME(
    traffic: Union[None, Traffic, SO6],
    filename: Union[str, Path],
    minimum_time: Optional[timelike] = None,
) -> None:
    """Generates a CesiumJS scenario file."""
    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 traffic is not None and minimum_time is not None:
        minimum_time = to_datetime(minimum_time)
        traffic = traffic.query(f"timestamp >= '{minimum_time}'")
    if isinstance(filename, str):
        filename = Path(filename)
    if not filename.parent.exists():
        filename.parent.mkdir(parents=True)
    assert traffic is not None
    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)
    _log.info(f"Scenario file {filename} written")