Skip to content

Commit

Permalink
FIX: correctly apply 'a1gate' when saving 'to_odim'
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Jul 25, 2019
1 parent 81e4137 commit d2945d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wradlib/io/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ def write_odim_dataspace(src, dest):
}
write_odim(what, h5_what)

# moments
val = value.values
# moments handling
val = value.sortby('azimuth').values
fillval = enc['_FillValue'] * enc['scale_factor']
fillval += enc['add_offset']
val[np.isnan(val)] = fillval
Expand Down Expand Up @@ -851,13 +851,13 @@ def to_odim(volume, filename):
h5_ds_where = h5_dataset.create_group('where')
rscale = ds.range.values[1] / 1. - ds.range.values[0]
rstart = (ds.range.values[0] - rscale / 2.) / 1000.
a1gate = np.argsort(ds.sortby('time').azimuth.values)[0]
ds_where = {'elangle': ds.fixed_angle,
'nbins': ds.range.shape[0],
'rstart': rstart,
'rscale': rscale,
'nrays': ds.azimuth.shape[0],
'a1gate':
np.nonzero(np.argsort(ds.time.values) == 0)[0][0]
'a1gate': a1gate,
}
write_odim(ds_where, h5_ds_where)

Expand Down

0 comments on commit d2945d8

Please sign in to comment.