@@ -554,6 +554,7 @@ class StandardData(RadarBase):
554
554
Args:
555
555
file (str, IO): Path points to the file or a file object.
556
556
"""
557
+
557
558
# fmt: off
558
559
dtype_corr = {1 :'TREF' , 2 :'REF' , 3 :'VEL' , 4 :'SW' , 5 :'SQI' , 6 :'CPA' , 7 :'ZDR' , 8 :'LDR' ,
559
560
9 :'RHO' , 10 :'PHI' , 11 :'KDP' , 12 :'CP' , 14 :'HCL' , 15 :'CF' , 16 :'SNRH' ,
@@ -616,7 +617,9 @@ def _parse(self):
616
617
self .scantime = epoch_seconds_to_utc (epoch_seconds )
617
618
if self ._is_phased_array :
618
619
san_beam_number = task ["san_beam_number" ][0 ]
619
- self .pa_beam = np .frombuffer (self .f .read (san_beam_number * 640 ),PA_SDD_beam )
620
+ self .pa_beam = np .frombuffer (
621
+ self .f .read (san_beam_number * 640 ), PA_SDD_beam
622
+ )
620
623
cut_num = task ["cut_number" ][0 ]
621
624
scan_config = np .frombuffer (self .f .read (256 * cut_num ), cut_config_dtype )
622
625
self .scan_config = list ()
@@ -926,16 +929,19 @@ def __init__(self, file):
926
929
except IndexError :
927
930
self .code = self .name = "None"
928
931
self ._d = data = np .frombuffer (f .read (), dtype = PA_radial )
929
- self .stationlon = data ["header" ]["longitude" ][0 ] * 360 / 65535
930
- self .stationlat = data ["header" ]["latitude" ][0 ] * 360 / 65535
931
- self .radarheight = data ["header" ]["height" ][0 ] * 1000 / 65535
932
- self .scantime = epoch_seconds_to_utc (data ["data" ]["radial_time" ][0 ])
933
- self .reso = np .round (data ["data" ]["gate_length" ][0 ] * 1000 / 65535 ) / 1000
932
+ self .stationlon = data ["header" ]["longitude" ][0 ].astype (int ) * 360 / 65535
933
+ self .stationlat = data ["header" ]["latitude" ][0 ].astype (int ) * 360 / 65535
934
+ self .radarheight = data ["header" ]["height" ][0 ].astype (int ) * 1000 / 65535
935
+ self .scantime = epoch_seconds_to_utc (data ["data" ]["radial_time" ][0 ].astype (int ))
936
+ self .reso = (
937
+ np .round (data ["data" ]["gate_length" ][0 ].astype (int ) * 1000 / 65535 ) / 1000
938
+ )
934
939
self .first_gate_dist = (
935
- np .round (data ["data" ]["first_gate_dist" ][0 ] * 1000 / 65535 ) / 1000
940
+ np .round (data ["data" ]["first_gate_dist" ][0 ].astype (int ) * 1000 / 65535 )
941
+ / 1000
936
942
)
937
- el_num = data ["data" ]["el_num" ][0 ]
938
- az_num = data ["data" ]["az_num" ][0 ]
943
+ el_num = data ["data" ]["el_num" ][0 ]. astype ( int )
944
+ az_num = data ["data" ]["az_num" ][0 ]. astype ( int )
939
945
radial_num = 2000
940
946
el = data ["data" ]["elevation" ].astype (int ) * 360 / 65535
941
947
self .el = el .reshape (az_num , el_num ).max (axis = 0 )
0 commit comments