ASCII

Driver for ASCII files. Currently uncompressed files with a .dat or .csv extension are supported. If the ZLIB_ROOT environment variable was set at build time, then gzip compressed files with a .gz extension are also supported.

The user must specify the column names and types via the COL_TYPES driver option. For time-sequential files, the PULSE_COLS driver option needs to be provided so the points can be grouped into pulses. When PULSE_COLS isn’t provided then the file is assumed to be non-time-sequential and a pulse is created for each point.

Driver Options

These are contained in the SUPPORTEDOPTIONS module level variable.

Name Use
COL_TYPES A numpy style list of tuples defining the data types of each column. Each tuple should have a name and a numpy dtype.
PULSE_COLS A list of fields which define the pulses. The values in the these columns will be matched and where equal will be put into one pulse and the other values into the points for that pulse.
CLASSIFICATION_CODES A list of tuples to translate the codes used within the file to the lidarprocessor.CLASSIFICATION_* ones. Each tuple should have the internalCode first, then the lidarprocessor code Codes without a translation will be copied through without change.
COMMENT_CHAR A single character that defines what is used in the file to denote comments. Lines that start with this character are ignored. Defaults to ‘#’
class pylidar.lidarformats.ascii.ASCIIFile(fname, mode, controls, userClass)[source]

Driver for reading ASCII files. Uses the underlying _ascii C++ module.

close()[source]
static getDriverName()[source]
getHeader()[source]

ASCII files have no header

static getHeaderTranslationDict()[source]

No header so not really supported. Return empty dict.

getHeaderValue(name)[source]

Just extract the one value and return it

getTotalNumberPulses()[source]

No idea how to find this out...

hasSpatialIndex()[source]

ASCII files aren’t spatially indexed

readData()[source]

Internal method. Reads all the points and pulses for the current pulse range.

readPointsByPulse(colNames=None)[source]

Read a 3d structured masked array containing the points for each pulse.

readPointsForRange(colNames=None)[source]

Reads the points for the current range. Returns a 1d array.

Returns an empty array if range is outside of the current file.

colNames can be a list of column names to return. By default all columns are returned.

readPulsesForRange(colNames=None)[source]

Reads the pulses for the current range. Returns a 1d array.

Returns an empty array if range is outside of the current file.

colNames can be a list of column names to return. By default all columns are returned.

readReceived()[source]

ASCII (AFAIK) doesn’t support received

readTransmitted()[source]

ASCII (AFAIK) doesn’t support transmitted

readWaveformInfo()[source]

ASCII (AFAIK) doesn’t support waveforms

setPulseRange(pulseRange)[source]

Sets the PulseRange object to use for non spatial reads/writes.

writeData(pulses=None, points=None, transmitted=None, received=None, waveformInfo=None)[source]

This driver does not support writing so ignore if reading, throw and error otherwise.

class pylidar.lidarformats.ascii.ASCIIFileInfo(fname)[source]

Class that gets information about a .las file and makes it available as fields.

static getDriverName()[source]
static getHeaderTranslationDict()[source]

No header so not really supported. Return empty dict.

pylidar.lidarformats.ascii.COMPULSARYOPTIONS = ('COL_TYPES',)

necessary driver options

pylidar.lidarformats.ascii.SUPPORTEDOPTIONS = ('COL_TYPES', 'PULSE_COLS', 'CLASSIFICATION_CODES', 'COMMENT_CHAR')

driver options