pyValEIA.plots.swarm_stat_plots =============================== .. py:module:: pyValEIA.plots.swarm_stat_plots .. autoapi-nested-parse:: Functions to plot Swarm skill score statistical outcomes. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyValEIA.plots.swarm_stat_plots.lss_plot_Swarm pyValEIA.plots.swarm_stat_plots.one_model_lss_plot_Swarm pyValEIA.plots.swarm_stat_plots.map_hist_panel pyValEIA.plots.swarm_stat_plots.plot_hist_quad_maps pyValEIA.plots.swarm_stat_plots.HMFC_percent_panel pyValEIA.plots.swarm_stat_plots.HMFC_percent_figure pyValEIA.plots.swarm_stat_plots.plot_2hist_quad_maps pyValEIA.plots.swarm_stat_plots.map_2hist_panel Module Contents --------------- .. py:function:: lss_plot_Swarm(model1, model2, eia_type, date_range, model1_name='Model1', model2_name='Model2', PorC='PC', DayNight=True, LT_range=None, coin=True, lssylim=None, lssxlim=None) Plot LSS vs CSI or PC 4 panels (one for each LSS). :Parameters: **model1** : DataFrame first model DataFrame built by multiday_states_report **model2** : DataFrame second model DataFrame built by multiday_states_report **eia_type** : str desired eia type for fig title **date_range** : datetime range For plotting title purposes **model1_name** : str kwarg first model name for labelling purposes **model2_name** : str kwarg second model name for labelling purposes **PorC** : str kwarg Percent correct or Critical success index for x axes **DayNight** : bool kwarg True (default) if panels should have separate markers for day and night otherwise (false) all are plotted together **LT_range** : list-like or NoneType Range of day night local time, or None for default of [7, 19] (default=None) **coin** : bool kwarg If True, coin LSS will be plotted for comparison (default) if false, coin LSS will not be plotted lssylim : list-like or NoneType y axis limit, defaults to [-1,1] if None is provided (default=None) **lssxlim** : list-like or NoneType y axis limit, defaults to [0,1] if None is provided (default=None) :Returns: **fig** : fig handle 4 panel figure (one for each LSS) .. seealso:: :obj:`io.load.multiday_states_report` .. .. rubric:: Notes LSS can range outside of +/-1 .. !! processed by numpydoc !! .. py:function:: one_model_lss_plot_Swarm(model1, eia_type, date_range, model_name='Model', PorC='PC', DayNight=True, LT_range=None, coin=True) Plot LSS vs CSI or PC 4 panels (one for each LSS) for 1 model alone. :Parameters: **model1** : DataFrame model DataFrame built by multiday_states_report **eia_type** : str desired eia type for fig title **date_range** : datetime range For plotting title purposes **model_name** : str kwarg first model name for labelling purposes **PorC** : str kwarg Percent correct or Critical success index for x axes **DayNight** : bool kwarg True (default) if panels should have separate markers for day and night otherwise (false) all are plotted together **LT_range** : list-like or NoneType Range of day night local time, or if None is supplied, [7, 19] is used to specify 07:00-19:00 LT for daytime and 19:00-07:00 LT for nighttime (default=None) **coin** : bool kwarg If True, coin LSS will be plotted for comparison (default) if false, coin LSS will not be plotted :Returns: **fig** : fig handle 4 panel figure (one for each LSS) .. seealso:: :obj:`io.load.multiday_states_report` .. .. rubric:: Notes LSS is only useful in comparison to another model, therefore, coin set to True is highly recommended! .. !! processed by numpydoc !! .. py:function:: map_hist_panel(ax, model, bin_lons=37, DayNight=True, LT_range=None) Plot histogram maps on a panel. :Parameters: **ax** : plt axis matplotlib.plt axis **model** : DataFrame DataFrame of model data including skill and local times built by states_report_swarm **bin_lons** : int Number of bins between -180 and 180 deg geo lon (default=37) **DayNight** : bool True if panels should have separate markers for day and night or False for all to be plotted together (default=True) **LT_range** : list-like or NoneType Range of day night local time, or if None is supplied, [7, 19] is used to specify 07:00-19:00 LT for daytime and 19:00-07:00 LT for nighttime (default=None) :Returns: **ax** : plt axis original axis with data plotted **hist_ax** : plt axis twinx axis to ax with histogram plotted .. !! processed by numpydoc !! .. py:function:: plot_hist_quad_maps(model_states, sat, eia_type, date_range, bin_lons=37, model_name='Model', fosi=16, hist_ylim=None, LT_range=None) Plot histograms for each Hit, Miss, False Pos, and Cor Neg. :Parameters: **model_states** : pd.DataFrame DataFrame of model data including skill and local times built by multiday_states_report **sat** : str swarm satellite 'A', 'B', or 'C' **eia_type** : str eia state e.g. EIA, Peak, etc. depending on what is considered a hit **date_range** : pd.DateRange range of dates for title purposes **bin_lons** : int Number of bins between -180 and 180 deg geo lon (default=37) **model_name** : str name of model for title purposes (default='Model') **fosi** : int font size for plot (default=16) **hist_ylim** : list-like or NoneType y range (counts) for hist plot, if None uses [0, 15] (default=None) **LT_range** : list-like or NoneType Range of day night local time, or if None is supplied, [7, 19] is used to specify 07:00-19:00 LT for daytime and 19:00-07:00 LT for nighttime (default=None) :Returns: **fig** : figure handle fig with 4 panels of hist maps .. seealso:: :obj:`io.load.multiday_states_report` .. .. !! processed by numpydoc !! .. py:function:: HMFC_percent_panel(model_states, df_table, fig, ax, eia_type, colors=None) Plot percentages of H/(H+M), M/(H+M), F/(F+C), C/(C+F) as 4 quadrants. :Parameters: **model_states** : pd.DataFrame DataFrame of model data including skill and local times built by multiday_states_report **df_table** : pd.DataFrame Decision table build by decision_table_sat **fig** : figure Figure for plotting on **eia_type** : str String designating which EIA type is being reported **colors** : list of strings or NoneType colors to be plotted for each satellite (default=None) **Returns** .. **------** .. **fig** : figure the resulting figure .. seealso:: :obj:`io.load.multiday_states_report` .. :obj:`stats.tables.decision_table_sat` .. .. !! processed by numpydoc !! .. py:function:: HMFC_percent_figure(model1, model2, eia_type, model1_name='Model1', model2_name='Model2', col1='orange', col2='purple', fosi=16) Plot full figure using HMFC_percent_panel. :Parameters: **model1** : pd.DataFrame First model DataFrame built by states_report_swarm **model2** : pd.DataFrame Second model DataFrame built by states_report_swarm **eia_type** : str Desired eia type for fig title **model1_name** : str First model name for labelling purposes (default='Model1') **model2_name** : str Second model name for labelling purposes (default='Model2') **col1** : str Plotting color for Model1 (default='orange') **col2** : str plotting color for Model 2 (default='purple') **fosi** : int font size for plot :Returns: **fig** : figure Figure handle .. rubric:: Notes This figure has a lot going on. When you look at it, think of each quadrant as a separate plot defined by Hit, Miss, Correct Negative, and False Positive as labelled. The percentages are the percent the model got correct or incorrect based on event states For example, for Hits, ther percentage is Hit/(Hit + Miss) where Hit+Miss is the total in the event states, the panel below that Miss/(Hit+Miss) is equivalent to 100% - Hit/(Hit + Miss), so those sectors are conjugate to each other For quick viewing, there are 4 shaded regions. These represent when a model is doing better than a coin toss. Ideally, False positives and Misses would have a low % and Hits and Correct Negatives have a higher percentage .. !! processed by numpydoc !! .. py:function:: plot_2hist_quad_maps(model_states, model2_states, sat, eia_type, date_range, bin_lons=37, model_name='Model', model2_name='Model2', fosi=16, hist_ylim=None, LT_range=None) Plot histogram maps for each score: Hit, Miss, False Pos, and Cor Neg. :Parameters: **model_states** : dataframe dataframe of model data including skill and local times built by states_report_swarm **sat** : str swarm satellite 'A', 'B', or 'C' **eia_type** : str eia state e.g. EIA, Peak, etc. depending on what is considered a hit **date_range** : pandas daterange range of dates for title purposes **bin_lons** : int kwarg number of bins between -180 and 180 deg geo lon default 37 np.linspace(-180, 180, bin_lons) **model_name** : str kwarg name of model for title purposes default 'Model' **fosi** : int kwarg font size for plot default 16 **hist_ylim** : list-like or NoneType y range (counts) for hist plot, or None for default of [0, 15] (default=None) LT_range : list-like or NoneType Range of day night local time, or None for default of [7, 19] (default=None) :Returns: **fig** : figure handle fig with 4 panels of hist maps .. !! processed by numpydoc !! .. py:function:: map_2hist_panel(ax, model, model2, bin_lons=37, DayNight=True, LT_range=None) Plot histogram maps on a panel for 2 models. :Parameters: **ax** : plt axis matplotlib.plt axis **model** : dataframe dataframe of model data including skill and local times built by states_report_swarm **bin_lons** : int kwarg number of bins between -180 and 180 deg geo lon np.linspace(-180, 180, bin_lons) **DayNight** : bool kwarg True (default) if panels should have separate markers for day and night otherwise (false) all are plotted together **LT_range** : list-like or NoneType Range of day night local time, or None for default of [7, 19] (default=None) :Returns: **ax** : plt axis original axis with data plotted **hist_ax** : plt axis twinx axis to ax with histogram plotted .. !! processed by numpydoc !!