|
1 | 1 | from pyxlma.coords import RadarCoordinateSystem, TangentPlaneCartesianSystem, GeographicSystem |
2 | 2 | import numpy as np |
3 | 3 | import datetime as dt |
| 4 | +import pandas as pd |
4 | 5 |
|
5 | 6 |
|
6 | 7 | def rcs_to_tps(radar_latitude, radar_longitude, radar_altitude, radar_azimuth): |
@@ -248,12 +249,18 @@ def find_points_near_rhi(event_longitude, event_latitude, event_altitude, event_ |
248 | 249 | lma_dist = projected_lma[:,1] |
249 | 250 | lma_alt = projected_lma[:,2] |
250 | 251 |
|
| 252 | + if isinstance(event_time, pd.Series): |
| 253 | + event_time = event_time.values |
251 | 254 | lma_times = event_time.astype('datetime64[s]').astype(dt.datetime) |
252 | | - point_mask = (lma_dist < distance_threshold) & (np.abs(lma_times - radar_scan_time) < dt.timedelta(seconds=time_threshold)) |
| 255 | + point_mask = np.ones_like(lma_range, dtype=bool) |
| 256 | + if distance_threshold is not None: |
| 257 | + point_mask = np.logical_and(point_mask, lma_dist < distance_threshold) |
| 258 | + if time_threshold is not None: |
| 259 | + point_mask = np.logical_and(point_mask, |
| 260 | + np.abs(lma_times - radar_scan_time) < dt.timedelta(seconds=time_threshold)) |
253 | 261 | lma_range = lma_range[point_mask] |
254 | 262 | lma_dist = lma_dist[point_mask] |
255 | 263 | lma_alt = lma_alt[point_mask] |
256 | | - |
257 | 264 | return lma_range, lma_dist, lma_alt, point_mask |
258 | 265 |
|
259 | 266 |
|
|
0 commit comments