solarspatialtools.field.assign_positions

solarspatialtools.field.assign_positions(original_pos, predicted_pos)

Compute the assignment solution to determine which predicted combiner position corresponds to which original expected combiner position. The assignment is done by minimizing the distance between the predicted and expected combiner positions.

Understanding the outputs is a bit confusing, because we are mapping the expected combiner positions to the predicted combiner positions and each name therefore occurs twice, once in each column. So this will explain in excruciating detail to make sure that it’s totally clear.

The format of the the outputs is a list of tuples, where the first element is the name of the name of the column in the original data. The second element is the name of the element from the original data whose position in the site plan corresponds to the first element.

For example:

[(‘A’, ‘B’), (‘B’, ‘C’), (‘C’, ‘A’)]

means that the position for combiner ‘B’ in the original data should used as the true position for combiner ‘A’. The position for combiner ‘C’ in the original data should be used as the true position for combiner ‘B’. The position for combiner ‘A’ in the original data should be used as the true position for combiner ‘C’.

Stated another way, the data for ‘A’ indicates that those time series are really positioned at the ground position that was originally thought to be ‘B’.

Parameters

original_pospd.DataFrame

A dataframe containing the expected combiner positions. The dataframe should have at least two columns, the first two columns are assumed to be the easting and northing positions of the combiners in the site plan. Additional columns are ignored.

predicted_pospd.DataFrame

A dataframe containing the predicted combiner positions. The dataframe should have at least two columns, the first two columns are assumed to be the easting and northing positions of the combiners in the predicted site plan. Additional columns are ignored.

Returns

remap_indiceslist of tuples

A list of tuples, where the first element is the name of the column in the original data. The second element is the name of the element from the original data whose original position corresponds to the first element.

data_outpd.DataFrame

A copy of the original data, but with the rows remapped to the optimal solution.