table_visualiser
Controls the parsing and plotting of ASCII Tables such as CSV. The columns used for plotting can be selected by name (if there is a header row) or by index, starting at 1. The points may be interpreted as either geographic co-ordinates or as generic X/Y co-ordinates. The generated object can directly be used in plot()
.
Note
This function performs the same task as the Table Visualiser icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.
- table_visualiser(**kwargs)
Defines the visualisation of ASCII tables (e.g. CSV).
- Parameters
table_plot_type (str, default: "xy_points") –
Specifies the type of plot to be generated. This also implicitly specifies the type of data which will be entered. The available modes are as follows:
”xy_points”
”geo_points”
”xy_vectors”
”geo_vectors”
”xy_binning”: the points will be gridded specified by
binning
.”geo_binning”: the points will be gridded specified by
binning
.
table_filename (str, default: "off") – Specifies the path to the ASCII table file to be used. Alternatively, use the
table_data
field, which overridestable_filename
.table_data (
read_table()
) – Specifies the input data byread_table()
.table_x_type ({"number", "date"}, default: "number") – Specifies how the X values should be interpreted. Only available when
table_plot_type
is “xy_*”.table_y_type ({"number", "date"}, default: "number") – Specifies how the Y values should be interpreted. Only available when
table_plot_type
is “xy_*”. type plots.table_variable_identifier_type ({"name", "index"}, default: "name") – Specifies how to identify the columns to use: by “name” or by “index” (starting at 1).
table_x_variable (number or str) – Specifies which variable/column to use for the x co-ordinates of the points. Can be a name or an index - see
table_variable_identifier_type
. Only available whentable_plot_type
is ‘xy_*’ andtable_x_type
is “number”.table_y_variable (number or str) – Specifies which variable/column to use for the y co-ordinates of the points. Can be a name or an index - see
table_variable_identifier_type
. Only available whentable_plot_type
is ‘xy_*’ andtable_y_type
is “number”.table_x_missing_value (number, default: -21.e6) – Points with this value in their x co-ordinate will not be plotted.
table_y_missing_value (number, default: -21.e6) – Points with this value in their y co-ordinate will not be plotted.
table_longitude_variable (number or str) – Specifies which variable/column to use for the longitude co-ordinates of the points. Can be a name or an index - see
table_variable_identifier_type
. Only available whentable_plot_type
is ‘geo_*’.table_latitude_variable (number or str) – Specifies which variable/column to use for the latitude co-ordinates of the points. Can be a name or an index - see
table_variable_identifier_type
. Only available whentable_plot_type
is ‘geo_*’.table_x_component_variable (number or str) – When
table_plot_type
is ‘*_vectors’, this parameter specifies which variable/column defines the vector component in X or longitude direction (e.g. U-component of wind). Can be a name or an index - seetable_variable_identifier_type
.table_y_component_variable (number or str) – When
table_plot_type
is ‘*_vectors’, this parameter specifies which variable/column defines the vector component in Y or latitude direction (e.g. V-component of wind). Can be a name or an index - seetable_variable_identifier_type
.table_value_variable (number or str) – Specifies which variable/column supplies the values for the points. Can be a name or an index - see
table_variable_identifier_type
.table_binning (
binning()
) – Specifies the binning. Available whentable_plot_type
is “*_binning”.table_delimiter (str, default: ",") – Specifies the (single) character that separates values in the table.
table_combine_delimiters ({"on", "off"}, default: "off") – If it is set to “on”, then consecutive delimiters will be considered as one. This is often the case when whitespace is used to separate values which are aligned in columns. Note that in this case, it is not possible to represent missing values in the table. If “off”, then a delimiter not surrounded by two data values indicates there is a missing value on at least one side of it. See ASCII Tables for more details.
table_header_row (number, default: 1) – Specifies which row of the table file contains the names of the columns. This row, if present, should contain the one entry for each data column, separated with the same delimiter as the data. The first row of the table is number 1. Set this parameter to 0 in order to indicate that there is no header row.
table_data_row_offset (number, default: 1) – Specifies how many rows after the header row the first data row appears. Normally this is 1, since data tends to start on the row after the column headers. If there is no header row, then this number is equivalent to the first data row (e.g. if the data starts on row 3, then set this parameter to 3).’
table_meta_data_rows (number or list) – Specifies the rows (if any) which contain meta-data in a form which can be parsed by Metview. See ASCII Tables macro_table> for more details.
- Return type
Request