diff --git a/src/nwp_page.py b/src/nwp_page.py index e7635e1..6a5edbb 100644 --- a/src/nwp_page.py +++ b/src/nwp_page.py @@ -10,6 +10,19 @@ region = os.getenv("REGION", "UK") environment = os.getenv("ENVIRONMENT", "development") +all_nwps = { + "uk": { + "UKV": f"s3://nowcasting-nwp-{environment}/data-national/latest.zarr", + "ECMWF": f"s3://nowcasting-nwp-{environment}/ecmwf/data/latest.zarr", + }, + "india": { + "ECMWF": f"s3://india-nwp-{environment}/ecmwf/data/latest.zarr", + "GFS": f"s3://nowcasting-nwp-{environment}/gfs/data/latest.zarr", + }, +} + +nwp_key_list = list(all_nwps[region].keys()) + ["Other"] + def get_data(zarr_file): @@ -52,20 +65,6 @@ def get_data(zarr_file): return ds -all_nwps = { - "UK": { - "UKV": f"s3://nowcasting-nwp-{environment}/data-national/latest.zarr", - "ECMWF": f"s3://nowcasting-nwp-{environment}/ecmwf/data/latest.zarr", - }, - "India": { - "ECMWF": f"s3://india-nwp-{environment}/ecmwf/data/latest.zarr", - "GFS": f"s3://nowcasting-nwp-{environment}/gfs/data/latest.zarr", - }, -} - -nwp_key_list = list(all_nwps[region].keys()) + ["Other"] - - def nwp_page(): """Main page for pvsite forecast""" @@ -75,13 +74,13 @@ def nwp_page(): ) # text input box - zarr_file = st.selectbox( - "Select the zarr file you want to explore", nwp_key_list - ) + zarr_file = st.selectbox("Select the zarr file you want to explore", nwp_key_list) if zarr_file in [None, "", "Other"]: - zarr_file = st.text_input(label="Or enter the zarr file you want to explore", - value=all_nwps[region][nwp_key_list[0]]) + zarr_file = st.text_input( + label="Or enter the zarr file you want to explore", + value=all_nwps[region][nwp_key_list[0]], + ) else: zarr_file = all_nwps[region][zarr_file] st.text(f"Selected {zarr_file}") diff --git a/src/satellite_page.py b/src/satellite_page.py index 9259f9c..36dabe5 100644 --- a/src/satellite_page.py +++ b/src/satellite_page.py @@ -11,6 +11,19 @@ environment = os.getenv("ENVIRONMENT", "development") +all_satellite = { + "uk": { + "0deg": f"s3://nowcasting-sat-{environment}/data/latest/latest.zarr.zip", + "0deg_HRV": f"s3://nowcasting-sat-{environment}/data/latest/hrv_latest.zarr.zip", + "9deg": f"s3://nowcasting-sat-{environment}/data/latest/15_latest.zarr.zip", + "9deg_HRV": f"s3://nowcasting-sat-{environment}/data/latest/15_hrv_latest.zarr.zip", + }, + "india": {"45.5deg": f"s3://india-nwp-{environment}/data/latest/latest.zarr.zip"}, +} + +satellite_key_list = list(all_satellite[region].keys()) + ["Other"] + + def get_data(zarr_file): # hash filename @@ -57,19 +70,6 @@ def get_data(zarr_file): return ds -all_satellite = { - "UK": { - "0deg": f"s3://nowcasting-sat-{environment}/data/latest/latest.zarr.zip", - "0deg_HRV": f"s3://nowcasting-sat-{environment}/data/latest/hrv_latest.zarr.zip", - "9deg": f"s3://nowcasting-sat-{environment}/data/latest/15_latest.zarr.zip", - "9deg_HRV": f"s3://nowcasting-sat-{environment}/data/latest/15_hrv_latest.zarr.zip", - }, - "INDIA": {"45.5deg": f"s3://india-nwp-{environment}/data/latest/latest.zarr.zip"}, -} - -satellite_key_list = list(all_satellite[region].keys()) + ["Other"] - - def satellite_page(): """Satellite pge"""