Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FoF code #10

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

FoF code #10

wants to merge 31 commits into from

Conversation

manonramel
Copy link
Collaborator

I implemented the code for the Friends-of-Friends algorithm.

The idea is to:

  • Use the FoFCatalogMatching function which returns a Table converted into a pandas dataframe, composed of 3 columns: "row_index", "catalog_key" and "group_id".
  • Replace the "catalog_key" column with "is_cat1" column filled with booleans (True if the object belongs to catalog 1, False otherwise) to optimize the code
  • Use the pandas method groupby and make a loop over the sub-tables to store the row indices of catalog1 and catalog2 components in two different lists
  • Combine the two lists of indices in one list representing the group and return the groups.

I tested this code in one tract, using truth and object catalogs. It approximatively takes 15 minutes to execute.

@aimalz aimalz marked this pull request as ready for review May 18, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant