Skip to content

Commit

Permalink
minor changes to be able to read better SkyEcho files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jun 13, 2024
1 parent c524515 commit 49dab5b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/pyrad_proc/pyrad/io/io_aux.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,9 @@ def get_datatype_skyecho(datatype):
elif datatype == 'LDRvh':
datatype_skyecho = 'LDR_VH'
field_name = 'linear_depolarization_ratio_vh'
elif datatype == 'RhoHV':
datatype_skyecho = 'copolar_correlation'
field_name = 'cross_correlation_ratio'

elif datatype == 'Ah':
datatype_skyecho = 'attenuationRain'
Expand Down
4 changes: 2 additions & 2 deletions src/pyrad_proc/pyrad/io/read_data_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2926,11 +2926,11 @@ def merge_scans_skyecho(basepath, scan_list, voltime, datatype_list,
for filename_aux in filenames:
fdatetime = find_date_in_file_name(
filename_aux, date_format=fdate_strf)
if fdatetime == time_ref:
if fdatetime >= time_ref:
filename = [filename_aux]

if not filename:
warn('No file found in ' + datapath + '*.*')
warn(f'No file found in {datapath}*{scan_list[0]}* for time ref {time_ref}')
else:
radar = pyart.aux_io.read_skyecho(
filename[0], sweep_end_time=voltime,
Expand Down
10 changes: 3 additions & 7 deletions src/pyrad_proc/pyrad/proc/process_echoclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,13 @@ def process_echo_id(procstatus, dscfg, radar_list=None):

for datatypedescr in dscfg['datatype']:
radarnr, _, datatype, _, _ = get_datatype_fields(datatypedescr)
if datatype == 'dBZ':
refl_field = get_fieldname_pyart(datatype)
if datatype == 'dBuZ':
if datatype in ['dBZ', 'dBuZ']:
refl_field = get_fieldname_pyart(datatype)
if datatype == 'ZDR':
zdr_field = get_fieldname_pyart(datatype)
if datatype == 'ZDRu':
if datatype in ['ZDR', 'ZDRu']:
zdr_field = get_fieldname_pyart(datatype)
if datatype in ['RhoHV', 'uRhoHV']:
rhv_field = get_fieldname_pyart(datatype)
if datatype == 'uPhiDP':
if datatype in ['PhiDP', 'uPhiDP']:
phi_field = get_fieldname_pyart(datatype)

ind_rad = int(radarnr[5:8]) - 1
Expand Down
8 changes: 8 additions & 0 deletions src/pyrad_proc/pyrad/proc/process_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def process_point_measurement(procstatus, dscfg, radar_list=None):
elevation tolerance to determine which radar elevation to use [deg]
RngTol : float. Dataset keyword
range tolerance to determine which radar bin to use [m]
fill_value : float or None
If not None masked values are going to be filled by this value
radar_list : list of Radar objects
Optional. list of radar objects
Expand Down Expand Up @@ -130,6 +132,7 @@ def process_point_measurement(procstatus, dscfg, radar_list=None):
projparams.update({'lat_0': radar.latitude['data']})

single_point = dscfg.get('single_point', True)
fill_value = dscfg.get('fill_value', None)
if dscfg['latlon']:
lon = dscfg['lon']
lat = dscfg['lat']
Expand Down Expand Up @@ -202,6 +205,11 @@ def process_point_measurement(procstatus, dscfg, radar_list=None):
ant_coord[2, :] = np.zeros(ind_ray.size) + radar.range['data'][ind_r]

val = radar.fields[field_name]['data'].data[ind_ray, ind_r]
if (fill_value is not None
and np.ma.is_masked(radar.fields[field_name]['data'][
ind_ray, ind_r])):
val = fill_value

time = num2date(radar.time['data'][ind_ray], radar.time['units'],
radar.time['calendar'])

Expand Down

0 comments on commit 49dab5b

Please sign in to comment.