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.
-
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.
-
-
class
pylidar.lidarformats.ascii.ASCIIFileInfo(fname)[source]¶ Class that gets information about a .las file and makes it available as fields.
-
pylidar.lidarformats.ascii.COMPULSARYOPTIONS= ('COL_TYPES',)¶ necessary driver options
-
pylidar.lidarformats.ascii.SUPPORTEDOPTIONS= ('COL_TYPES', 'PULSE_COLS', 'CLASSIFICATION_CODES', 'COMMENT_CHAR')¶ driver options