def offset_scenario_with_new_origin(scenario, new_origin):
        """
        Set a new origin for the whole scenario. The new origin's position in old coordinate system is recorded, so you
        can add it back and restore the raw data
        Args:
            scenario: The scenario description
            new_origin: The new origin's coordinate in old coordinate system

        Returns: modified data

        """
        new_origin = np.copy(np.asarray(new_origin))
        for track in scenario[ScenarioDescription.TRACKS].values():
            track["state"]["position"] = np.asarray(track["state"]["position"])
            track["state"]["position"][..., :2] -= new_origin

        for map_feature in scenario[ScenarioDescription.MAP_FEATURES].values():
            if "polyline" in map_feature:
                map_feature["polyline"] = np.asarray(map_feature["polyline"])
                map_feature["polyline"][..., :2] -= new_origin
            if "polygon" in map_feature:
                map_feature["polygon"] = np.asarray(map_feature["polygon"])
                map_feature["polygon"][..., :2] -= new_origin

        for light in scenario[ScenarioDescription.DYNAMIC_MAP_STATES].values():
            if ScenarioDescription.TRAFFIC_LIGHT_POSITION in light:
                light["stop_point"] = np.asarray(light["stop_point"])
                light[ScenarioDescription.TRAFFIC_LIGHT_POSITION][..., :2] -= new_origin

        scenario["metadata"]["old_origin_in_current_coordinate"] = -new_origin
        return scenario

        Set a new origin for the whole scenario. The new origin's position in old coordinate system is recorded, so you
        can add it back and restore the raw data
        Args:
            scenario: The scenario description
            new_origin: The new origin's coordinate in old coordinate system

        Returns: modified data

        
metadrive/scenario/scenario_description.py