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

Avoid the use of wrap_america function in utils.py #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions feems/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def load_tiles(s):
return [shape(t["geometry"]) for t in tiles]


def wrap_america(tile):
tile = Point(tile)
if np.max(tile.xy[0]) < -40 or np.min(tile.xy[0]) < -40:
tile = translate(tile, xoff=360.0)
return tile.xy[0][0], tile.xy[1][0]
# def wrap_america(tile):
# tile = Point(tile)
# if np.max(tile.xy[0]) < -40 or np.min(tile.xy[0]) < -40:
# tile = translate(tile, xoff=360.0)
# return tile.xy[0][0], tile.xy[1][0]


def create_tile_dict(tiles, bpoly):
Expand All @@ -30,8 +30,8 @@ def create_tile_dict(tiles, bpoly):

for c, poly in enumerate(tiles):
x, y = poly.exterior.xy
points = zip(np.round(x, 3), np.round(y, 3))
points = [wrap_america(p) for p in points]
points = tuple(zip(np.round(x, 3), np.round(y, 3)))
# points = [wrap_america(p) for p in points]
for p in points:
if p not in pts_in:
# check if point is in region
Expand Down