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

90th Percentile Calculator - 2023 Update #3250

Merged
merged 16 commits into from
Nov 23, 2023
Merged
Prev Previous commit
Next Next commit
add elevation to stations json & update tests
brettedw committed Nov 21, 2023

Verified

This commit was signed with the committer’s verified signature.
SWvheerden SW van Heerden
commit b566782101dfe643d3f7dda14d8625fe3fc56c9f
866 changes: 582 additions & 284 deletions api/app/data/weather_stations.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"end_month": 8,
"end_day": 31
},
"elevation": null,
"elevation": 821,
"wfwx_station_uuid": null,
"zone_code": null
},
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"end_month": 8,
"end_day": 31
},
"elevation": null,
"elevation": 632,
"wfwx_station_uuid": null,
"zone_code": null
},
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"end_month": 8,
"end_day": 31
},
"elevation": null,
"elevation": 791,
"wfwx_station_uuid": null,
"zone_code": null
},
@@ -153,7 +153,7 @@
"end_month": 8,
"end_day": 31
},
"elevation": null,
"elevation": 821,
"wfwx_station_uuid": null,
"zone_code": null
},
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"end_month": 9,
"end_day": 15
},
"elevation": null,
"elevation": 780,
"wfwx_station_uuid": null,
"zone_code": null
},
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"end_month": 9,
"end_day": 15
},
"elevation": null,
"elevation": 780,
"wfwx_station_uuid": null,
"zone_code": null
},
@@ -442,7 +442,7 @@
"end_month": 8,
"end_day": 31
},
"elevation": null,
"elevation": 821,
"wfwx_station_uuid": null,
"zone_code": null
},
4 changes: 2 additions & 2 deletions api/app/tests/weather_models/test_process_grib.py
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ def test_read_single_raster_value():
raster_band = dataset.GetRasterBand(1)
station, value = next(processor.yield_value_for_stations(raster_band))

assert math.isclose(value, 55.976, abs_tol=0.001)
assert station.code == 322
assert station.code == 3090
assert math.isclose(value, 67.150, abs_tol=0.001)

del dataset
3 changes: 2 additions & 1 deletion api/scripts/station_csv_to_json.py
Original file line number Diff line number Diff line change
@@ -58,7 +58,8 @@ def process_stations(station_df: pd.DataFrame, ecodivisions: gpd.GeoDataFrame, c
"lat": row['LATITUDE'],
"long": row['LONGITUDE'],
"ecodivision_name": ecodivision_name,
"core_season": core_season
"core_season": core_season,
"elevation": int(row['ELEVATION_M'])
})

# Order stations by name.