diff --git a/src/features/rap/extra/reportMetadata/ReportMetadata.tsx b/src/features/rap/extra/reportMetadata/ReportMetadata.tsx
index 5d12ed1..8d24def 100644
--- a/src/features/rap/extra/reportMetadata/ReportMetadata.tsx
+++ b/src/features/rap/extra/reportMetadata/ReportMetadata.tsx
@@ -1,13 +1,11 @@
import styled from "@emotion/styled";
-import { latLng, LatLngExpression, divIcon } from "leaflet";
+import { LatLngExpression, divIcon } from "leaflet";
import { useEffect, useRef } from "react";
import {
MapContainer,
GeoJSON,
useMap,
- Circle,
FeatureGroup,
- Rectangle,
Marker,
} from "react-leaflet";
import { useAppSelector } from "../../../../hooks";
@@ -17,7 +15,6 @@ import Legend from "./Legend";
import RefreshInformation from "./RefreshInformation";
import { DataList } from "../../../../DataList";
import { outputP3ColorFromRGB } from "../../../../helpers/colors";
-import { css } from "@emotion/react";
import OSMAttribution from "../../../../map/OSMAttribution";
import MyPosition from "../../../../map/MyPosition";
import Parallax from "../../../../shared/Parallax";
@@ -62,12 +59,8 @@ export default function ReportMetadata() {
const aviationWeather = useAppSelector(
(state) => state.weather.aviationWeather,
);
- const windsAloft = useAppSelector((state) => state.weather.windsAloft);
const weather = useAppSelector((state) => state.weather.weather);
- const showOp40 =
- typeof windsAloft === "object" && windsAloft.source === "rucSounding";
-
return (
@@ -96,7 +89,6 @@ export default function ReportMetadata() {
showNws={
!!(weather && typeof weather === "object" && "geometry" in weather)
}
- showOp40={showOp40}
/>
@@ -125,17 +117,10 @@ function MapController() {
if (!windsAloft || typeof windsAloft !== "object")
throw new Error("RAP report must be defined");
- const showOp40 =
- typeof windsAloft === "object" && windsAloft.source === "rucSounding";
-
const map = useMap();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const groupRef = useRef(null);
- const rapPosition: LatLngExpression = [
- windsAloft.latitude,
- windsAloft.longitude,
- ];
const airportPosition: LatLngExpression | undefined =
aviationWeather && typeof aviationWeather === "object"
? [aviationWeather.lat, aviationWeather.lon]
@@ -148,31 +133,8 @@ function MapController() {
});
}, [map, groupRef]);
- const bounds = latLng(rapPosition).toBounds(40000); // 13km for op40 analysis
-
return (
- {showOp40 && (
- <>
-
-
- >
- )}
-
{airportPosition && (
)}
diff --git a/src/features/rap/warnings/ReportStale.tsx b/src/features/rap/warnings/ReportStale.tsx
deleted file mode 100644
index 8d87f4b..0000000
--- a/src/features/rap/warnings/ReportStale.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import styled from "@emotion/styled";
-import { faClock } from "@fortawesome/pro-light-svg-icons";
-import { differenceInHours } from "date-fns";
-import { outputP3ColorFromRGB } from "../../../helpers/colors";
-import { useAppSelector } from "../../../hooks";
-import { Container, Icon, WarningMessage } from "./styles";
-
-const StyledWarningMessage = styled(WarningMessage)`
- ${outputP3ColorFromRGB([255, 200, 0])}
-`;
-
-export default function ReportStale() {
- const windsAloft = useAppSelector((state) => state.weather.windsAloft);
-
- if (!windsAloft || typeof windsAloft !== "object") return <>>;
-
- // Need to determine behavior for outdated open meteo data
- if (windsAloft.source !== "rucSounding") return <>>;
-
- const difference = differenceInHours(
- new Date(),
- new Date(windsAloft.hours[0].date),
- );
-
- if (difference < 4) return <>>;
-
- return (
-
-
-
-
- Notice Due to{" "}
-
- upstream data issues
-
- , winds aloft data is currently{" "}
- {difference} hours stale.
-
-
-
- );
-}
diff --git a/src/features/weather/weatherSlice.ts b/src/features/weather/weatherSlice.ts
index b00e83f..58ce9ec 100644
--- a/src/features/weather/weatherSlice.ts
+++ b/src/features/weather/weatherSlice.ts
@@ -2,18 +2,14 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import type { RootState } from "../../store";
import { AppDispatch } from "../../store";
import * as nwsWeather from "../../services/nwsWeather";
-import { differenceInMinutes, isPast } from "date-fns";
+import { differenceInMinutes } from "date-fns";
import * as timezoneService from "../../services/timezone";
import * as aviationWeatherService from "../../services/aviationWeather";
import * as elevationService from "../../services/elevation";
import * as storage from "../user/storage";
import { WindsAloftReport } from "../../models/WindsAloft";
-import * as rapidRefresh from "../../services/rapidRefresh";
import * as openMeteo from "../../services/openMeteo";
-import {
- isPossiblyWithinUSA,
- isWithinNWSRAPModelBoundary,
-} from "../../helpers/geo";
+import { isPossiblyWithinUSA } from "../../helpers/geo";
import { AxiosError } from "axios";
const UPDATE_INTERVAL_MINUTES = 30;
@@ -608,13 +604,12 @@ export const getWeather =
return;
}
- // Open Meteo can provide weather and elevation alongside winds aloft
- const windsAloft = await loadWindsAloft();
+ const windsAloftResult = await loadWindsAloft();
if (isStale()) return;
- if (!windsAloft) return; // pending
- const { elevation } = windsAloft;
+ if (!windsAloftResult) return; // pending
+ const { elevation } = windsAloftResult;
if (elevation == null) loadElevation();
else dispatch(elevationReceived(elevation));
@@ -632,46 +627,18 @@ export const getWeather =
}
| undefined
> {
- if (!isWithinNWSRAPModelBoundary(lat, lon)) return fallback();
-
try {
- const windsAloft = await rapidRefresh.getWindsAloft(lat, lon);
-
- if (
- windsAloft.hours.filter(({ date }) => !isPast(new Date(date)))
- .length < 10
- ) {
- console.info("Stale NWS rapid refresh data");
- throw new Error("Rapid Refresh is too old");
- }
+ const { windsAloft } = await openMeteo.getWindsAloft(lat, lon);
if (isStale()) return;
dispatch(windsAloftReceived(windsAloft));
- } catch (_error) {
- if (isStale()) return;
- return fallback();
- }
-
- return {};
-
- async function fallback() {
- try {
- // It would be nice in the future to intelligently choose an API
- // instead of trial and error (and, it would be faster)
- const { windsAloft } = await openMeteo.getWindsAloft(lat, lon);
-
- if (isStale()) return;
-
- dispatch(windsAloftReceived(windsAloft));
-
- return { elevation: windsAloft.elevationInM };
- } catch (error) {
- if (!isStale()) dispatch(windsAloftFailed());
+ return { elevation: windsAloft.elevationInM };
+ } catch (error) {
+ if (!isStale()) dispatch(windsAloftFailed());
- throw error;
- }
+ throw error;
}
}
diff --git a/src/helpers/geo.test.ts b/src/helpers/geo.test.ts
index 58925c5..4a47b97 100644
--- a/src/helpers/geo.test.ts
+++ b/src/helpers/geo.test.ts
@@ -1,4 +1,4 @@
-import { isPossiblyWithinUSA, isWithinNWSRAPModelBoundary } from "./geo";
+import { isPossiblyWithinUSA } from "./geo";
describe("isPossiblyWithinUSA", () => {
describe("should return true", () => {
@@ -73,37 +73,3 @@ describe("isPossiblyWithinUSA", () => {
});
});
});
-
-describe("isWithinNWSRAPModelBoundary", () => {
- describe("should return true", () => {
- it("for coordinates on the northern edge of the RAP model boundary (Winnipeg, Canada)", () => {
- expect(isWithinNWSRAPModelBoundary(49.8951, -97.1384)).toBe(true);
- });
-
- it("for coordinates on the southern edge of the RAP model boundary (Cancรบn, Mexico)", () => {
- expect(isWithinNWSRAPModelBoundary(21.1619, -86.8515)).toBe(true);
- });
-
- it("for coordinates on the western edge of the RAP model boundary (Vancouver, Canada)", () => {
- expect(isWithinNWSRAPModelBoundary(49.2827, -123.1207)).toBe(true);
- });
-
- it("for coordinates on the eastern edge of the RAP model boundary (Halifax, Canada)", () => {
- expect(isWithinNWSRAPModelBoundary(44.6488, -63.5752)).toBe(true);
- });
- });
-
- describe("should return false outside the RAP model boundary", () => {
- it("e.g. Anchorage, Alaska", () => {
- expect(isWithinNWSRAPModelBoundary(61.2181, -149.9003)).toBe(false);
- });
-
- it("e.g. Mexico City, Mexico", () => {
- expect(isWithinNWSRAPModelBoundary(19.4326, -99.1332)).toBe(false);
- });
-
- it("e.g. Madrid, Spain", () => {
- expect(isWithinNWSRAPModelBoundary(40.4168, -3.7038)).toBe(false);
- });
- });
-});
diff --git a/src/helpers/geo.ts b/src/helpers/geo.ts
index 9c55e54..fbc94df 100644
--- a/src/helpers/geo.ts
+++ b/src/helpers/geo.ts
@@ -70,13 +70,3 @@ export function isPossiblyWithinUSA(
return false; // Coordinates are not within the United States or its locations
}
-
-export function isWithinNWSRAPModelBoundary(
- latitude: number,
- longitude: number,
-): boolean {
- const isWithinBoundary =
- latitude >= 20 && latitude <= 55 && longitude >= -130 && longitude <= -60;
-
- return isWithinBoundary;
-}
diff --git a/src/models/WindsAloft.ts b/src/models/WindsAloft.ts
index aa0d12e..6d0b70a 100644
--- a/src/models/WindsAloft.ts
+++ b/src/models/WindsAloft.ts
@@ -4,7 +4,7 @@ export interface WindsAloftReport {
latitude: number;
longitude: number;
- source: "openMeteo" | "rucSounding";
+ source: "openMeteo";
elevationInM?: number;
}
diff --git a/src/routes/Terms.tsx b/src/routes/Terms.tsx
index 7a739a3..c257ec2 100644
--- a/src/routes/Terms.tsx
+++ b/src/routes/Terms.tsx
@@ -84,20 +84,6 @@ export default function Terms() {
be shared with the following third parties in order to provide you
information:
-
- NOAA's Rapid Refresh software โ{" "}
-
- https://rucsoundings.noaa.gov
-
-
- Purpose: To show you weather information,
- especially as it relates to conditions aloft.
-