ws_shape

../../_images/WS_SHAPE.png

Defines a shape Weather Symbol Object that can be visualised with plot().

New in Metview version 5.15.0.

Warning

The script-based Weather Symbol Object visualisation is currently restricted to the ‘screen’ output target (i.e. when the output is Metview’s plot window). On the one hand this requires the Metview GUI to be installed, on the other hand it limits the script-based visualisation to these cases:

  • execute the code in Metview’s Code Editor (the default output target here is already ‘screen’)

  • execute the code as a Jupyter notebook with the output target set to ‘screen’ (see setoutput()):

In any other cases, e.g. in batch mode, plot() does not work.

Note

This function performs the same task as the Ws Shape icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.

ws_shape(**kwargs)

Defines a shape Weather Symbol Object.

Parameters
  • type (str, default: "line") –

    Specifies the shape type. This also implicitly specifies the type of data which will be entered. The available types are as follows:

    • ”line”: straight line in all the projections

    • ”polyline”: points connected with straight lines in all the projections

    • ”curve”: points connected with a B-spline curve

    • ”polygon”: points forming a closed shape, connected with straight lines in all the projections

    • ”closed_curve”: points forming a closed shape, connected with a B-Spline curve

    • ”rectangle”: rectangle with straight edges. The corner points will be adjusted when the projection changes to preserve the rectangular shape.

    • ”proj_line”: a line sampled in lat-lon. The shape changes according to the projection.

    • ”proj_polyline”: points connected with edges sampled in lat-lon. The edge shapes change according to the projection.

    • ”proj_polygon”: points forming a closed shape, with edges sampled in lat-lon. The edge shapes change according to the projection.

    • ”proj_quad”: a lat-lon rectangle with edges sampled in lat-lon. The shape changes into various quadrilaterals according to the current projection.

  • line ({"on", "off"}, default: "on") – Enable to draw the line/outline.

  • line_colour (str, default: "black") – Colour of the line/outline. Enabled when line is “on”.

  • line_thickness (number, default: 1) – Thickness of the line/outline. Enabled when line is “on”.

  • line_style (line_style, default: solid) – Style of the line/outline. Enabled when line is “on”.

  • line_start_ptype ({"none", "open_arrow", "filled_arrow"}, default: "none") – Defines the arrow head for the start of the line. Enabled when type is “line”, “polyline”, “curve”, “proj_line” or “proj_polyline”.

  • line_end_ptype ({"none", "open_arrow", "filled_arrow"}, default: "none") – Defines the arrow head for the end of the line. Enabled when type is “line”, “polyline”, “curve”, “proj_line” or “proj_polyline”.

  • arrow_length (number, default: 10) – The length of the arrow head. Enabled when either line_start_ptype or line_end_ptype` is not ‘none’.

  • fill ({"on", "off"}, default: "on") – Enable to fill the shape.

  • fill_colour (str, default: "rgba(0,0,1,0.3)") – Fill colour of the shape. Enabled when fill is “on”.

  • segment_dateline_cross (ndarray or list of numbers) – special

  • segment_dx (ndarray or list of numbers) – special

  • x (ndarray or list of numbers, default: 0) –

    The x coordinates of the points making up the shape. The number of points required depends on the type:

    • For “line” and “proj_line” exactly 2 points are needed.

    • For “polyline”, “curve” and “proj_polyline” minimum 2 points are needed.

    • For “polygon”, “closed_curve” and “proj_polygon” minimum 3 points are needed.

    • For “rectangle” and “proj_quad” exactly 4 points are needed.

  • y (ndarray or list of numbers, default: 0) – The y coordinates of the points making up the shape. For the number of points required please see x.

  • geolock (on_off, default: off) – Sets the geolock on the item for interactive editing in the plot window.

  • tooltip (str) – Text that appears as a tooltip when the visualised object is hovered over in Metview’s plot window.

Return type

Request