Skip to content
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