Skip to content

Commit

Permalink
more error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza committed Apr 17, 2024
1 parent 7aac46f commit 5787596
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions btk/deblend.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ def deblend(self, ii: int, blend_batch: BlendBatch) -> DeblendExample:
band_image, self.thresh, err=bkg.globalrms, segmentation_map=False
)

if len(catalog) > self.max_n_sources:
raise ValueError(

Check warning on line 400 in btk/deblend.py

View check run for this annotation

Codecov / codecov/patch

btk/deblend.py#L399-L400

Added lines #L399 - L400 were not covered by tests
"SEP predicted more sources than `max_n_sources`. Consider increasing `thresh`"
" or `max_n_sources`."
)

# convert predictions to arcseconds
ra_detections, dec_detections = wcs.pixel_to_world_values(catalog["x"], catalog["y"])
ra_detections *= 3600
Expand Down

0 comments on commit 5787596

Please sign in to comment.