Description of Formulas - Grids

The following describes each formula included in the Grids Formulas section of McIDAS-V.

**Note:** If the formula you select utilizes a Select Input window to enter values to be used by the formula, you can choose if you want to save these values in a bundle if you wish to create one. Each field of the Select Input window has a **Save in Bundle** option (chosen by default). If you keep this option selected, the value(s) you choose will be stored in the bundle, and if all values are saved, the formula will automatically execute when you load in your bundle without any user input. If you do not save the values in your bundle, the values you use will not be saved, and the formula will not automatically execute without requiring the user to enter/change values. Many of the formulas below were provided by Brian Mapes, which are denoted by an asterisk (*) next to the formula's name.

**Change Unit of a parameter (grid, unit,multiplyfactor)* -**Changes the unit of the field being displayed and optionally scales the output values.**Input Parameter****Definition***unit*The unit to be used when displaying the data.

*multiplyfactor*The factor to scale/multiply the data by (default=1.0)

**Define a grid diagnostic (gddiag) -**Defines a grid diagnostic to perform.**Input Parameter****Definition***gddiag*Grid diagnostic. For more information, see the Grid Diagnostics section of Jython Library.

**Deviation from Lat Lon Area Average (grid)* -**Computes the deviation from area average values of the grid and returns a grid with deviation from the area averaged value.**Deviation from Lat Lon Time Average (grid)* -**Computes the deviation from time and spatial mean at each grid point.**Find latitude of grid points (fieldimpl) -**Obtains the latitude coordinate from the grid at each location and plots the latitude at each point on the map.**Find longitude of grid points (fieldimpl)**- Obtains the longitude coordinate from the grid at each location and plots the longitude at each point on the map.**Create 2D Trajectory (parameter, U Component, V Component)**- Uses the Trajectory Colored By Parameter display type to plot 2-dimensional trajectories from data that includes u- and v-wind components and a scalar quantity to color the trajectories by. For information on how to work with this display, see Grid Trajectory Controls.**Input Parameter****Definition***parameter*The scalar quantity that the trajectories will be colored by.

*U Component*The u-component of the wind.

*V Component*The v-component of the wind.

**Create 3D Trajectory (parameter, U Component, V Component, W Component)**- Uses the Trajectory Colored By Parameter display type to plot 3-dimensional trajectories from data that includes u-, v-, and w-wind components. For information on how to work with this display, see Grid Trajectory Controls.**Input Parameter****Definition***parameter*The scalar quantity that the trajectories will be colored by.

*U Component*The u-component of the wind.

*V Component*The v-component of the wind.

*W Component*The vertical component of the data.

**Horizontal Advection (from %N1% & %N2%) (scalar parameter, U Component, V Component)**- Calculates horizontal advection from U and V components.**Input Parameter****Definition***scalar parameter*Scalar Parameter (the parameter that will be mapped).

*U Component*The u-component of the wind.

*V Component*The v-component of the wind.

**Horizontal Flux Divergence (from %N1% & %N2%) (scalar parameter, U Component, V Component) -**Calculates horizontal flux divergence from u and v components.**Input Parameter****Definition***scalar parameter*Scalar Parameter (the parameter that will be mapped).

*U Component*The u-component of the wind

*V Component*The v-component of the wind.

**Layer Difference (Top of Layer, Bottom of Layer) -**Calculates a layer difference between a field at two different levels. Note that you must select a 3D field to use this formula.**Input Parameter****Definition***Top of Layer*Top layer (default=500)

*Bottom of Layer*Bottom layer (default=1000)

**Layer Wind Shear (top, bottom) -**Calculates the wind shear between two user-defined layers. Note that you must select 3D fields to use this formula.**Input Parameter****Definition***top*Top layer (default=500)

*bottom*Bottom layer (default=850)

**Make flow vectors from directional data (windDir) -**Calculates true wind vectors based off of wind direction data.**Input Parameter****Definition***windDir*The wind direction field.

**Make flow vectors from grid relative u and v data (u, v) -**Calculates true wind vectors based off of relative u and v data after user inputs the field and desired levels. You can utilize 2D or 3D fields.**Input Parameter****Definition***u*The u-component of the wind.

*v*The v-component of the wind.

**Make flow vectors from u and v data (u, v) -**Creates flow vectors based off of the 2D u and v parameters entered by the user.**Input Parameter****Definition***u*The u-component of the wind.

*v*The v-component of the wind.

**Make flow vectors from u, v, and w data (u, v, w) -**Creates flow vectors based off of the 3D u and v parameters entered by the user. These flow vectors are then scaled based off the user-entered w parameter.**Input Parameter****Definition***u*The u-component of the wind.

*v*The v-component of the wind.

*w*The w-component of the wind (vertical velocity).

**Make slice 2D (slice) -**Creates a 2D slice from a 3D display at a single level.**Input Parameter****Definition***slice*The parameter utilized to create the display.

**One value colored by another (Data field, Color field) -**Creates an image of the data chosen in the Data field, and colors the data with the color scheme of the Color field parameter.**Input Parameter****Definition***Data field*The parameter that is mapped in the display.

*Color field*The parameter whose color field will be used to plot the parameter selected under Data field.

**Rebin Grid (grid, newGrid)* -**Rebins or regrids a grid based on coordinates of newGrid using bilinear interpolation.**Input Parameter****Definition***grid*The parameter to be displayed.

*newGrid*A parameter from a grid whose resolution and coordinates will be used for displaying the original grid.

**Resample grid (grid, gridwithNewDomain) -**Displays gridded data on a new domain.**Input Parameter****Definition***grid*The parameter that is mapped in the display.

*gridwithNewDomain*The parameter whose domain will be used to plot the parameter selected under grid.

**Simple time difference in one parameter (Time 1, Time 2) -**Creates an image representing the numerical difference in the value of the chosen parameter between the two time steps selected by the user. Time 1 is the initial time step and Time 2 is the second time step. For example, if you select Time 1 to be 10, and Time 2 to be 0, then the formula will utilize the most recent time, and the 10th most recent time. The difference in the parameter is done by Time 2 - Time 1.**Input Parameter****Definition***Time 1*First time (default=1)

*Time 2*Second time (default=0)

**Slice at Altitude (Altitude, Unit) -**Extracts a 2D horizontal slice from a 3D grid at the given altitude and maps an image.**Input Parameter****Definition***altitude*Altitude to slice.

*unit*Specify a unit. It must be compatible with meters (ft, fathoms, etc.)

**Slice at Level (Level) -**Extracts a 2D horizontal slice from a 3D grid at a level and maps the image.**Input Parameter****Definition***level*Level to slice. Must be appropriate for the grid.

**Speed from 2 components (x, y) -**Calculates speed from the user-chosen x and y components and displays an image.**Input Parameter****Definition***x*The x-component of the wind.

*y*The y-component of the wind.

**Vertical Average Weighted (grid)* -**Computes a vertical coordinate weighted average of a 3D grid.**Wind Shear Vectors (top, bottom) -**Calculates the u and v layer difference and returns a map of vectors.**Input Parameter****Definition***top*Top layer (default=500)

*bottom*Bottom layer (default=850)

**9-point hor. smoothing* -**Returns a smoothed field using 9-point smoothing.**Gaussian hor. smoothing (N)* -**Returns a smoothed field using Gaussian horizontal smoothing at a user-defined factor (N).**Input Parameter****Definition***N*Smoothing factor (default=6)

**Rectangular hor. smoothing, in grid increments (N)* -**Returns a smoothed field using Rectangular horizontal smoothing at a user-defined factor (N).**Input Parameter****Definition***N*Smoothing factor (default=2)

**circular hor. smoothing, in grid increments (N)* -**Returns a smoothed field using Circular horizontal smoothing at a user-defined factor (N).**Input Parameter****Definition***N*Smoothing factor (default=2)

**Accumulate from initial timestep -**Plots the specified parameter in the Main Display window. Each frame is a total of the parameter at the time in addition to the total value of the parameter in previous time steps. The formula to compute this is as follows, where T represents the current time step, and numbers 0, 1, etc. represent the previous time steps:D(T) = D(0) + D(1) + .. + D(T)

**Average Time steps -**Plots one map representing the average value of the specified parameter at any one point on the map during the time sequence selected.**Difference from initial timestep -**Plots a sequence of images. Each image maps the difference in the numerical value of the parameter from the initial values of the first frame. This formula sets the value of each time step N as:D(T) = D(T) - D(0)

**Max over time steps -**Plots one map representing the highest value of the specified parameter at any point on the map during the time sequence selected.**Merge time sequences -**Creates a loop of images where while the images will be in order with respect to time, you do not need to load in every time step.**Min over time steps -**Plots one map representing the lowest value of the specified parameter at any one point on the map during the time sequence selected.**Running Average (No. of Steps, End Point Option) -**Generates a running average of your specified parameter and plots the data in the Main Display window.**Input Parameter****Definition***No. of steps*The number of steps to average over.

*End Point Option*The option for unsmoothed end points. 0 = set to missing; 1 = use symmetry; -1= assume cyclic

**Time step difference -**Plots a sequence of images. Each frame plots the value of the specified parameter at that time, and subtracts from it the value of the same parameter at the previous time in the loop.D(T) = D(T) - D(T-1)

**Time step sum -**Plots a sequence of images. Each frame plots the value of the specified parameter at that time, and adds to it the value of the same parameter at the previous time step in the loop.D(T) = D(T) + D(T-1)

**Total sum over times -**Plots one image with the total value of your selected parameter summed up over your chosen number of time steps.**Weighted running average (Weights, End Point Option) -**Generates an image of the weighted running average of your selected parameter.**Input Parameter****Definition***Weights*The weight you wish to give to your running average. Separate multiple values with a comma.

*End Point Option*The option for unsmoothed end points. 0 = set to missing; 1 = use symmetry; -1= assume cyclic

**Anomaly from Time Means* -**Computes the deviation from time mean for all selected times at each grid point.**Compute anomaly from daily means* -**Computes the deviation from time mean for each day at each grid point.**Compute anomaly from monthly means* -**Computes the deviation from time mean for each day at each grid point.**Compute anomaly from time means at specified time type (meanType)* -**Computes the deviation from the time mean at the user-defined interval at each grid point.**Input Parameter****Definition***meanType*The time mean to use (default=yearly)

**Compute anomaly from yearly means* -**Computes the deviation from time mean for each year at each grid point.**Compute daily means* -**Computes a time mean of a grid for all selected times at each grid point.**Compute monthly means* -**Computes a time mean of a grid for each day at each grid point.**Compute time derivative with preferred time unit (timeUnit)* -**Computes a time derivative at a user-defined interval at each grid point.**Input Parameter****Definition***timeUnit*The time unit to use (default=day)

**Compute time means at specified time type (meanType)* -**Computes a time mean of a grid at the user-defined interval at each grid point.**Input Parameter****Definition***meanType*The time mean to use (default=yearly)

**Compute yearly means* -**Computes a time mean of a grid for each year at each grid point.**Sample a grid at times specified (year, season, day of month, hour of day, minute of hour, seconds, milliseconds)* -**Samples a grid at specified time periods, multiple arguments can be used in complex sampling. For example, using "hour=5" would return all samples corresponding to time 5. Further, specifying "year=2018" would give samples at time 5 in year 2018.**Input Parameter****Definition***year*Year as yyyy (default=None)

*season*Season (default=None)

Valid values include:- DJF - December, January, February
- JFM - January, February, March
- MAM - March, April, May
- JJA - June, July, August
- SON - September, October, November
- OND - October, November, December
- JJAS - June, July, August, September

*month*Month as MM (default=None)

*day of month*Day of month as dd (default=None)

*hour of day*Hour of day as hh (default=None)

*minute of hour*Minute of hour as mm (default=None)

*seconds*Seconds as ss (default=None)

*milliseconds*Milliseconds as ms (default=None)

**Divide Grids* -**Divides two grids.**Modulo with a number (number)* -**Returns the modulo at every value of the grid with given number.**Input Parameter****Definition***number*The number to use. There is no default value.

**Multiply Grids* -**Multiplies two grids.**Vertical Derivative* -**Computes the vertical derivative of a 3D parameter at user-specified vertical levels.

**Ensemble average over all grid members -**Averages the chosen ensemble members over each time step and plots the data.**Ensemble grid highest values -**Takes the highest numerical value of the chosen parameter over the chosen number of ensemble members and plots the data.**Ensemble grid lowest values -**Takes the lowest numerical value of the chosen parameter over the chosen number of ensemble members and plots the data.**Ensemble grid mode values -**Takes the mode value of the chosen parameter over the chosen number of ensemble members and plots the data.**Ensemble grid percentile values -**Plots the ensemble average at the chosen percentage. The higher the percentage, the higher the values plotted in the display will be.**Ensemble grid range of values -**Takes the difference between the upper bound and lower bound of the chosen parameter over the chosen number of grid ensembles and plots the result.**Ensemble grid standard deviation -**Plots the standard deviation of the chosen parameter over the chosen number of ensemble members.**Ensemble grid univariate probability -**Plots the probability that certain user-provided conditions will be met for the specified parameter.**Input Parameter****Definition***P(GridVaiable lt|gt a)*The mathematical operation (less than or greater than) that will operate around value 'a'.

*a*The value used by the operator chosen above.

*P1 (and|or) P2*Determines if you want to display the probability of threshold values 'a' or 'b' to both be used to create

the display, or if you want one or the other to work.

*P(GridVariable lt|gt b) (optional)*The mathematical operation (less than or greater than) that will operate around value 'b'.

*b (optional)*The value used by the operator chosen above.

*Expected Lower Bound (optional)*The expected lower numerical bound of your chosen field.

*Expected Upper Bound (optional)*The expected upper numerical bound of your chosen field.

- Example: P=gt, a=90000, P1=and, P=lt, b=100000, field='Pressure reduced to MSL'. In this example, probabilities will be mapped in the Main Display window for the chosen number of times/ensemble members that the pressure will be greater than 90,000 Pa and that the pressure is less than 100,000 Pa.