metobs_toolkit.Dataset.make_interactive_plot#
- Dataset.make_interactive_plot(obstype='temp', save=True, outputfile=None, starttime=None, endtime=None, vmin=None, vmax=None, mpl_cmap_name='viridis', radius=13, fill_alpha=0.6, max_fps=4, outlier_col='red', ok_col='black', gap_col='orange', fill_col='yellow')[source]#
Make interactive geospatial plot with time evolution.
This function uses the folium package to make an interactive geospatial plot to illustrate the time evolution.
- Parameters:
obstype (str or metobs_toolkit.Obstype, optional) – The observation type to plot. The default is ‘temp’.
save (bool, optional) – If true, the figure will be saved as an html-file. The default is True.
outputfile (str, optional) – The path of the output html-file. The figure will be saved here, if save is True. If outputfile is not given, and save is True, than the figure will be saved in the default outputfolder (if given). The default is None.
starttime (datetime.datetime, optional) – Specifiy the start datetime for the plot. If None is given it will use the start datetime of the dataset, defaults to None.
endtime (datetime.datetime, optional) – Specifiy the end datetime for the plot. If None is given it will use the end datetime of the dataset, defaults to None.
vmin (numeric, optional) – The value corresponding with the minimum color. If None, the minimum of the presented observations is used. The default is None.
vmax (numeric, optional) – The value corresponding with the maximum color. If None, the maximum of the presented observations is used. The default is None.
mpl_cmap_name (str, optional) – The name of the matplotlib colormap to use. The default is ‘viridis’.
radius (int, optional) – The radius (in pixels) of the scatters. The default is 13.
fill_alpha (float ([0;1]), optional) – The alpha of the fill color for the scatters. The default is 0.6.
max_fps (int (>0), optional) – The maximum allowd frames per second for the time evolution. The default is 4.
outlier_col (str, optional) – The edge color of the scatters to identify an outliers. The default is ‘red’.
ok_col (str, optional) – The edge color of the scatters to identify an ok observation. The default is ‘black’.
gap_col (str, optional) – The edge color of the scatters to identify an missing/gap observation. The default is ‘orange’.
fill_col (str, optional) – The edge color of the scatters to identify a fillded observation. The default is ‘yellow’.
- Returns:
m – The interactive folium map.
- Return type:
folium.folium.map
Note
The figure will only appear when this is runned in notebooks. If you do not run this in a notebook, make sure to save the html file, and open it with a browser.
Examples
>>> import metobs_toolkit >>> >>> # Import data into a Dataset >>> dataset = metobs_toolkit.Dataset() >>> dataset.update_settings( ... input_data_file=metobs_toolkit.demo_datafile, ... input_metadata_file=metobs_toolkit.demo_metadatafile, ... template_file=metobs_toolkit.demo_template, ... ) >>> dataset.import_data_from_file() >>> >>> # Make default interactive geospatial plot >>> dataset.make_interactive_plot()