Skip to content

Commit

Permalink
ENH: add antenna_transition to the testing module's sample objects
Browse files Browse the repository at this point in the history
  • Loading branch information
isilber committed Dec 6, 2023
1 parent e197ab2 commit 83e2e16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pyart/testing/sample_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def make_empty_ppi_radar(ngates, rays_per_sweep, nsweeps):
sweep_end_ray_index = get_metadata("sweep_end_ray_index")
azimuth = get_metadata("azimuth")
elevation = get_metadata("elevation")
antenna_transition = get_metadata("antenna_transition")

fields = {}
scan_type = "ppi"
Expand All @@ -76,6 +77,7 @@ def make_empty_ppi_radar(ngates, rays_per_sweep, nsweeps):
sweep_end_ray_index["data"] = np.arange(
rays_per_sweep - 1, nrays, rays_per_sweep, dtype="int32"
)
antenna_transition["data"] = np.zeros(nrays)

azimuth["data"] = np.arange(nrays, dtype="float32")
elevation["data"] = np.array([0.75] * nrays, dtype="float32")
Expand All @@ -96,6 +98,7 @@ def make_empty_ppi_radar(ngates, rays_per_sweep, nsweeps):
sweep_end_ray_index,
azimuth,
elevation,
antenna_transition=antenna_transition,
instrument_parameters=None,
)

Expand Down
2 changes: 1 addition & 1 deletion pyart/util/radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def determine_sweeps(radar, max_offset=0.1, running_win_dt=5.0, deg_rng=(-5.0, 3
]
radar.fixed_angle["data"] = ma.array(fixed_angle, dtype="float32")
radar.nsweeps = len(sweep_number)
transition = np.zeros(radar.antenna_transition["data"].size)
transition = np.zeros(radar.nrays)
for i in range(radar.nsweeps):
if i == 0:
transition[: sweep_start_index[i]] = 1
Expand Down

0 comments on commit 83e2e16

Please sign in to comment.