Repository navigation
Conversation
read_points returns only xyz, color and intensity, with the pose applied, invalid points dropped and color normalised. There was no way to get row and column indices, return index/count, timestamps, invalid-state flags, extension fields, or the original integer color values. read_scan_raw(filepath, index, *, fields=None) returns a dict of 1-D numpy arrays keyed by E57 field name, with one entry per record and no transformation. Floats keep their stored precision, scaled integers are returned as float64, and integers use the smallest dtype that holds the field's declared range, so 16-bit color comes back as uint16. `fields` limits the result (and memory) to the named fields. Adds a generated grid test file plus two small files from the cry-inc/e57 test data (MIT) covering multiple returns, 16-bit color, an extension field and scaled integers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mohsaad
marked this pull request as ready for review
November 15, 2026 21:06
mohsaad
force-pushed
the
feat/read-scan-raw
branch
from
November 15, 2026 21:08
e4c34dc to
0be7727
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses part of #25 and #19.
Motivation
read_pointsreturns xyz, color and intensity with the pose applied, invalid points dropped and color normalized to 0–1. Several things can't be read at all today:las:pointSourceIdAPI
cartesianX,colorRed,rowIndex,returnIndex,timeStamp, …). Extension fields are keyed asnamespace:name.Single→ float32,Double→ float64,ScaledInteger→ its scaled float64 valueInteger→ the smallest of uint8 / uint16 / int32 / int64 that holds the declared min/max, so 8-bit color isuint8and 16-bit color isuint16fields=returns only the listed fields and skips allocating memory for the others. An unknown field raisesValueErrorand lists the fields that are available.IndexError.The keys and value semantics match pye57's
read_scan_raw, so code can move between the two easily. I checked values against pye57 on every test file it can read, and they matched within float32 rounding. pye57 can't readreturnIndex.e57at all: it forces color to uint8, and the file has 16-bit values (ErrorValueNotRepresentable).Tests
tests/test_read_scan_raw.py:fields=subsets and unknown fieldstestdata/README.md:gridFields.e57: generated with pye57 bytestdata/generate_grid_fields.pyreturnIndex.e57andscaledIntegerIntensity.e57: 9 KB and 2 KB, copied from the cry-inc/e57 test data (MIT, attributed)pytest: 29 passed.cargo fmt --checkandcargo clippy -- -D warningsare clean.Notes
Doublefields.🤖 Generated with Claude Code