types¶
occulus.types
¶
Core point cloud types for Occulus.
Platform-aware class hierarchy::
PointCloud — base class, platform-agnostic
├── AerialCloud — aerial LiDAR (nadir perspective, large area, moderate density)
├── TerrestrialCloud — TLS (scan positions, high density, occlusion-aware)
└── UAVCloud — UAV/drone (oblique angles, SfM or LiDAR, variable density)
Each subtype carries acquisition metadata and provides platform-appropriate
defaults for processing algorithms. The base PointCloud works for any
data where the acquisition platform is unknown or irrelevant.
All types store points as NumPy arrays internally. Open3D interop is
provided via to_open3d() and from_open3d() class methods.
AcquisitionMetadata
dataclass
¶
Metadata about how the point cloud was acquired.
Populated from LAS header fields where available, or set manually for non-LAS sources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
platform
|
Platform
|
Acquisition platform, by default |
UNKNOWN
|
scanner_model
|
str
|
Scanner model or system identifier, by default "". |
''
|
scan_date
|
str
|
ISO 8601 date string, by default "". |
''
|
coordinate_system
|
str
|
EPSG code or WKT string describing the CRS, by default "". |
''
|
point_density_per_sqm
|
float | None
|
Nominal point density in points per square metre, by default None. |
None
|
scan_positions
|
list[ScanPosition]
|
Scanner setup positions (TLS/mobile), by default empty list. |
list()
|
flight_altitude_m
|
float | None
|
Mean flight altitude above ground in metres (aerial/UAV), by default None. |
None
|
scan_angle_range
|
tuple[float, float] | None
|
Minimum and maximum scan angle (degrees), by default None. |
None
|
Source code in src/occulus/types.py
AerialCloud
¶
Bases: PointCloud
Point cloud from aerial LiDAR acquisition (ALS).
Provides aerial-specific capabilities:
- Ground classification via ASPRS class 2 mask
- First-return filtering (canopy top extraction)
- Assumes nadir perspective with moderate density (10–50 pts/m²)
- Return number / number_of_returns are meaningful attributes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
NDArray[float64]
|
Point coordinates as (N, 3) array. |
required |
**kwargs
|
object
|
Additional keyword arguments passed to :class: |
{}
|
Source code in src/occulus/types.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
first_returns()
¶
Filter to first-return points only.
First returns represent the uppermost surface intercepted by the laser pulse — useful for canopy height models and above-ground features.
Returns:
| Type | Description |
|---|---|
PointCloud
|
New cloud containing only first-return points. |
Raises:
| Type | Description |
|---|---|
OcculusValidationError
|
If no return_number array is present. |
Source code in src/occulus/types.py
ground_points()
¶
Return a boolean mask of ASPRS class 2 (ground) points.
Returns:
| Type | Description |
|---|---|
NDArray[bool_]
|
Boolean mask of length |
Raises:
| Type | Description |
|---|---|
OcculusValidationError
|
If no classification array is present. |
Source code in src/occulus/types.py
Platform
¶
PointCloud
¶
Base point cloud container — platform-agnostic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
NDArray[float64]
|
Point coordinates as (N, 3) array. |
required |
intensity
|
NDArray[float64] | None
|
Intensity values as (N,) array. |
None
|
classification
|
NDArray[uint8] | None
|
Classification codes as (N,) array (ASPRS LAS standard). |
None
|
rgb
|
NDArray[uint8] | None
|
Color values as (N, 3) uint8 array (0–255 per channel). |
None
|
normals
|
NDArray[float64] | None
|
Unit normal vectors as (N, 3) array. |
None
|
return_number
|
NDArray[uint8] | None
|
Return number as (N,) array. |
None
|
number_of_returns
|
NDArray[uint8] | None
|
Total returns per pulse as (N,) array. |
None
|
metadata
|
AcquisitionMetadata | None
|
Acquisition metadata; an empty |
None
|
Raises:
| Type | Description |
|---|---|
OcculusValidationError
|
If |
Source code in src/occulus/types.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
bounds
property
¶
Axis-aligned bounding box as (2, 3) array: [[xmin,ymin,zmin],[xmax,ymax,zmax]].
centroid
property
¶
Centroid of the point cloud as (3,) array.
has_color
property
¶
Whether RGB color is attached to this cloud.
has_normals
property
¶
Whether unit normal vectors are attached to this cloud.
n_points
property
¶
Number of points in the cloud.
platform
property
¶
The acquisition platform for this cloud.
__len__()
¶
__repr__()
¶
Short string representation.
Source code in src/occulus/types.py
from_open3d(pcd, metadata=None)
classmethod
¶
Create a PointCloud from an Open3D PointCloud object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pcd
|
PointCloud
|
Source Open3D point cloud. |
required |
metadata
|
AcquisitionMetadata | None
|
Optional acquisition metadata to attach, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
PointCloud
|
New Occulus PointCloud with xyz, normals, and colors transferred. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If Open3D is not installed. |
OcculusValidationError
|
If the Open3D object has no points. |
Source code in src/occulus/types.py
reproject(target_crs, *, source_crs=None)
¶
Reproject this cloud to a new coordinate reference system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_crs
|
str
|
Target CRS identifier (e.g. |
required |
source_crs
|
str
|
Source CRS. If None, inferred from |
None
|
Returns:
| Type | Description |
|---|---|
PointCloud
|
A new cloud with reprojected coordinates. |
Raises:
| Type | Description |
|---|---|
OcculusCRSError
|
If reprojection fails or source CRS cannot be determined. |
Source code in src/occulus/types.py
to_open3d()
¶
Convert to an Open3D PointCloud object.
Returns:
| Type | Description |
|---|---|
PointCloud
|
The point cloud in Open3D format, with normals and colors transferred if present. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If Open3D is not installed. |
Source code in src/occulus/types.py
ScanPosition
dataclass
¶
Scanner position and orientation for a single scan setup.
Used primarily for terrestrial and mobile scanning where the instrument location is a first-class concern for registration and occlusion analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Easting (or X) of the scanner origin, in the cloud's CRS. |
required |
y
|
float
|
Northing (or Y) of the scanner origin. |
required |
z
|
float
|
Elevation (or Z) of the scanner origin. |
required |
roll
|
float
|
Roll angle in degrees, by default 0.0. |
0.0
|
pitch
|
float
|
Pitch angle in degrees, by default 0.0. |
0.0
|
yaw
|
float
|
Yaw (heading) in degrees, by default 0.0. |
0.0
|
scan_id
|
str
|
Human-readable identifier for this setup, by default "". |
''
|
Source code in src/occulus/types.py
as_array()
¶
Return position as a (3,) numpy array [x, y, z].
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Position vector of shape (3,). |
TerrestrialCloud
¶
Bases: PointCloud
Point cloud from terrestrial laser scanning (TLS).
Provides TLS-specific capabilities:
- Scan positions are first-class (required for registration)
- Occlusion-aware operations account for scan geometry
- Very high point density (1 000–100 000+ pts/m²)
- Ground classification uses different defaults than aerial
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
NDArray[float64]
|
Point coordinates as (N, 3) array. |
required |
scan_positions
|
list[ScanPosition] | None
|
Scanner setup positions for this cloud, by default None. |
None
|
**kwargs
|
object
|
Additional keyword arguments passed to :class: |
{}
|
Source code in src/occulus/types.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
scan_positions
property
¶
List of scanner setup positions for this cloud.
viewpoint_mask(scan_index=0)
¶
Return a mask of points visible from a specific scan position.
Uses Open3D's hidden-point removal algorithm (Katz et al. 2007). Points occluded from the viewpoint are excluded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scan_index
|
int
|
Index into |
0
|
Returns:
| Type | Description |
|---|---|
NDArray[bool_]
|
Boolean mask of length |
Raises:
| Type | Description |
|---|---|
OcculusValidationError
|
If |
ImportError
|
If Open3D is not installed. |
Source code in src/occulus/types.py
UAVCloud
¶
Bases: PointCloud
Point cloud from UAV/drone acquisition (LiDAR or photogrammetric SfM).
Provides UAV-specific capabilities:
- Oblique viewing angles (not purely nadir)
- Variable point density across the scene
- May be photogrammetric (SfM) rather than LiDAR — different noise profile
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
NDArray[float64]
|
Point coordinates as (N, 3) array. |
required |
is_photogrammetric
|
bool
|
|
False
|
**kwargs
|
object
|
Additional keyword arguments passed to :class: |
{}
|