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

Xy box fix #706

Merged
merged 2 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions beast/observationmodel/ast/make_ast_xy_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,23 +323,22 @@ def pick_positions_from_map(
# if you only want to erode the boundary and not impose other
# coordinate boundary constraints, still discard SD tiles that don't overlap
if (set_coord_boundary is None) and (erode_boundary is not None):
if catalog_boundary_xy and tile_box_xy:
if catalog_boundary_radec and tile_box_radec:
if (
Polygon(catalog_boundary_xy.vertices)
.intersection(tile_box_xy)
Polygon(catalog_boundary_radec.vertices)
.intersection(tile_box_radec)
.area
== 0
):
keep_tile[j] = False
elif catalog_boundary_radec and tile_box_radec:
elif catalog_boundary_xy and tile_box_xy:
if (
Polygon(catalog_boundary_radec.vertices)
.intersection(tile_box_radec)
Polygon(catalog_boundary_xy.vertices)
.intersection(tile_box_xy)
.area
== 0
):
keep_tile[j] = False

# - set_coord_boundary
if set_coord_boundary is not None:
# coord boundary is input in RA/Dec, and tiles are RA/Dec,
Expand All @@ -354,18 +353,18 @@ def pick_positions_from_map(

# - region_from_filters
if region_from_filters is not None:
if filt_reg_boundary_xy and tile_box_xy:
if filt_reg_boundary_radec and tile_box_radec:
if (
Polygon(filt_reg_boundary_xy.vertices)
.intersection(tile_box_xy)
Polygon(filt_reg_boundary_radec.vertices)
.intersection(tile_box_radec)
.area
== 0
):
keep_tile[j] = False
elif filt_reg_boundary_radec and tile_box_radec:
elif filt_reg_boundary_xy and tile_box_xy:
if (
Polygon(filt_reg_boundary_radec.vertices)
.intersection(tile_box_radec)
Polygon(filt_reg_boundary_xy.vertices)
.intersection(tile_box_xy)
.area
== 0
):
Expand Down