scicom.historicalletters.utils
Utility functions for HistoricalLetters.
Functions
|
Create random coordinates of historically motivated choices. |
|
Get region ID overlaping with input geometry. |
|
Interpolate movement along line between two given points. |
|
Interpolate new topic between two topics. |
Module Contents
- scicom.historicalletters.utils.createData(population, populationDistribution)
Create random coordinates of historically motivated choices.
The routine samples a population sample based on estimated population density of that coordinate.
The original CSV dataset is retrieved from https://doi.org/10.1371/journal.pone.0162678.s003
- Parameters:
population (int)
populationDistribution (str)
- Return type:
geopandas.GeoDataFrame
- scicom.historicalletters.utils.getRegion(geometry, model)
Get region ID overlaping with input geometry.
Might e.g. fail if line of connection crosses international waters, since there is no NUTS region assigned then.
- Parameters:
geometry (shapely.geometry.point.Point)
model (mesa.Model)
- Return type:
str
- scicom.historicalletters.utils.getPositionOnLine(start, target)
Interpolate movement along line between two given points.
The amount of moving from start to target is random.
- Parameters:
start (shapely.Point)
target (shapely.Point)
- Return type:
shapely.Point
- scicom.historicalletters.utils.getNewTopic(start, target)
Interpolate new topic between two topics.
The amount of moving from start to target is random.
- Parameters:
start (tuple)
target (tuple)
- Return type:
tuple