Skip to content

Commit 949d745

Browse files
committed
add api bounds to cwfif data source
1 parent 57e0486 commit 949d745

File tree

1 file changed

+6
-1
lines changed
  • firestarr/src/py/firestarr/datasources

1 file changed

+6
-1
lines changed

firestarr/src/py/firestarr/datasources/cwfif.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ def get_rounding():
7474

7575

7676
def fix_coords(lat, lon):
77+
# HACK: clamp to limits in grib api until those are removed
78+
MAX_LATITUDE = 69
79+
MIN_LATITUDE = 41
80+
MAX_LONGITUDE = -52
81+
MIN_LONGITUDE = -141
7782
n = get_rounding()
78-
return round(lat, n), round(lon, n)
83+
return min(MAX_LATITUDE, max(MIN_LATITUDE, round(lat, n))), min(MAX_LONGITUDE, max(MIN_LONGITUDE, round(lon, n)))
7984

8085

8186
def fmt_rounded(x):

0 commit comments

Comments
 (0)