netcdf_visualiser
Defines the visualisation of NetCDF
data allowing to specify which variables in the file should be used, and how to interpret them. The generated object can directly be used in plot()
.
Note
This function performs the same task as the Netcdf Visualiser icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.
- netcdf_visualiser(**kwargs)
Defines the visualisation of
NetCDF
data.- Parameters
netcdf_plot_type (str, default: "geo_points") –
Specifies the type of plot to be generated. The available modes are as follows:
”geo_points”
”geo_vectors”
”geo_matrix”
”geo_matrix_vectors”
”xy_points”
”xy_vectors”
”xy_matrix”
”xy_matrix_vectors”
netcdf_filename (str, default: "off") – Specifies the path to the NetCDF file to be used. Alternatively, use the
netcdf_data
field, which overridesnetcdf_filename
.netcdf_data (
NetCDF
) – Specifies the input data as aNetCDF
object.netcdf_latitude_variable (str) – Specifies which variable to use for the latitude co-ordinates. Only available when
netcdf_plot_type
is ‘geo_*’.’netcdf_longitude_variable (str) – Specifies which variable to use for the longitude co-ordinates. Only available when
netcdf_plot_type
is ‘geo_*’.netcdf_x_variable (str) – Specifies which variable to use for the x co-ordinates. Only available when
netcdf_plot_type
is ‘xy_*’.netcdf_y_variable (str) – Specifies which variable to use for the y co-ordinates. Only available when
netcdf_plot_type
is ‘xy_*’.netcdf_x2_variable (str) –
netcdf_y2_variable (str) –
netcdf_value_variable (str) – Specifies which variable supplies the values.
netcdf_x_component_variable (str) – When
netcdf_plot_type
is ‘*_vectors’, this parameter specifies which variable defines the vector component in X or longitude direction (e.g. U-component of wind).netcdf_y_component_variable (str) – When
netcdf_plot_type
is ‘*_vectors’, this parameter specifies which variable defines the vector component in Y or latitude direction (e.g. V-component of wind).netcdf_dimension_setting_method ({"index", "value"}, default: "value") – Method used to specify how to interpret the extraction of a subset, the range can by specified by value or by index.
netcdf_dimension_setting (list[str]) –
Extracts only of a subset of the data. Each dimension is specified as a str in “dim_name:start[:end]” format where the “end” is optional. The value for “start” and “end” have to be specified according to the settings in
netcdf_dimension_setting_method
. Some examples:In this example the subset is specified by the dimension called “level” and the subset is extracted for all “level” values between 100 and 500:
netcdf_dimension_setting_method="value" netcdf_dimension_setting=["level:100:500"]
In this example multiple dimensions are used:
netcdf_dimension_setting_method="value" netcdf_dimension_setting=["level:100:500", "number:1:2"]
In this example the subset is specified by the dimension called “time” and the subset is restricted to index=2:
netcdf_dimension_setting_method="index" netcdf_dimension_setting=["time:2"]
netcdf_matrix_primary_index ({"latitude", "longitude"}, default: "longitude") –
netcdf_position_type ({"array", "matrix"}, default: "array") – Specifies how to interpret the data.
netcdf_missing_attribute (str, default: "_fillvalue") – Specifies the NetCDF attribute that defines the missing value in the data.
- Return type
Request