solarspatialtools.field.remap_positions

solarspatialtools.field.remap_positions(data, remap, columns=None)

Remaps the data based on the remap indices. Each tuple is a pair of entity names (indices), where the first index is the original location, and the second index is the name of the combiner whose location is the true location of the entity identified in the first index.

One common use case might be to operate on plant layout definition, where the index is the name of the entity and the columns are the UTM coordinates of the entity. This function could be used to swap entity positions.

For more info on the remap input, see the assign_positions function.

Parameters

datapd. DataFrame

The original data to be remapped. Its index must be the names of the plant entities, with the columns representing data about them. One common use case might be the UTM coordinates of the entities with columns ‘E’ and ‘N’.

remaplist

The remap indices are a list of tuples, where the first element is the identifier of the entity, and the second element is the entity whose location is the true location of the first element index.

columnslist, optional

Specifies which columns to remap. If None, all columns are remapped.

Returns

data_fixpd.DataFrame

The remapped data frame