Class VectorPlugin


  • public class VectorPlugin
    extends VariablePlugin
    A plugin to generate magnitude and direction fields from x- and y-components, and to group them logically. Direction fields are always generated as headings, in degrees, in WGS84 (i.e. lat-lon), regardless of the CRS of the original data.
    Author:
    Guy Griffiths
    • Constructor Detail

      • VectorPlugin

        public VectorPlugin​(String xComponentId,
                            String yComponentId,
                            String commonName,
                            boolean eastNorthComps)
        Construct a new VectorPlugin
        Parameters:
        xComponentId - The ID of the variable representing the x-component
        yComponentId - The ID of the variable representing the y-component
        commonName - The common part of the standard name of the quantity which the components represent. For example, for components with standard names eastward_sea_water_velocity and northward_sea_water_velocity this would most likely be "sea_water_velocity"
        eastNorthComps - true if the components supplied are eastwards/northwards (which may not necessarily be x/y components in the native grid system)
    • Method Detail

      • generateValue

        protected Number generateValue​(String varSuffix,
                                       HorizontalPosition position,
                                       Number... sourceValues)
        Description copied from class: VariablePlugin
        Subclasses should override this method to generate values based on source variable values
        Specified by:
        generateValue in class VariablePlugin
        Parameters:
        varSuffix - The suffix ID of the variable to generate VariableMetadata for. This will be one of the provided suffixes in the constructor, but not the actual variable ID (which subclasses do not need to worry about)
        position - The HorizontalPosition at which the value is generated. This may affect the returned value
        sourceValues - An array of Numbers representing the source values in the order they were supplied to the constructor
        Returns:
        The derived value