Skip to content

Commit 2b338e7

Browse files
authored
fix getting wind dirctory data's bug
1 parent d1ad7a3 commit 2b338e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

HY_Plotter/rpdgrib/rpdgrib.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def extract(fname, band_index):
1818
# get values
1919
fns = fname.split("_", -1)
2020
lons, lats = init["wvc_lon"][:], init["wvc_lat"][:]
21-
data_spd, data_dir = init["wind_speed"][:], init["wind_dir"][:]
21+
data_spd, data_dir = init["wind_speed_selection"][:], init["wind_dir_selection"][:]
2222
data_spd, data_dir = data_spd[:,:,band_index], data_dir[:,:,band_index]
2323
data_time = str(init["wvc_row_time"][:][init["wvc_row_time"][:] != b''][-1]).replace("b","").replace("'","").strip()
2424
sate_name = str(init.attrs["Platform_ShortName"][-1]).replace("b","").replace("'","").strip() + " Scatterometer Level 2B"
@@ -42,14 +42,14 @@ def extract(fname, band_index):
4242
else:
4343
# get values
4444
lons, lats = init.variables["wvc_lon"][:], init.variables["wvc_lat"][:]
45-
data_spd, data_dir = init.variables["wind_speed"][:], init.variables["wind_dir"][:]
46-
data_spd, data_dir = data_spd[:,:,band_index], data_dir[:,:,band_index]
45+
data_spd, data_dir = init.variables["wind_speed_selection"][:], init.variables["wind_dir_selection"][:]
46+
# data_spd, data_dir = data_spd[:,:,band_index], data_dir[:,:,band_index]
4747
data_time = init.time_coverage_end
4848
sate_name = f"{init.platform} Scatterometer Level 2B"
4949
if init.dimensions["numrows"].size == 3248:
5050
res = "0.125°"
5151
else:
5252
res = "0.25°"
5353
# process values
54-
data_spd, data_dir = data_spd / 0.514, data_dir - 180
54+
data_spd = data_spd / 0.514
5555
return lats, lons, data_spd, data_dir, data_time, sate_name, res

0 commit comments

Comments
 (0)