diff --git a/modules/util/abi_surfrad.py b/modules/util/abi_surfrad.py
index 3cb05ad66ed515f640139466abc294893495bd5b..903ab390ab2b740c89da0b75f8ca6e465c30c63d 100644
--- a/modules/util/abi_surfrad.py
+++ b/modules/util/abi_surfrad.py
@@ -182,7 +182,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
                         np.save(out_directory + 'valid_ires_' + f'{cnt:04d}', valid_i)
                     num_valid_samples = valid_m.shape[0]
 
-                    param_valid_hist += np.histogram(valid_m[param_idx_m, ], bins=16, range=hist_range)[0]
+                    param_valid_hist += np.histogram(valid_m[:, param_idx_m, :, :], bins=16, range=hist_range)[0]
 
                 data_tiles_i = []
                 data_tiles_m = []
@@ -203,7 +203,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
             np.save(out_directory + 'valid_mres_' + f'{cnt:04d}', valid_m)
             np.save(out_directory + 'valid_ires_' + f'{cnt:04d}', valid_i)
         num_valid_samples = valid_m.shape[0]
-        param_valid_hist += np.histogram(valid_m[param_idx_m, ], bins=16, range=hist_range)[0]
+        param_valid_hist += np.histogram(valid_m[:, param_idx_m, :, :], bins=16, range=hist_range)[0]
     total_num_valid_samples += num_valid_samples
     print('total_num_valid_samples, total_num_not_missing: ', total_num_valid_samples, total_num_not_missing)
     print(param_valid_hist)
@@ -253,7 +253,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
                         np.save(out_directory + 'train_mres_' + f'{cnt:04d}', train_m)
                     num_train_samples = train_m.shape[0]
 
-                    param_train_hist += np.histogram(train_m[param_idx_m, ], bins=16, range=hist_range)[0]
+                    param_train_hist += np.histogram(train_m[:, param_idx_m, :, :], bins=16, range=hist_range)[0]
 
                 data_tiles_i = []
                 data_tiles_m = []
@@ -274,7 +274,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
             np.save(out_directory + 'train_ires_' + f'{cnt:04d}', train_i)
             np.save(out_directory + 'train_mres_' + f'{cnt:04d}', train_m)
         num_train_samples = train_m.shape[0]
-        param_train_hist += np.histogram(train_m[param_idx_m, ], bins=16, range=hist_range)[0]
+        param_train_hist += np.histogram(train_m[:, param_idx_m, :, :], bins=16, range=hist_range)[0]
     total_num_train_samples += num_train_samples
     print('total_num_train_samples,  total_num_not_missing: ', total_num_train_samples, total_num_not_missing)
     print(param_train_hist)