OpenSenseAction / mergeplg

Merging methods for rainfall sensor data provided as point, line and grid
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Use GridAtLines and GridAtPoints from poligrain instead of lower-level code #14

Open cchwala opened 1 month ago

cchwala commented 1 month ago

We introduced GridAtLines and GridAtPoints in poligrain to have one common interface for merging CMLs and gauges. We should use this in mergeplg.

Since the contribution of @eoydvin in #3 only uses CMLs for merging, this topic might just not have come up yet, but we should keep that in mind. This also applies to my implementation in #6, but since I still used DataFrames for representing sensor (gauge and CML) data there, that would require a lot of rewritting...

The general idea is to have the calculation of the differences between radar and the "adjustment sensors" (gauge and CML) interchangeably so that the other adjustment code that follows these initial calculations does not have to be written separately for each sensor.

cchwala commented 1 month ago

But... maybe the lower-level code, e.g. using calc_sparse_intersect_weights_for_several_cmls, is short enough so that we do not save much. We could have the basic merging class allow to have point and line data as input and then calculate according to what was passed in during init.

eoydvin commented 1 month ago

The current calc_sparse_intersect_weights_for_several_cmls requires line data, but one workaround is to represent points using lines shorter than the grid size. This only works reliable when point_a is at the midpoint of the grid, and not at the edges, as then direction could play a role.