breaking: Do not project Arome.tryFind

Do that with tryFindWithProj, where you give the projection yourself,
instead.
This commit is contained in:
2025-12-17 17:40:12 +01:00
parent aaa597c52e
commit 18a9d70698

View File

@@ -106,17 +106,16 @@ let tryFindIndex squareSize (wide, tall) (minX, minY) (maxX, maxY) (p0, p1) =
None
/// Tries to get the closest x and y in the arome dataset based on position p
let tryFind (grid: SquareGrid) (p0: float, p1: float) : (int * int) option =
let min = (grid.BBox.minX, grid.BBox.minY)
let max = (grid.BBox.maxX, grid.BBox.maxY)
let p = trans.project ((p0, p1))
let tryFind (grid: SquareGrid) (p: float * float) : (int * int) option =
let min = grid.BBox.minX, grid.BBox.minY
let max = grid.BBox.maxX, grid.BBox.maxY
tryFindIndex grid.squareSize grid.dimensions min max p
let tryFindWithProj (grid: SquareGrid) proj (p0: float, p1: float) : (int * int) option =
let trans = Transform.makeTransform proj grid.projection
let min = (grid.BBox.minX, grid.BBox.minY)
let max = (grid.BBox.maxX, grid.BBox.maxY)
let trans = makeTransform proj grid.projection
let min = grid.BBox.minX, grid.BBox.minY
let max = grid.BBox.maxX, grid.BBox.maxY
let p = trans.project ((p0, p1))
tryFindIndex grid.squareSize grid.dimensions min max p