credit.animation
================

.. py:module:: credit.animation


Attributes
----------

.. autoapisummary::

   credit.animation.projections
   credit.animation.variable_transforms


Functions
---------

.. autoapisummary::

   credit.animation.kgkg_to_gkg
   credit.animation.k_to_c
   credit.animation.k_to_f
   credit.animation.gp_to_height_dam
   credit.animation.pa_to_hpa
   credit.animation.plot_global_animation
   credit.animation.plot_regional_animation


Module Contents
---------------

.. py:data:: projections

.. py:function:: kgkg_to_gkg(q)

.. py:function:: k_to_c(temperature)

.. py:function:: k_to_f(temperature)

.. py:function:: gp_to_height_dam(gp)

.. py:function:: pa_to_hpa(pressure)

.. py:data:: variable_transforms

.. py:function:: plot_global_animation(forecast_dir: str, init_date: str, forecast_step: int, final_forecast_step: int, output_video_file: str = './credit_prediction.mp4', contourf_config: dict = None, contour_config: dict = None, projection_type: str = 'robinson', projection_config: dict = None, title: str = 'CREDIT Prediction', date_format: str = '%Y-%m-%d %HZ', figure_kwargs: dict = None, axes_rect: tuple = (0.02, 0.02, 0.96, 0.96), fontsize: int = 12, coastline_kwargs: dict = None, border_kwargs: dict = None, colorbar_kwargs: dict = None, save_kwargs: dict = None)

   Customizable function for plotting animations of global CREDIT predictions.

   This function enables plotting multiple weather fields on the same map and animating the map through
   time using matplotlib animation.

   :param forecast_dir: Path to directory containing forecast netCDF files for a single init date
   :param init_date: Date of initial conditions for forecast
   :param forecast_step: Length of time between forecasts in hours. Usually 1 or 6
   :param final_forecast_step: Lead time of last forecast step plotted in hours.
   :param output_video_file: Path to output mp4 file.
   :param contourf_config: dict containing settings for filled contour plot
   :param contour_config: dict containing settings for  contour plots organized by variable.
   :param projection_type: Type of global projection. Default is 'robinson'.
   :param projection_config: dict containing settings for global projection plot
   :param title: String for beginning of title
   :param date_format: Format of date displayed in plot title
   :param figure_kwargs: Kwargs for figure
   :param axes_rect: Dimensions of figure axes (left, bottom, right, top) ranging from 0 to 1.
   :param fontsize: Fontsize of title
   :param coastline_kwargs: Properties for plotting coastlines.
   :param border_kwargs: Properties for plotting national borders.
   :param colorbar_kwargs: Properties for plotting colorbar.
   :param save_kwargs: Properties for saving video.

   .. rubric:: Examples

   How to configure a contourf::

       q_config = dict(variable="Q_PRES",
                       level=850,
                       contourf_kwargs=dict(levels=[1, 2, 3, 4, 5],
                                            cmap="viridis",
                                            extend="max"))

   How to configure a contour::

       contour_config = dict(temp=dict(variable="T_PRES",
                                       level=850,
                                       contour_kwargs=dict(levels=[-10, -5, 0, 5, 10, 15, 20],
                                       cmap="RdBu_r"),
                             z=dict(variable="Z_PRES",
                                    level=850,
                                    contour_kwargs=dict(levels=np.arange(120, 183, 3),
                                                        colors='k')
                                    )
                            )


.. py:function:: plot_regional_animation(forecast_dir: str, init_date: str, forecast_step: int, final_forecast_step: int, extent, output_video_file: str = './credit_prediction.mp4', contourf_config: dict = None, contour_config: dict = None, projection_type: str = 'robinson', projection_config: dict = None, title: str = 'CREDIT Prediction', date_format: str = '%Y-%m-%d %HZ', figure_kwargs: dict = None, axes_rect: tuple = (0.02, 0.02, 0.98, 0.96), fontsize: int = 12, coastline_kwargs: dict = None, border_kwargs: dict = None, colorbar_kwargs: dict = None, save_kwargs: dict = None)

   Not implemented yet.

   Returns:



