itacart.boundary.last_lattice_column

itacart.boundary.last_lattice_column(quadrant, row, side)[source]

Greatest column of a square lattice row that exists inside the border.

The lattice of side side is the one every resolution shares: cells are nested, so the same two base tests decide existence at any depth. A column exists when its equator-side base is not negative and its polar-side base is positive, which bounds it by the border at the lower ordinate and by the border one side up, plus one for the lean. The tighter of the two wins.

Above roughly 18.5 degrees of latitude the border retreats faster than one side per side, so the upper bound is the binding one and the last column stands short of where the lower ordinate alone would put it. The cell that does survive absorbs everything out to the border, so the row is still covered.

Parameters:
  • quadrant (str) – Quadrant code.

  • row (int) – Lattice row index, counted from the equator.

  • side (float) – Lattice cell side in metres.

Return type:

int

Returns:

The greatest existing column index, which is -1 when the row holds no cell at all.

Raises:

ValueError – If the quadrant is not one of the four. A quadrant is an enumerated adjustment parameter and not an index, so the refusal is the built-in rather than this package’s hierarchy, which answers for what is wrong with an index or a domain.