energy_methods.pv_site_3d#
Reproducible 2.5D PV scenes from geographic footprints and declared terrain.
XY comes from footprints; Z combines sampled elevation with explicit mounting assumptions. This is not photogrammetry, an as-built survey or a shading model.
- class energy_methods.pv_site_3d.LocalSiteFrame(longitude, latitude, elevation_origin_m=0.0, maximum_radius_m=20000.0)[source]#
Bases:
objectLocal azimuthal-equidistant XY metres, Z relative to a declared height.
X is east and Y north at the origin. Mounting azimuths use these local grid axes. The height offset does not convert the input terrain’s vertical datum. Keep the scene local; the default radius guard is 20 km.
- Parameters:
longitude (float)
latitude (float)
elevation_origin_m (float)
maximum_radius_m (float)
- longitude: float#
- latitude: float#
- elevation_origin_m: float = 0.0#
- maximum_radius_m: float = 20000.0#
- project(longitude_latitude)[source]#
Project longitude/latitude to local XY, enforcing the radius guard.
- Parameters:
longitude_latitude (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
- Return type:
FloatArray
- class energy_methods.pv_site_3d.ElevationGrid(values_m, transform, crs, vertical_datum)[source]#
Bases:
objectNorth-up native metre heights, with CRS and vertical datum kept separately.
transformis (a,b,c,d,e,f): x=a*column+b*row+c, y=d*column+e*row+f at pixel edges. Sampling uses pixel centres. NaN means missing, never zero. The source can be geographic or projected, but must have north-up pixels.- Parameters:
values_m (FloatArray)
transform (tuple[float, float, float, float, float, float])
crs (str)
vertical_datum (str)
- values_m: FloatArray#
- transform: tuple[float, float, float, float, float, float]#
- crs: str#
- vertical_datum: str#
- sample(longitude_latitude)[source]#
Bilinear heights; unsupported/outside samples return NaN without extrapolation.
Every neighbour with nonzero weight must be finite. Exact native centres remain valid even beside nodata. Interpolation adds no source resolution.
- Parameters:
longitude_latitude (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
- Return type:
FloatArray
- class energy_methods.pv_site_3d.ModuleFootprint(id, table_id, vertices_wgs84)[source]#
Bases:
objectOne convex quadrilateral in longitude/latitude, grouped into a mounting table.
- Parameters:
id (str)
table_id (str)
vertices_wgs84 (FloatArray)
- id: str#
- table_id: str#
- vertices_wgs84: FloatArray#
- class energy_methods.pv_site_3d.MountingParameters(tilt_degrees=20.0, azimuth_degrees=0.0, minimum_clearance_m=0.8)[source]#
Bases:
objectAssumed common table plane, preserving the supplied horizontal footprint.
Azimuth is clockwise from local north, towards the module’s facing direction. A table is raised until all corner, edge-midpoint and centre samples clear the terrain by
minimum_clearance_m. This is a sampling rule, not a continuous-clearance guarantee or a structural design. Tilt is absolute to horizontal, not added to the terrain slope. Zero is a flat-plane scenario.- Parameters:
tilt_degrees (float)
azimuth_degrees (float)
minimum_clearance_m (float)
- tilt_degrees: float = 20.0#
- azimuth_degrees: float = 0.0#
- minimum_clearance_m: float = 0.8#
- property gradient: FloatArray#
- class energy_methods.pv_site_3d.TriangleMesh(vertices_m, triangles)[source]#
Bases:
objectIndexed triangles in local east, north, relative-up metres.
- Parameters:
vertices_m (FloatArray)
triangles (IntArray)
- vertices_m: FloatArray#
- triangles: IntArray#
- class energy_methods.pv_site_3d.ModuleSurface(id, table_id, vertices_m, terrain_at_vertices_m)[source]#
Bases:
objectA modelled plane, not an elevation inferred from imagery.
- Parameters:
id (str)
table_id (str)
vertices_m (FloatArray)
terrain_at_vertices_m (FloatArray)
- id: str#
- table_id: str#
- vertices_m: FloatArray#
- terrain_at_vertices_m: FloatArray#
- class energy_methods.pv_site_3d.PVSiteScene(frame, terrain, vertical_datum, modules, table_mounting, rejected_modules, input_module_count, bounds_wgs84, display_grid_shape)[source]#
Bases:
objectTerrain, supported module surfaces and explicit assumptions/rejections.
- Parameters:
frame (LocalSiteFrame)
terrain (TriangleMesh)
vertical_datum (str)
modules (tuple[ModuleSurface, ...])
table_mounting (dict[str, MountingParameters])
rejected_modules (tuple[dict[str, str], ...])
input_module_count (int)
bounds_wgs84 (tuple[float, float, float, float])
display_grid_shape (tuple[int, int])
- frame: LocalSiteFrame#
- terrain: TriangleMesh#
- vertical_datum: str#
- modules: tuple[ModuleSurface, ...]#
- table_mounting: dict[str, MountingParameters]#
- rejected_modules: tuple[dict[str, str], ...]#
- input_module_count: int#
- bounds_wgs84: tuple[float, float, float, float]#
- display_grid_shape: tuple[int, int]#
- property module_mesh: TriangleMesh#
- energy_methods.pv_site_3d.build_pv_site_scene(footprints, terrain, *, frame, bounds_wgs84, mounting=None, table_mounting=None, display_grid_shape=(60, 90), maximum_modules=100000)[source]#
Lift geographic candidates into common table planes above a real elevation grid.
Original XY footprints are preserved. Slant dimensions change with assumed tilt; they are not inferred physical module dimensions. No modules, terrain gaps, structural details or additional site blocks are invented. Different table assumptions can be provided with
table_mounting. Missing terrain rejects individual footprints with reasons. All other invalid input fails.- Parameters:
footprints (Sequence[ModuleFootprint])
terrain (ElevationGrid)
frame (LocalSiteFrame)
bounds_wgs84 (tuple[float, float, float, float])
mounting (MountingParameters | None)
table_mounting (Mapping[str, MountingParameters] | None)
display_grid_shape (tuple[int, int])
maximum_modules (int)
- Return type: