Site Layout
Site layout module.
This module defines the SiteLayout class, which represents the layout of a site, giving the option to include obstacles (e.g. buildings, tanks, equipment) as cylinders obstructing the flow field.
SiteLayout
dataclass
Class for site layout defining cylindrical obstacles in the environment.
These are used with MeteorologyWindfield to calculate the wind field at each grid point with a potential flow around the cylindrical obstacles.
Attributes:
| Name | Type | Description |
|---|---|---|
cylinder_coordinates |
Union[ENU, None]
|
The coordinates of the cylindrical obstacles in the site layout. The east, north represent the the center of the cylinder and the up coordinate represents the cylinder height. |
cylinder_radius |
ndarray
|
The radius of the cylindrical obstacles in the site layout. |
id_obstacles |
ndarray
|
Boolean array indicating which grid points are within obstacle regions. |
id_obstacles_index |
ndarray
|
The indices of the grid points that are within obstacle regions. |
Source code in src/pyelq/dispersion_model/site_layout.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
nof_cylinders
property
find_index_obstacles(grid_coordinates)
Find the indices of the grid_coordinates that are within the radius of the obstacles.
This method uses a KDTree to efficiently find the indices of the grid points that are within the radius of the cylindrical obstacles. It also checks the height of the grid points against the height of the obstacles. If the height of the grid point is greater than the height of the obstacle, it is not considered an obstacle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grid_coordinates
|
ENU
|
The coordinates of the grid points to check. |
required |
Source code in src/pyelq/dispersion_model/site_layout.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
check_reference_coordinates(grid_coordinates)
Check if the reference coordinates of the grid and cylinder coordinates match.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grid_coordinates
|
ENU
|
The coordinates of the grid points to check. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the reference coordinates do not match. |
Source code in src/pyelq/dispersion_model/site_layout.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |