plotting LiDAR data in 3D
jschroed
The LiDAR data comes in a matrix - altitude is vertical, time is horizontal, and each point is measured value at that particular time(in this case, some property of aerosols, either backscatter or extinction). I have no problem plotting this in 2D (altitude on y, time on x), but I have no idea how to plot this in 3D. At each point in time, there are associated latitude and longitude coordinates. I was thinking of taking my 2D matrix and converting it to a 3D matrix, where each "layer" would be identical (i.e. have the same data points), but I'm not sure how to copy the rows and columns of one layer into other layers. Furthermore, even if I did that, I'm not sure of the best way to plot this so it would look similar to the attached picture. If anyone has suggestions or has worked with plotting LiDAR data in 3 dimensions, help would greatly be appreciated.
This does not describe how you are connecting between time and geographic position.
If I needed to create a graph similar to the one that you posted I'd probably do it in two steps:
The first step would be to display the background map image. This can be done from geo data that you can display as a surface or an image that you map to the bottom of the Gizmo drawing cube.
The second step is for you to create parametric surface(s) for the various LIDAR segments that you are displaying. The parametric surface(s) define the shape of the "curtains". The actual data is coded into a color wave. You can find a more complicated example of parametric surface (in the shape of a sphere) in the demo under File Menu->Example Experiments->Visualization->GizmoSphere.
To generate the color wave you first select a built-in colortable, e.g., Rainbow. You then execute:
MatrixOP/O gizmoRGBColors=M_colors/65535 // convert to SP and scale
The color wave has to have the same number of rows and columns as your parametric surface and 4 layers for (RGBA). Fill the last layer with 1 for opaque colors. Fill the remaining layers by indexing the scaled LIDAR data into the gizmoRGBColors wave. Specifically, if z0 is a scalar value that you want to draw, you find the min and max to establish the global z range which gives you the following index for the selected RGB:
Variable max=WaveMax(scalarWave)
Variable nor=255/(max-min)
Variable index=nor*(z0-min)
If z0 corresponds to element (i,j) of your parametric wave, you assign the colors using:
paramColorWave[i][j][1]=gizmoRGBColors[index][1]
paramColorWave[i][j][2]=gizmoRGBColors[index][2]
I hope this helps,
A.G.
WaveMetrics, Inc.
January 12, 2015 at 12:29 pm - Permalink
I'll read a bit more about scaling color waves
Just one question: where does the 255 in your line nor=255/(max-min) come from?
January 12, 2015 at 06:01 pm - Permalink
I think this is the number of entries in the color wave.
January 13, 2015 at 05:55 am - Permalink
That is correct. I used 255 for simplicity. In practice, you should use numpnts(M_colors) since some of built-in colortables have less than 255 entries.
AG
January 13, 2015 at 10:10 am - Permalink
January 14, 2015 at 11:06 am - Permalink
If you are using the method I suggested then the color assignments are all in the parametric surface color wave. Therefore, as you fill the color wave you can execute something like:
paramColorWave[i][j][3]=0 // make it transparent
endif
If instead you want to assign some fixed color:
paramColorWave[i][j][0]=0
paramColorWave[i][j][1]=0
paramColorWave[i][j][2]=1 // make it blue, for example.
endif
I hope this helps,
AG
January 14, 2015 at 12:11 pm - Permalink
January 14, 2015 at 03:12 pm - Permalink
Thanks again for the help.
January 14, 2015 at 03:15 pm - Permalink