@@ -36,6 +36,8 @@ def export_scenario_to_yaml(
3636 "description" : description
3737 or f"Exported on { datetime .now ().strftime ('%Y-%m-%d %H:%M' )} " ,
3838 "version" : "1.0" ,
39+ "duration_seconds" : max (float (engine .current_time ), float (engine .dt )),
40+ "update_rate_hz" : 1.0 / float (engine .dt ),
3941 },
4042 "radar" : _extract_radar_config (engine ),
4143 "targets" : _extract_targets (engine ),
@@ -66,10 +68,24 @@ def _extract_radar_config(engine) -> Dict[str, Any]:
6668 radar = engine .radar
6769
6870 return {
71+ "name" : str (radar .radar_id ),
72+ "type" : "pulse_doppler" ,
6973 "frequency_hz" : float (radar .frequency_hz ),
7074 "power_watts" : float (radar .power_watts ),
71- "antenna_gain_db" : float (radar .antenna_gain_db ),
72- "beamwidth_deg" : float (radar .beamwidth_deg ),
75+ "antenna" : {
76+ "gain_db" : float (radar .antenna_gain_db ),
77+ "beamwidth_az_deg" : float (radar .to_dict ()["beamwidth_deg" ]),
78+ "beamwidth_el_deg" : float (radar .to_dict ()["beamwidth_el_deg" ]),
79+ "polarization_tilt_deg" : float (radar .polarization_tilt_deg ),
80+ },
81+ "receiver" : {
82+ "noise_figure_db" : float (radar .noise_figure_db ),
83+ "bandwidth_hz" : float (radar .receiver_bandwidth_hz ),
84+ "system_temperature_k" : float (radar .system_temperature_k ),
85+ },
86+ "prf_hz" : float (radar .prf_hz ),
87+ "pulse_width_s" : float (radar .pulse_width_s ),
88+ "system_losses_db" : float (radar .system_losses_db ),
7389 "scan_rate_rpm" : float (radar .scan_rate_rpm ),
7490 "position" : {
7591 "x_m" : float (radar .position [0 ]),
@@ -85,19 +101,19 @@ def _extract_targets(engine) -> list:
85101
86102 for t in engine .targets :
87103 target_data = {
88- "id " : int (t .target_id ),
104+ "name " : f"Target_ { int (t .target_id )} " ,
89105 "type" : str (getattr (t , "target_type" , "aircraft" )),
90- "position_m " : {
91- "x " : float (t .position [0 ]),
92- "y " : float (t .position [1 ]),
93- "z " : float (t .position [2 ]) if len (t .position ) > 2 else 0.0 ,
106+ "initial_position " : {
107+ "x_m " : float (t .position [0 ]),
108+ "y_m " : float (t .position [1 ]),
109+ "z_m " : float (t .position [2 ]) if len (t .position ) > 2 else 0.0 ,
94110 },
95- "velocity_mps " : {
96- "vx " : float (t .velocity [0 ]),
97- "vy " : float (t .velocity [1 ]),
98- "vz " : float (t .velocity [2 ]) if len (t .velocity ) > 2 else 0.0 ,
111+ "velocity " : {
112+ "vx_mps " : float (t .velocity [0 ]),
113+ "vy_mps " : float (t .velocity [1 ]),
114+ "vz_mps " : float (t .velocity [2 ]) if len (t .velocity ) > 2 else 0.0 ,
99115 },
100- "rcs_m2" : float (t .rcs_m2 ),
116+ "rcs_m2" : float (t .rcs_mean ),
101117 "swerling_model" : (
102118 int (t .swerling_model .value )
103119 if hasattr (t .swerling_model , "value" )
@@ -107,10 +123,14 @@ def _extract_targets(engine) -> list:
107123
108124 # Optional jammer settings
109125 if hasattr (t , "jammer_active" ) and t .jammer_active :
110- target_data ["jammer" ] = {
111- "active" : True ,
112- "power_watts" : float (getattr (t , "jammer_power" , 1000 )),
113- }
126+ target_data ["has_ecm" ] = True
127+ target_data ["ecm_type" ] = str (getattr (t , "ecm_type" , "noise_barrage" ))
128+ target_data ["ecm_power_watts" ] = float (
129+ getattr (t , "jammer_power_watts" , 1000 )
130+ )
131+ target_data ["ecm_bandwidth_hz" ] = float (
132+ getattr (t , "jammer_bandwidth_hz" , 100e6 )
133+ )
114134
115135 targets .append (target_data )
116136
@@ -121,9 +141,14 @@ def _extract_environment(engine) -> Dict[str, Any]:
121141 """Extract environment settings from engine."""
122142 env = {
123143 "enable_atmospheric" : bool (engine .enable_atmospheric ),
144+ "temperature_c" : float (engine .atmospheric_temperature_c ),
145+ "pressure_hpa" : float (engine .atmospheric_pressure_hpa ),
146+ "water_vapor_gpm3" : float (engine .water_vapor_density_g_m3 ),
147+ "rain_rate_mm_hr" : float (engine .rain_rate_mm_hr ),
124148 "clutter" : {
125149 "enabled" : bool (getattr (engine , "clutter_enabled" , False )),
126150 "terrain_type" : str (getattr (engine , "terrain_type" , "rural" )),
151+ "sea_state" : int (getattr (engine , "sea_state" , 0 )),
127152 },
128153 }
129154
@@ -140,8 +165,10 @@ def _extract_environment(engine) -> Dict[str, Any]:
140165def _extract_simulation_params (engine ) -> Dict [str , Any ]:
141166 """Extract simulation parameters from engine."""
142167 params = {
143- "dt" : float (engine .dt ),
144- "detection_threshold_db" : float (engine .detection_threshold_db ),
168+ "enable_atmospheric_loss" : bool (engine .enable_atmospheric ),
169+ "enable_clutter" : bool (engine .clutter_enabled ),
170+ "pfa" : float (engine .probability_false_alarm ),
171+ "pulses_integrated" : int (engine .pulses_integrated ),
145172 }
146173
147174 # Advanced features
0 commit comments