# MEC: A Mesoscale Events Classifier for Oceanographic Imagery
## 4 MEC Explained
### Classification Rules  
For each square \(a_{i,j}\) in the area of interest, a score array \(e_{i,j}=(e_{i,j^{\prime}}^{1},e_{i,j^{\prime}}^{2},e_{i,j^{\prime}}^{3},e_{i,j ^{\prime}}^{4},e_{i,j}^{4})\), with \(e_{i,j}^{k}\in[0,1]\) is computed. The value \(e_{i,j}^{k}\) is an index representing how much an event of type E\(k\) is believed to have occurred inside \(a_{i,j}\) at the end of the time period. Each \(e_{i,j}^{k}\) is computed by applying a set of conditional rules to the statistics described in Section 4.2. In particular, the scores for a square \(a_{i,j}\) depend not only on \(\mu_{i,j}\), \(\sigma_{i,j}\) and \(\theta_{i,j}\) but also on the values of \(\mu,\sigma\) and \(\theta\) for the squares in its proximity, with different kinds of neighbourhoods depending on the specific rule (see Figure 5). The rules are handcrafted to mirror the behaviour of the SST trends during the course of different types of upwelling events, so that the score \(e_{i,j}^{k}\) is increased only if the changing in the values of \(\mu,\sigma,\) and \(\theta\) in and nearby \(a_{i,j}\) matches the one observed during an event of type E\(k\). Figure 4: Computed statistics for the period between 30 July and 13 August 2016. Figure 5: Neighbouring squares of \(a_{i,j}\) used in the classification rules. (**a**) Full neighbourhood of \(a_{i,j}\); the values of the statistics for the squares in it are used in at least one of the rules for the computation of \(e_{i,j}\). (**b**) Squares used in the rules for \(e_{i,j}^{1}\): eastern squares (orange), northern squares (green), and southern squares (purple). (**c**) Squares used in the rules for \(e_{i,j}^{2}\): northern squares (green), eastern squares (orange), and western squares (blue). (**d**) Squares used in the rules for \(e_{i,j}^{3}\) and \(e_{i,j}^{4}\): the northwestern (respectively, southeastern) neighbourhood of \(a_{i,j}\) is composed of the teal (respectively magenta) non-land squares that have the same distance from the coast as \(a_{i,j}\). The following is a detailed description of the classification rules. They are cumulative, i.e., each condition in these lists is tested independently and, if it is verified, increases the score \(e_{i,j}^{k}\) by a fixed amount. 1. Increase \(e_{i,j}^{1}\) if: 1. The SST trend \(\theta_{i,j}\) inside \(a_{i,j}\) is negative; 2. The SST trend of the eastern neighbouring squares (see Figure 5b) is lower than \(\theta_{i,j}\); 3. The SST mean value \(\mu_{i,j}\) is lower than the averages of the mean values of the SST in the northern and southern neighbouring squares (the two neighbourhoods are tested separately, each increasing the score if the outcome is positive, and an extra increase is awarded if both are verified). 2. Increase \(e_{i,j}^{2}\) if: 1. The SST trend \(\theta_{i,j}\) inside \(a_{i,j}\) is negative; 2. The SST trend of the northern neighbouring squares (see Figure 5c) is lower than \(\theta_{i,j}\); 3. The SST mean value \(\mu_{i,j}\) is lower than the averages of the mean values of the SST in the eastern and western neighbouring squares (the two neighbourhoods are tested separately, each increasing the score if the outcome is positive, and an extra increase is awarded if both are verified). 3. Increase \(e_{i,j}^{3}\) if: 1. The SST trend \(\theta_{i,j}\) inside \(a_{i,j}\) and the \(\theta\)-values of all the full neighbourhood squares of \(a_{i,j}\) (Figure 5a) are negative; 2. The SST in the northwestern neighbourhood (see Figure 5d) of \(a_{i,j}\) decreases before the one in \(a_{i,j}\), and the SST in the southeastern neighbourhood of \(a_{i,j}\) either decreases after the one in \(a_{i,j}\) or increases (this condition is tested for all the relevant squares in the neighbourhoods separately); 3. \(a_{i,j}\) is warmer, on average, than the squares in its northwestern neighbourhood and colder, on average, than the ones in its southeastern neighbourhood (the two conditions are tested separately, each increasing the score if the outcome is positive, and an extra increase is awarded if both are verified). 4.