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

Filter region catalog by flux per tile when converting from tile catalog #938

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

aakashdp6548
Copy link
Collaborator

Previously, when converting a TileCatalog to a RegionCatalog we would just discard it if the conversion would produce a region catalog with multiple sources in one tile. Now, we instead keep the highest flux source and turn off all others in that tile.

The high-level algorithm is as follows:

1. Create a unique integer index for each region
2. Unfold with a 3x3 kernel with padding=1 and stride=2 to get number of sources and integer indices in each 3x3 tile
3. Determine which tiles have more than one source and the integer index of those regions
4. For each problematic tile:
    - Get the flux of all "on" sources
    - Find the integer index of the region with the highest flux
    - Turn off all regions in the tile (for simplicity)
    - Turn the max flux region back on

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Merging #938 (14c5840) into master (88e3943) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #938   +/-   ##
=======================================
  Coverage   95.82%   95.82%           
=======================================
  Files          26       26           
  Lines        3211     3211           
=======================================
  Hits         3077     3077           
  Misses        134      134           
Flag Coverage Δ
unittests 95.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jeff-regier jeff-regier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks Aakash!

@jeff-regier jeff-regier merged commit 0a8b6db into master Sep 15, 2023
3 checks passed
@jeff-regier jeff-regier deleted the filter_region_cat branch September 15, 2023 15:40
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.

2 participants