emod_api.demographics.Node module#
- class emod_api.demographics.Node.Node(lat, lon, pop, name: str | None = None, area: float | None = None, forced_id: int | None = None, individual_attributes: IndividualAttributes | None = None, individual_properties: IndividualProperties | None = None, node_attributes: NodeAttributes | None = None, meta: dict | None = None)[source]#
Bases:
Updateable
- default_population = 1000#
- res_in_degrees = 0.041666666666666664#
- property name#
- get_individual_property(property_key: str) IndividualProperty [source]#
- property id#
Returns the node ID
- classmethod from_data(data: dict)[source]#
Function used to create the node object from data (most likely coming from a demographics file)
- Parameters:
data (dict) – Contains the node definitions
- Returns:
A
emod_api.Demographics.Node.Node
- property pop#
initial population
- property lon#
longitude
- property lat#
latitude
- property birth_rate#
birth rate in births per person per day
- class emod_api.demographics.Node.OverlayNode(node_id, latitude=None, longitude=None, initial_population=None, **kwargs)[source]#
Bases:
Node
Node that only requires an ID. Use to overlay a Node.
- emod_api.demographics.Node.get_xpix_ypix(nodeid)[source]#
Get pixel position from nodid. Inverse of
nodeid_from_lat_lon()
- emod_api.demographics.Node.lat_lon_from_nodeid(nodeid, res_in_deg=0.041666666666666664)[source]#
Inverse of
nodeid_from_lat_lon()
- emod_api.demographics.Node.xpix_ypix_from_lat_lon(lat, lon, res_in_deg=0.041666666666666664)[source]#
Pixel position (origin is -90°N and -180°E). No modular arithmentic is done.
- emod_api.demographics.Node.nodeid_from_lat_lon(lat, lon, res_in_deg=0.041666666666666664)[source]#
Generate unique identifier from lat, lon. Inverse of
lat_lon_from_nodeid()