def make_marker(p, station): lons = stations_keys(config, key="lon") lats = stations_keys(config, key="lat") lon, lat = lons[station], lats[station] html = file_html(p, CDN, station) iframe = IFrame(html, width=width + 40, height=height + 80) popup = folium.Popup(iframe, max_width=2650) icon = folium.Icon(color="green", icon="stats") marker = folium.Marker(location=[lat, lon], popup=popup, icon=icon) return marker
def rename_cols(df, config): cols = stations_keys(config, key="station_name") return df.rename(columns=cols)
m = folium.Map( width="100%", height="100%", location=[lat, lon], zoom_start=zoom_start ) if line: p = folium.PolyLine( get_coordinates(bbox), color="#FF0000", weight=2, opacity=0.9, ) p.add_to(m) return m bbox = config["region"]["bbox"] m = make_map(bbox, zoom_start=8, line=True, layers=True) all_obs = stations_keys(config) from glob import glob from operator import itemgetter import iris from folium.plugins import MarkerCluster iris.FUTURE.netcdf_promote = True big_list = [] for fname in glob(os.path.join(save_dir, "*.nc")): if "OBS_DATA" in fname: continue cube = iris.load_cube(fname) model = os.path.split(fname)[1].split("-")[-1].split(".")[0]