コード例 #1
0
def _alerts_map_wind_legend(ax, theme):
    shared.plot_wind_arrow(ax, -122.5, 50.65, 0, -5, theme)
    ax.text(
        -122.58,
        50.5,
        "Reference: 5 m/s",
        rotation=90,
        fontproperties=theme.FONTS["axes annotation"],
        color=theme.COLOURS["text"]["axes annotation"],
    )
    shared.plot_wind_arrow(ax, -122.75, 50.65, 0, unit_conversions.knots_mps(-5), theme)
    ax.text(
        -122.83,
        50.5,
        "Reference: 5 knots",
        rotation=90,
        fontproperties=theme.FONTS["axes annotation"],
        color=theme.COLOURS["text"]["axes annotation"],
    )
    ax.text(
        -122.85,
        49.9,
        "Winds are 4 hour\n" "average before\n" "maximum water level",
        verticalalignment="top",
        bbox=theme.COLOURS["axes textbox"],
        fontproperties=theme.FONTS["axes annotation"],
        color=theme.COLOURS["text"]["axes annotation"],
    )
コード例 #2
0
def _plot_alerts_map(ax, coastline, plot_data, theme):
    shared.plot_map(ax, coastline)
    for name in places.TIDE_GAUGE_SITES:
        shared.plot_risk_level_marker(ax, name, plot_data.risk_levels[name],
                                      'o', 55, 0.3, theme)
        shared.plot_wind_arrow(ax, *places.PLACES[name]['lon lat'],
                               plot_data.u_wind_4h_avg[name],
                               plot_data.v_wind_4h_avg[name], theme)
    # Format the axes and make it pretty
    _alerts_map_axis_labels(ax, plot_data.ssh_ts.time[0], theme)
    _alerts_map_wind_legend(ax, theme)
    _alerts_map_geo_labels(ax, theme)
コード例 #3
0
def _plot_alerts_map(ax, coastline, plot_data, theme):
    shared.plot_map(ax, coastline)
    for name in places.TIDE_GAUGE_SITES:
        alpha = 0 if numpy.isnan(plot_data.max_ssh[name]) else 0.3
        shared.plot_risk_level_marker(
            ax, name, plot_data.risk_levels[name], "o", 55, alpha, theme
        )
        shared.plot_wind_arrow(
            ax,
            *places.PLACES[name]["lon lat"],
            plot_data.u_wind_4h_avg[name],
            plot_data.v_wind_4h_avg[name],
            theme,
        )
    # Format the axes and make it pretty
    _alerts_map_axis_labels(ax, plot_data.ssh_ts.time[0], theme)
    _alerts_map_wind_legend(ax, theme)
    _alerts_map_geo_labels(ax, theme)
コード例 #4
0
def _alerts_map_wind_legend(ax, theme):
    shared.plot_wind_arrow(ax, -122.5, 50.65, 0, -5, theme)
    ax.text(-122.58,
            50.5,
            'Reference: 5 m/s',
            rotation=90,
            fontproperties=theme.FONTS['axes annotation'],
            color=theme.COLOURS['text']['axes annotation'])
    shared.plot_wind_arrow(ax, -122.75, 50.65, 0,
                           unit_conversions.knots_mps(-5), theme)
    ax.text(-122.83,
            50.5,
            'Reference: 5 knots',
            rotation=90,
            fontproperties=theme.FONTS['axes annotation'],
            color=theme.COLOURS['text']['axes annotation'])
    ax.text(-122.85,
            49.9, 'Winds are 4 hour\n'
            'average before\n'
            'maximum water level',
            verticalalignment='top',
            bbox=theme.COLOURS['axes textbox'],
            fontproperties=theme.FONTS['axes annotation'],
            color=theme.COLOURS['text']['axes annotation'])