Skip to content

Commit

Permalink
Reduce minor diffs in grids from diff PCs
Browse files Browse the repository at this point in the history
  • Loading branch information
gnrgomes committed Jul 12, 2024
1 parent 4c7aa20 commit 61e90f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lisfloodutilities/gridding/lib/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ def get_all_6hourly_station_values_df(self, kiwis_data_frames: List[pd.DataFrame
merged_df = pd.concat(kiwis_data_frames)
merged_df = merged_df[[self.COL_LON, self.COL_LAT, self.COL_PROVIDER_ID, self.COL_STATION_NUM, self.COL_STATION_ID, self.COL_VALUE]]
merged_df.reset_index(drop=True, inplace=True)
result_df = merged_df.astype({self.COL_VALUE: 'np.float32'}).groupby([self.COL_LON, self.COL_LAT,
self.COL_PROVIDER_ID,
self.COL_STATION_NUM,
self.COL_STATION_ID])[self.COL_VALUE].agg(
['sum','count']).reset_index()
result_df = merged_df.astype({self.COL_VALUE: 'float'}).groupby([self.COL_LON, self.COL_LAT,
self.COL_PROVIDER_ID,
self.COL_STATION_NUM,
self.COL_STATION_ID])[self.COL_VALUE].agg(
['sum','count']).reset_index()
result_df.columns = [self.COL_LON, self.COL_LAT, self.COL_PROVIDER_ID, self.COL_STATION_NUM,
self.COL_STATION_ID, 'sum_6h_values', 'count_6h_slots']
result_df.reset_index(drop=True, inplace=True)
Expand Down Expand Up @@ -427,7 +427,7 @@ def filter(self, kiwis_files: List[Path], kiwis_timestamps: List[str], kiwis_dat
# self.COL_LAT: 'np.float32',
# self.COL_PROVIDER_ID: 'int',
# self.COL_STATION_ID: 'int',
self.COL_VALUE: 'np.float32'})
self.COL_VALUE: 'float'})

self.kiwis_24h_dataframe = kiwis_data_frames[0]
kiwis_6h_dataframes = kiwis_data_frames[1:]
Expand Down

0 comments on commit 61e90f4

Please sign in to comment.