h5space

A utilities to extend h5py’s reading and writing of ranges of data, specifically the ability to quickly deal with multiple ranges.

class pylidar.lidarformats.h5space.H5Space(size, boolArray=None, boolStart=None, indices=None)[source]

Object that wraps a h5py.h5s.SpaceID object and allows conversion quickly from boolean arrays used elsewhere. Also contains methods for reading and writing to/from h5py datasets.

getSelectedIndices()[source]

Return the selected indices, mainly for used my advanced spatial indices. Returns self.indices if set, otherwise works it out form boolArray etc.

getSelectionSize()[source]

Return the number of elements that are cuurently selected

read(dataSet)[source]

Given a h5py dataset read the data ranges selected and return a numpy array.

updateBoolArray(mask)[source]

Update the h5py.h5s.SpaceID object (and cached boolArray) with the mask which applies to the current selection.

write(dataSet, data)[source]

Given a h5py dataset and a numpy array write the array into the ranges selected.

pylidar.lidarformats.h5space.createSpaceFromRange(start, end, size)[source]

Creates a H5Space object given the start and end of a range