Skip to content

Latest commit

 

History

History
166 lines (114 loc) · 6.54 KB

Find-AR-axis.rst

File metadata and controls

166 lines (114 loc) · 6.54 KB

Find the axis from detected AR

Axis-finding in a planar graph framework

After detect_ars, a binary mask Ik representing the spatial region of each candidate AR is obtained. An axis is sought from this region that summarizes the shape and orientation of the AR. A solution in a planar graph framework is proposed here.

A directed planar graph is build using the coordinate pairs (λk, ϕk) as nodes (see Figure fig1 below). At each node, directed edges to its eight neighbors are created, so long as the moisture flux component along the direction of the edge exceeds a user-defined fraction (ϵ, see the PARAM_DICT in detect_params) to the total flux. The along-edge flux is defined as:


fij = uisin (α) + vicos (α)

where fij is the flux along the edge eij that points from node ni to node nj, and α is the azimuth angle of eij.

Therefore an edge can be created if $f_{ij}/\sqrt{u_i^2+v_i^2} \geq \epsilon$. It is advised to use a relatively small ϵ = 0.4 is used, as the orientation of an AR can deviate considerably from its moisture fluxes, and denser edges in the graph allows the axis to capture the full extent of the AR.

Schematic diagram illustrating the planar graph build from the AR pixels and horizontal moisture fluxes. Nodes are taken from pixels within region Ik, and are represented as circles. Red vectors denote IVT vectors. The one at node ni forms an angle θ with the x-axis, and has components (u, v). Black arrows denote directed edges between nodes, using an 8-connectivity neighborhood scheme. The edge between node ni and nj is eij, and forms an azimuth angle α with the y-axis. wij is the weight attribute assigned to edge eij, and fij is along-edge moisture flux.

The boundary pixels of the AR region are then found, labeled Lk. The trans-boundary moisture fluxes are compute as the dot product of the gradients of Ik and (uk, vk): Ik ⋅ (uk, vk).

Then the boundary pixels with net input moisture fluxes can be defined as:


Lk, in = {p ∈ Lk ∣ (∇Ik ⋅ (uk, vk))(p) > 0}

Similarly, boundary pixels with net output moisture fluxes is the set


Lk, out = {p ∈ Lk ∣ (∇Ik ⋅ (uk, vk))(p) < 0}

These boundary pixels are colored in green and black, respectively, in fig2.

Application of the axis finding algorithm on the AR in the North Pacific, 2007-Dec-1, 00 UTC. IVT within the AR is shown as colors, in kg/(m ⋅ s). The region of the AR (Ik) is shown as a collection of gray dots, which constitute nodes of the directed graph. Edges among neighboring nodes are created. A square marker is drawn at each boundary node, and is filled with green if the boundary node has net input moisture fluxes (ni ∈ Lk, in), and black if it has net output moisture fluxes (ni ∈ Lk, out). The found axis is highlighted in yellow.

For each pair of boundary nodes {(ni, nj) ∣ ni ∈ Lk, in, nj ∈ Lk, out}, a simple path (a path with no repeated nodes) is sought that, among all possible paths that connect the entry node ni and the exit node nj, is the shortest in the sense that its path-integral of weights is the lowest.

The weight for edge eij is defined as:


wij = e − fij/A

where fi, j is the projected moisture flux along edge ei, j and A = 100 kg/(m ⋅ s) is a scaling factor.

This formulation ensures a non-negative weight for each edge, and penalizes the inclusion of weak edges when a weighted shortest path search is performed.

The Dijkstra path-finding algorithm is used to find this shortest path pij*.

Then among all pij* that connect all entry-exit pairs, the one with the largest path-integral of along-edge fluxes is chosen as the AR axis, as highlighted in yellow in fig2.

It could be seen that various aspects of the physical processes of ARs are encoded. The shortest path design gives a natural looking axis that is free from discontinuities and redundant curvatures, and never shoots out of the AR boundary. The weight formulation assigns smaller weights to edges with larger moisture fluxes, "urging: the shortest path to pass through nodes with greater intensity. The found axis is by design directed, which in certain applications can provide the necessary information to orient the AR with respect to its ambiance, such as the horizontal temperature gradient, which relates to the low level jet by the thermal wind relation.

Usage in Python scripts

The following snippet shows the axis finding process: :

from ipart.AR_detector import findARAxis
axis_list, axismask=findARAxis(quslab, qvslab, mask_list, costhetas,
    sinthetas, param_dict)

where:

  • quslab, qvslab are the u- and v- component of integrated vapor fluxes at a given time point.
  • mask_list is a list of binary masks denoting the region of an each found AR.
  • sinthetas and costhetas are used to compute the azimuthal angles for each grid cell.
  • param_dict is the parameter dictionary as defined in detect_params.

:pyAR_detector.findARAxis, :pyAR_detector.maskToGraph, :pyAR_detector.getARAxis.

Dedicated Python script

No detected Python script is offered for this process, as it is performed in the :pyAR_detector.findARsGen() function.

Notebook example

An example of this process is given in this notebook.