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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
nof_cylinders
property
find_index_obstacles(coordinates)
Find the indices of the coordinates that are within the radius of the obstacles.
This method uses a KDTree to efficiently find the indices of the points that are within the radius of the cylindrical obstacles. It also checks the height of the points against the height of the obstacles. If the height of the point is greater than the height of the obstacle, it is not considered an obstacle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coordinates
|
ENU
|
The coordinates of the points to check. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Tuple[np.ndarray, np.ndarray]: A tuple containing the indices of the points that are within the obstacles |
ndarray
|
and a boolean array indicating which points are within obstacles. |
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 82 83 84 85 86 | |
set_index_obstacles_grid(grid_coordinates)
Set the indices of the grid points that are within obstacle regions based on the grid coordinates.
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
88 89 90 91 92 93 94 95 | |
check_reference_coordinates(coordinates)
Check if the reference coordinates of the coordinates and cylinder coordinates match.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coordinates
|
ENU
|
The coordinates of the 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
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |