From e111cefa1109605772d081dfc3cee4e295212770 Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Wed, 1 Nov 2023 12:17:28 -0400 Subject: [PATCH] Add a partition_info on SOAP results. --- src/hipscat_import/soap/map_reduce.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hipscat_import/soap/map_reduce.py b/src/hipscat_import/soap/map_reduce.py index c63c667b..53db9305 100644 --- a/src/hipscat_import/soap/map_reduce.py +++ b/src/hipscat_import/soap/map_reduce.py @@ -125,3 +125,10 @@ def combine_partial_results(input_path, output_path): file_pointer=file_io.append_paths_to_pointer(output_path, "unmatched_sources.csv"), index=False, ) + + primary_only = matched.groupby(["Norder", "Dir", "Npix"])["num_rows"].sum().reset_index() + file_io.write_dataframe_to_csv( + dataframe=primary_only, + file_pointer=file_io.append_paths_to_pointer(output_path, "partition_info.csv"), + index=False, + )