Skip to content

Commit 8385bae

Browse files
committed
feat: add opt_1d_index to outputted station mapping df
1 parent 93c606a commit 8385bae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hat/station_mapping/mapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ def apply_blacklist(blacklist_config, metric_grid, grid_area_coords1, grid_area_
4747
return metric_grid, grid_area_coords1, grid_area_coords2
4848

4949

50-
def outputs_to_df(df, indx, indy, cindx, cindy, errors, grid_area_coords1, grid_area_coords2, filename):
50+
def outputs_to_df(df, indx, indy, cindx, cindy, errors, grid_area_coords1, grid_area_coords2, shape, filename):
5151
df["opt_x_index"] = indx
5252
df["opt_y_index"] = indy
5353
df["near_x_index"] = cindx
5454
df["near_y_index"] = cindy
5555
df["opt_error"] = errors
5656
df["opt_x_coord"] = grid_area_coords1[indx, 0]
5757
df["opt_y_coord"] = grid_area_coords2[0, indy]
58+
df["opt_1d_index"] = indy + shape[1] * indx
5859
if filename is not None:
5960
df.to_csv(filename, index=False)
6061
return df
@@ -109,6 +110,7 @@ def mapper(config):
109110
*mapping_outputs,
110111
grid_area_coords1,
111112
grid_area_coords2,
113+
shape=grid_area_coords1.shape,
112114
filename=config["output"]["file"] if config.get("output", None) is not None else None,
113115
)
114116
generate_summary_plots(df, config.get("plot", None))

0 commit comments

Comments
 (0)