# School detection while live viewing algorithm

When Automatically detect schools while live viewing is selected (on the Regions page of the Variable Properties dialog box), then schools are detected as follows, whenever new data is received:

1. Denote all regions created by this algorithm as live. Only live regions will be affected by this algorithm, no other regions will be modified or deleted.
2. If new data arrives during live viewing:
1. The basic school detection algorithm is executed on all pings from the most recent ping looking back along the cruise track a distance D determined as follows:
1. Determine the minimum distance (D1) to look back to be confident of detecting the largest possible school. The largest possible school which can be detected is determined as the greater of Minimum total school length and Minimum candidate length + Maximum horizontal linking distance. Look back three times this distance for any school activity. Thus define:

D1 = 3 x maximum(Minimum total school length, Minimum candidate length + Maximum horizontal linking distance)
2. Determine if any schools have been detected in this distance (D1). To do this calculate:

D2a = the distance along the cruise track, from the most recent ping to the most recent ping of the most recent live regions

If D2a is greater than D1 then no schools have been detected in this distance thus far.

If however, D2a is less than D1 then one or more schools has been detected in this distance.
3. If no schools were detected in the distance D1 then choose D1 as the look back distance D.
4. If however, one or more schools were detected in this distance D1, determine the minimum distance to look back for a confident re-detection of all such schools as:

D2 = the distance along the cruise track, from the most recent ping to the least recent ping of the most recent live regions

Then choose the greater of D1 and D2 as the look back distance D.
2. Compare each detected school with all existing live regions:
1. A newly detected school is considered an extension of an existing region if it contains a superset of the samples in the existing region and all the extra samples are on pings later than all pings in the existing region.
2. If a newly detected school is an extension then extend the existing region by adding to it all of the extra samples in the newly detected region (so the original region now contains the same samples as the newly detected region). Then discard the newly detected region.
3. If a newly detected school is not an extension then a new live region is created.

Notes:

• The position variable selected as Position source on the Position page of the Platform Properties dialog box is used for the calculation of distances in this algorithm. Configure the settings on the Data page of the Variable properties dialog box for that position variable before commencing.
• If school detection during live viewing appears to function very slowly, you may consider:
• Reducing the rate at which data arrives (schools are re-detected every time new data arrives). See Using Echolog 500 or Using Echolog 60 for information on how to adjust this rate.
• Setting or raising the Minimum threshold on the Data page of the Variable properties dialog box (to exclude more data from the consideration by the school detection algorithm)
• Using lines and the Exclusion settings on the Analysis page of the Variable properties dialog box (to exclude below bottom or ring down data from consideration by the school detection algorithm)
• Changes in the school detection settings or variable properties affecting school detection will cause the school detection to restart. That is, it will continue operating with no live schools on record - all previously detected schools will no longer be modified.
• When two separate live viewing school regions merge, the extension of detected regions will output one region that continues to extend while the other region remains static.