def process(self, obj_data):
'''
Removes table data with large snow errors
@param obj_data: Input DataWrapper, will be modified in place
'''
bad_stations = []
sigma_multiplier = self.ap_paramList[0]()
for label, data in obj_data.getIterator():
if len(data[data[self.snow_column]==4]) > 0 and len(data[data[self.snow_column]==2]) > 0:
snow = data[data[self.snow_column]==4].loc[:,self.column_name]
no_snow = data[data[self.snow_column]==2].loc[:,self.column_name]
non_snow_std = np.nanstd(no_snow)
snow_std = np.nanstd(snow)
if snow_std > sigma_multiplier * non_snow_std:
bad_stations.append(label)
if len(bad_stations) > 0:
obj_data.removeFrames(bad_stations)
评论列表
文章目录