Skip to content

Commit

Permalink
Add columns to cell dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritvje committed Mar 7, 2024
1 parent edf2178 commit 8d22abd
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions pysteps/feature/tstorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,36 @@ def get_profile(areas, binary, ref, loc_max, time, minref):
"max_ref": maxref,
"cont": contours,
"area": len(x),
"splitted": None,
"split_IDs": None,
"merged": None,
"merged_IDs": None,
"results_from_split": None,
"will_merge": None,
}
)
labels[cells == cell_labels[n]] = this_id
cells_id = pd.DataFrame(
data=cells_id,
index=range(len(cell_labels)),
columns=["ID", "time", "x", "y", "cen_x", "cen_y", "max_ref", "cont", "area"],
columns=[
"ID",
"time",
"x",
"y",
"cen_x",
"cen_y",
"max_ref",
"cont",
"area",
"splitted",
"split_IDs",
"merged",
"merged_IDs",
"results_from_split",
"will_merge",
],
)

cells_id["split_IDs"] = cells_id["split_IDs"].astype("object")
cells_id["merged_IDs"] = cells_id["merged_IDs"].astype("object")
return cells_id, labels

0 comments on commit 8d22abd

Please sign in to comment.