Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Commit

Permalink
Add properties to get/set mins and maxs as numpy arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Jul 31, 2018
1 parent 410a5b1 commit 5f4d0fc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pylas/headers/rawheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import enum
import logging
import numpy as np
import uuid

from .. import compression
Expand Down Expand Up @@ -194,6 +195,29 @@ def are_points_compressed(self):
"""
return compression.is_point_format_compressed(self._point_data_format_id)

@property
def mins(self):
""" Returns de minimum values of x, y, z as a numpy array
"""
return np.array([self.x_min, self.y_min, self.z_min])

@mins.setter
def mins(self, value):
""" Sets de minimum values of x, y, z as a numpy array
"""
self.x_min, self.y_min, self._z_min = value

@property
def maxs(self):
""" Returns de maximum values of x, y, z as a numpy array
"""
return np.array([self.x_max, self.y_max, self.z_max])

@maxs.setter
def maxs(self, value):
""" Sets de maximum values of x, y, z as a numpy array
"""
self.x_max, self.y_max, self._z_max = value

def __repr__(self):
return "<LasHeader({})>".format(self.version)
Expand Down

0 comments on commit 5f4d0fc

Please sign in to comment.