diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-04-28 01:32:54 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-04-28 01:33:08 +0200 |
commit | 55cd53f4e6b1e13d2866a84a9631be8f89651cf2 (patch) | |
tree | 5b77ffc3311b490d4f979055e97823011280aace /src/stores.ts | |
parent | ae52909d00cdcda30d6ed07e302c0a50abe70b75 (diff) | |
download | Aurora-data-55cd53f4e6b1e13d2866a84a9631be8f89651cf2.tar.gz Aurora-data-55cd53f4e6b1e13d2866a84a9631be8f89651cf2.zip |
Add one hour forecast
Diffstat (limited to 'src/stores.ts')
-rw-r--r-- | src/stores.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/stores.ts b/src/stores.ts index 05da19b..2e91c25 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -134,7 +134,8 @@ async function getSpaceWeather() { }, "usnoaa_data_raw": { "solar_wind_mag_field": false, - "noaa_planetary_k_index_forecast": false + "noaa_planetary_k_index_forecast": false, + "geospace_pred_est_kp_1_hour": false } }; @@ -144,8 +145,11 @@ async function getSpaceWeather() { ret.now.bz = ret.usnoaa_data_raw.solar_wind_mag_field["Bz"]; ret.now.bt = ret.usnoaa_data_raw.solar_wind_mag_field["Bt"]; + res = await fetch("https://services.swpc.noaa.gov/json/geospace/geospace_pred_est_kp_1_hour.json"); + ret.usnoaa_data_raw.geospace_pred_est_kp_1_hour = (await res.json()).map(x => ({...x, "model_prediction_time": new Date(x.model_prediction_time)})); + res = await fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json") - ret.usnoaa_data_raw.noaa_planetary_k_index_forecast = await res.json() + ret.usnoaa_data_raw.noaa_planetary_k_index_forecast = await res.json(); ret.usnoaa_data_raw.noaa_planetary_k_index_forecast.shift(); let cDate = new Date(); |