diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 785be5bc230c23ba6b164ad3dd3c418c45f85791..6676e8e62647cbfff75a9f1606038c1ab99f03ae 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -129,7 +129,7 @@ def get_goes_datasource(timestamp): return ds -def get_grid_values(h5f, grid_name, j_c, i_c, half_width, scale_factor_name='scale_factor', add_offset_name='add_offset', +def get_grid_values(h5f, grid_name, j_c, i_c, half_width, num_j=None, num_i=None, scale_factor_name='scale_factor', add_offset_name='add_offset', fill_value_name='_FillValue', range_name='actual_range', fill_value=None): hfds = h5f[grid_name] attrs = hfds.attrs @@ -138,15 +138,21 @@ def get_grid_values(h5f, grid_name, j_c, i_c, half_width, scale_factor_name='sca ylen, xlen = hfds.shape - j_l = j_c-half_width - i_l = i_c-half_width - if j_l < 0 or i_l < 0: - return None + if half_width is not None: + j_l = j_c-half_width + i_l = i_c-half_width + if j_l < 0 or i_l < 0: + return None - j_r = j_c+half_width+1 - i_r = i_c+half_width+1 - if j_r >= ylen or i_r >= xlen: - return None + j_r = j_c+half_width+1 + i_r = i_c+half_width+1 + if j_r >= ylen or i_r >= xlen: + return None + else: + j_l = j_c + j_r = j_c + num_j + 1 + i_l = i_c + i_r = i_c + num_i + 1 grd_vals = hfds[j_l:j_r, i_l:i_r] if fill_value is not None: