Comments (1)
Late reply, may still be useful.
(Disclaimer: I'm no laspy expert. I started using it few days ago).
If I understood properly, the values stored into EXTRA BYTES are decoded from the VLR and made accessible through their name. For instance, an extra bytes value with name "Amplitude" would be available through inFile.amplitude.
To the extent of my current knowledge, I don't know if there is a easy way print the name of the extra bytes you have. What you can do is to find the VLR containing the extra bytes and look for names in VLR_body. For example, in the output generated by the following code:
>>> for (i, vlr) in enumerate(inFile.header.vlrs):
... print i, vlr.user_id, vlr.record_id
...
0 LASF_Projection 34735
1 LASF_Projection 34736
2 LASF_Projection 34737
3 LASF_Projection 2112
4 LASF_Spec 4
you're looking for the line with LASF_Spec 4, since this is the combination of User Id and Record Id that define the extra bytes VLR. In this example it is located at the VLR with index 4. Then you can do:
>>> extra_bytes_vlr = inFile.header.vlrs[4]
>>> extra_bytes_vlr.VLR_body
to visualize the whole extra bytes VLR body. You may get something like:
"\x00\x00\x03\x0eAmplitude\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x10'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Echo signal amplitude [dB ]\x00\x00\x00\x00\x00\x00\x00\x00\x04\x0eReflectance\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00x\xec\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x98:\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Echo signa l reflectance [dB]\x00\x00\x00\x00\x00\x00\x03\x07Deviation\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x7f\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00Pulse shape deviation\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00"
where you should look for the value names like the ones in bold. The other text is the extra byte value description. Names come before descriptions, and normally it should be clear what which one is what. You can access the extra bytes values using the names, in lower case, without \x00
s and with spaces replaced by _
s (this name transformation is done by laspy.header.VLR.add_extra_dim). In this example, it would be:
>>> inFile.amplitude
array([ 445, 146, 968, ..., 992, 1007, 942], dtype=uint16)
>>> inFile.reflectance
array([-1268, -1567, -856, ..., -593, -578, -642], dtype=int16)
>>> inFile.deviation
array([ 8, 0, 3, ..., 43, 54, 41], dtype=uint16)
Anyway, this depends on the names given for your extra bytes values. If they're not set or properly parsed by laspy then I don't know how to access them. Maybe a developer/maintainer can tell you an easier way to access the values and value names.
I hope this helps!
from laspy.
Related Issues (20)
- Appending points to a LasData object HOT 1
- migrate to urllib3 2.0 HOT 2
- Classification in laspy doesn't match with lasinfo HOT 6
- Reclassification of a COPC file HOT 5
- Allow for writing a custom creation date HOT 1
- append_points() function has size limit at approximately 15.1GB? HOT 3
- Ability to read COPC from fsspec sources HOT 2
- LAS/LAZ Header from Remote Source HOT 2
- laszip installation in ubuntu HOT 2
- Append data points to existing LAS file with header that contains extra dimensions. HOT 5
- List of 0 issue HOT 3
- Tests fail: ModuleNotFoundError: No module named 'laspy.cli.core' HOT 11
- laspy installs the 'tests' module globally that would conflict with other packages that accidentally do the same
- The 'rich' dependency is not listed in setup.py HOT 1
- Header update API? HOT 1
- AttributeError: module 'laspy' has no attribute 'read' HOT 7
- Provide pre-built wheels HOT 4
- Conda Forge test failures with Numpy 1.22 + Python 3.9 HOT 6
- Multiple point clouds structure in one LAS file HOT 2
- LAS / LAZ Shuffle in custom attributes in QGIS HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laspy.