Exemple #1
0
def plot_interactive_forecast(fcst, variable_name=None, **kwdargs):
    variable_name = variable_name or utils.infer_variable(fcst)
    variable = query_utils.get_variable(variable_name)
    if isinstance(variable, schemes.VelocityVariable):
        interactive.InteractiveVelocity(fcst, variable, **kwdargs)
    else:
        raise NotImplementedError("Only support velocity variables at "
                                  "the moment.")
Exemple #2
0
def plot_gridded_forecast(fcst, variable_name=None, **kwdargs):
    """
    Creates an interactive plot of a gridded forecast.
    """
    variable_name = variable_name or utils.infer_variable(fcst)
    variable = query_utils.get_variable(variable_name)
    if isinstance(variable, schemes.VelocityVariable):
        velocity.VelocityField(fcst, variable, **kwdargs)
    else:
        raise NotImplementedError("Only support velocity variables at "
                                  "the moment.")
Exemple #3
0
def plot_spot(fcst, variable_name=None):
    """
    Takes a forecast that is assumed to hold a spot forecast and
    infers the type of variable then uses the corresponding plot utilities.
    """
    variable_name = variable_name or utils.infer_variable(fcst)
    variable = query_utils.get_variable(variable_name)
    if isinstance(variable, schemes.VelocityVariable):
        spot.spot_velocity(fcst, variable)
    else:
        raise NotImplementedError("Only support velocity variables at "
                                  "the moment.")