Skip to content

Commit 34012cd

Browse files
committed
Fixes
1 parent fe90340 commit 34012cd

4 files changed

Lines changed: 33 additions & 16 deletions

File tree

gpm/etc/colorbars/xradar.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ reflectivity:
1111
cbar:
1212
extend: both
1313
extendfrac: 0.05
14-
label: Reflectivity [$dBZ$]
14+
label: Reflectivity [dBZ]
1515
auxiliary:
1616
category: [reflectivity, radar]
1717
differential_reflectivity:
@@ -21,12 +21,12 @@ differential_reflectivity:
2121
bad_color: none
2222
norm:
2323
name: Norm
24-
vmin: -1
25-
vmax: 8
24+
vmin: -0.4
25+
vmax: 4
2626
cbar:
2727
extend: both
2828
extendfrac: 0.05
29-
label: Differential Reflectivity [$dB$]
29+
label: $Z_{\mathrm{DR}}$ [dB]
3030
auxiliary:
3131
category: [reflectivity, radar]
3232
differential_phase:
@@ -39,7 +39,7 @@ differential_phase:
3939
vmax: 180 #
4040
cbar:
4141
extend: neither
42-
label: Total Differential Phase ($\phi_{dp}$) [$°$]
42+
label: $\phi_{\mathrm{DP}}$ [°] # Total Differential Phase
4343
auxiliary:
4444
category: [phase, radar]
4545
propagation_differential_phase:
@@ -52,7 +52,7 @@ propagation_differential_phase:
5252
vmax: 360 # can be more ... unbounded
5353
cbar:
5454
extend: neither
55-
label: Propagation Differential Phase ($\psi_{dp}$) [$°$]
55+
label: $\psi_{\mathrm{DP}}$ [°] # Propagation Differential Phase
5656
auxiliary:
5757
category: [phase, radar]
5858
specific_differential_phase:
@@ -66,7 +66,7 @@ specific_differential_phase:
6666
cbar:
6767
extend: max
6868
extendfrac: 0.05
69-
label: Specific Differential Phase ($K_{dp}$) [$°/km$]
69+
label: $K_{\mathrm{DP}}$ [° km$^{-1}$]
7070
auxiliary:
7171
category: [phase, radar]
7272
cross_correlation_ratio:
@@ -79,7 +79,7 @@ cross_correlation_ratio:
7979
vmax: 1
8080
cbar:
8181
extend: neither
82-
label: Correlation between $Z_{H}$ and $Z_{V}$ ($\rho_{hv}$)
82+
label: $\rho_{\mathrm{HV}}$ [-]
8383
auxiliary:
8484
category: [radar]
8585
clutter_correction:
@@ -108,7 +108,7 @@ specific_attenuation:
108108
cbar:
109109
extend: max
110110
extendfrac: 0.05
111-
label: Specific_attenuation [$dB/km$]
111+
label: k [$dB/km$]
112112
auxiliary:
113113
category: [radar]
114114
specific_differential_attenuation:
@@ -121,7 +121,7 @@ specific_differential_attenuation:
121121
cbar:
122122
extend: max
123123
extendfrac: 0.05
124-
label: Specific Differential Attenuation ($A_{dp}$) [$dB/km$]
124+
label: $A_{\mathrm{DP}}$ [dB km$^{-1}$]
125125
auxiliary:
126126
category: [radar]
127127
path_integrated_attenuation:
@@ -135,7 +135,7 @@ path_integrated_attenuation:
135135
cbar:
136136
extend: max
137137
extendfrac: 0.05
138-
label: Path Integrated Attenuation ($PIA$) [$dB$]
138+
label: PIA [dB]
139139
auxiliary:
140140
category: [radar]
141141
path_integrated_differential_attenuation:
@@ -149,7 +149,7 @@ path_integrated_differential_attenuation:
149149
cbar:
150150
extend: max
151151
extendfrac: 0.05
152-
label: Path Integrated Differential Attenuation ($PIDA$) [$dB$]
152+
label: $\delta$PIA [dB]
153153
auxiliary:
154154
category: [radar]
155155
linear_depolarization_ratio:
@@ -163,7 +163,7 @@ linear_depolarization_ratio:
163163
cbar:
164164
extend: min
165165
extendfrac: 0.05
166-
label: Depolarization Ratio [$dB$]
166+
label: Depolarization Ratio [dB]
167167
auxiliary:
168168
category: [radar]
169169
normalized_coherent_power:
@@ -190,7 +190,7 @@ signal_to_noise_ratio:
190190
cbar:
191191
extend: both
192192
extendfrac: 0.05
193-
label: Signal to Noise Ratio [$dB$]
193+
label: Signal to Noise Ratio [dB]
194194
auxiliary:
195195
category: [radar]
196196
TH:

gpm/gv/xradar/accessors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def plot_map(
9898
add_colorbar=True,
9999
add_background=True,
100100
extent=None,
101+
rasterized=True,
101102
fig_kwargs=None,
102103
subplot_kwargs=None,
103104
cbar_kwargs=None,
@@ -113,6 +114,7 @@ def plot_map(
113114
add_colorbar=add_colorbar,
114115
add_background=add_background,
115116
extent=extent,
117+
rasterized=rasterized,
116118
fig_kwargs=fig_kwargs,
117119
subplot_kwargs=subplot_kwargs,
118120
cbar_kwargs=cbar_kwargs,

gpm/gv/xradar/methods.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def plot_map(
319319
add_background=True,
320320
add_gridlines=True,
321321
add_labels=True,
322+
rasterized=True,
322323
fig_kwargs=None,
323324
subplot_kwargs=None,
324325
cbar_kwargs=None,
@@ -360,6 +361,7 @@ def plot_map(
360361
x=x,
361362
y=y,
362363
add_colorbar=False,
364+
rasterized=rasterized,
363365
# cbar_kwargs=cbar_kwargs,
364366
**plot_kwargs,
365367
)
@@ -371,5 +373,5 @@ def plot_map(
371373
_ = plot_colorbar(p=p, ax=ax, **cbar_kwargs)
372374
# Set extent
373375
if extent is not None:
374-
ax.set_extent(extent)
376+
ax.set_extent(extent, crs=ccrs.PlateCarree())
375377
return p

gpm/utils/manipulations.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,14 +1548,27 @@ def extract_within_point_distance(
15481548
earth_radius = 6371.0 * 1000
15491549
radius_rad = radius / earth_radius
15501550

1551-
ind = tree.query_radius(query_point, r=radius_rad)[0]
1551+
# Retrieve indices and distance
1552+
ind, dist = tree.query_radius(query_point, r=radius_rad, return_distance=True)
1553+
1554+
ind = ind[0]
1555+
dist = dist[0] # in radians
1556+
1557+
# Convert to meters
1558+
dist_m = dist * earth_radius
15521559

15531560
# Map back to flattened full-grid indices
15541561
flat_indices = np.flatnonzero(valid)[ind]
15551562

15561563
# Stack spatial dims, then select matching points
15571564
ds_points = ds.stack(points=spatial_dims)
15581565
ds_near = ds_points.isel(points=flat_indices)
1566+
1567+
# Add distance as coordinate
1568+
ds_near = ds_near.assign_coords(
1569+
distance=("points", dist_m),
1570+
)
1571+
15591572
return ds_near
15601573

15611574

0 commit comments

Comments
 (0)