Data Use Frequently Asked Questions (FAQ)


  1. How do I compile 'lvis_release_reader' for a windows platform?
  2. How can I generate gridded data from the point cloud (Vector) LVIS data using Generic Mapping Tools (GMT)?
  3. How can I generate gridded data from the point cloud (Vector) LVIS data using IDL?
  4. How do I calculate a longitude, latitude and elevation for each sample of the geolocated waveform?
  5. How do I generate ASCII data from the released binaries?
  6. What format are the LVIS release binary data files in?
  7. How do I load a LVIS release binary data file into IDL?
  8. How do I obtain and compile the lvis release reader source code into an executible for my platform?



  1. How do I compile 'lvis_release_reader' for a windows platform?

      The source code for the 'lvis_release_reader' is very basic C code, and should compile on just about any compiler.

      Here are some steps to compile it for a windows platform:

    1. Download / obtain a free compiler (LCC is a great one)
      • Download Here: LCC
        Or direct FTP link here: ftp://ftp.cs.virginia.edu/pub/lcc-win32/lccwin32.exe

    2. Run the lccwin32.exe program and install it on your machine
      • Just accept all the defaults if you're not sure.

    3. Download and uncompress the lvis_release_reader which you can obtain from HERE
      • Put the files in C:\LVIS (or a directory of your choice)

    4. Create a new project in LCC and add the release reader source code
      • Click: Start -> Programs -> lcc-win32 -> lcc-win32
      • In the wedit program (lcc's editor) click: Project -> Create
      • Now, enter a project name and where the home of the project is located.
      • For example, here we use lvisreader as my project name and C:\LVIS for both source and object directories.
      • Make sure Console Application is toggled (should be by default)
      • Click Create
      • Click NO to using the application skeletonl.
      • Add the source code to the project. Just click on the lvis_release_reader.c and OK
      • Click NEXT through all the defaults (or you can change things if you like)

    5. Compile our program:
      • In the wedit program, click: Compiler -> Make (or you can just hit F9)
      • That's it, you should have a lvisreader.exe in C:\LVIS now
      • It may be a good idea to rename the .LGE, .LCE or .LGW file to something easier to type because you have to run this from the console.
      • For example, using Panama data you could rename it to something short:
        • rename LVIS_CR_1998_VECT_20060123_Barro_Colorado_Island.lge to bcdata.lge
      • Load up the console: Start -> Programs -> Accessories -> Command Prompt
      • Then in the console, you can just type:
        • cd c:\lvis
          lvisreader bcdata.lge > bcdata.txt
          which gives you ASCII data from the binary distribution file.

    Return to the top of the page


  2. How can I generate gridded data from the point cloud (Vector) LVIS data using Generic Mapping Tools (GMT)?

      NOTE: Be aware that gridding a data set introduces additional errors into measurements.

      GMT can handle binary or ASCII input data. ASCII is necessary without doing additional work since we mixed float and double binaries in an effort to keep release sizes small.

      Two programs included in the GMT distribution are "minmax" and "nearneighbor" (with full source provided). These will easily grid x,y,z distributions into regular grids.

      • From Unix prompt, export the dataset to ASCII:
        • >> lvis_release_reader LVIS_US_MD_2003_WAVE_20041001_SERC.lge > data.txt

      • From UNIX prompt, find the min/max of the data using GMT:
        • >> minmax data.txt

          Based on the outputs from this command, you can establish the parameters you want to use

          For example, based on this dataset it would be something like this:

          1 second gridding with 5 second search radius (does a distance squared weighted interpolation)

          1 second grid @ this latitude is ~ 30.5m(northing) x 24.4m (easting) grid size

          make non-fitted data == -9999 meters (you can also use NaN here)

      • The final command to grid in GMT is:
        • >> nearneighbor data.txt -Gdata.grd -I1.0c/1.0c -S5c/5c -E-9999 -V -R283.32/283.52/38.87/38.91

  3. Return to the top of the page


  4. How can I generate gridded data from the point cloud (Vector) LVIS data using IDL?

      NOTE: Be aware that gridding a data set introduces additional errors into measurements.

      IDL can also do gridding, and here is a simple example (making a 100x100 grid):

      • Start IDL

      • At the IDL propt, issue the following commands:

          IDL> read_lge_v1,lge,file='LVIS_US_MD_2003_WAVE_20040928_SERC.lge'

          IDL> triangulate, lge.glon, lge.glat, triangles

          IDL> ; 100 x 100 grid (should correct for latitude to be more correct)

          IDL> gs=[(max(lge.glon)-min(lge.glon))/(100), (max(lge.glat)-min(lge.glat))/(100)]

          IDL> griddedData = trigrid(lge.glon,lge.glat,lge.zg ,triangles,gs,XGrid=xvector, YGrid=yvector, MISSING=-9999.0)

          IDL> shade_surf,griddedData,min_val=-1000,ax=90,az=0 ;do a quick plot


      • For a cleaner IDL gridding using a 1000 x 1000 grid, issue the following commands:

          IDL> read_lge_v1,lge,file='LVIS_US_MD_2003_WAVE_20040928_SERC.lge'

          IDL> triangulate, lge.glon, lge.glat, tr

          IDL> dd=trigrid(lge.glon,lge.glat,lge.zg,tr,NX=1000,NY=1000,MISSING=-9999.0)

          IDL> shade_surf,dd,min_val=-1000,ax=90,az=0 ;do a quick plot


  5. Return to the top of the page


  6. How do I calculate a longitude, latitude and elevation for each sample of the geolocated waveform?

      The beam follows a straight line, so a linear interpolation to any sample point is how to obtain location information.

      Here is an IDL session which illustrates how to calculate these positions:

        IDL> x = findgen(432) ; generate a float index from 0.0->431.0

        IDL> m = (lgw(0).z431 - lgw(0).z0)/431.0

        IDL> b = lgw(0).z0

        IDL> plot,x,m*x+b,/ynoz ; elevation for each sample


      These three equations generate locations for any sample location in the waveform:

        IDL> lat(x) = x*((lat431 - lat0) / 431.0) + lat0

        IDL> lon(x) = x*((lon431 - lon0) / 431.0) + lon0

        IDL> z(x) = x*((z431 - z0) / 431.0) + z0


      Where x is the sample number in the waveform (from 0.0 to 431.0) where you would like the location information.

      NOTE: This only applies to the LGW (geolocated waveform) release data.


    Return to the top of the page


  7. How do I generate ASCII data from the released binaries?

      Once you have the file unzipped and the release reader compiled, run the reader on the binary data and it will print the data in ASCII to your screen. To generate an ASCII file, pipe the output of the reader into a file.

      Pipe to "more" for easy reading

        >> ./lvis_release_reader LVIS_US_ME_2003_WAVE_20040831_FT_Main.lce | more


      Or you can pipe the output to a file:

        >> ./lvis_release_reader LVIS_US_ME_2003_WAVE_20040831_FT_Main.lce > output.txt


      Or you can cut by a longitude/latitude box:

        >> ./lvis_release_reader LVIS_HOW_2003_grid_0.lce -lon 290.00-291.40 -lat 44.74-44.76


      Or you can add an index column to the output:

        >> ./lvis_release_reader LVIS_US_ME_2003_WAVE_20040831_FT_Main.lce -i



    Return to the top of the page


  8. What format are the LVIS release binary data files in?

      The LVIS data files are in LCE, LGE and LGW format.

      Descriptions of these formats can be found here.


    Return to the top of the page


  9. How do I load a LVIS release binary data file into IDL?

      You will need to write your own scripts or you can use some simples ones we have available for download here:

      1. LVIS CODE UTILITIES

      Unzip these into your IDL path and run this at the IDL prompt:

        IDL> read_lge_v1,lge,file='LVIS_US_ME_2003_VECT_20040831.lge'

        (NOTE: if you leave off the file argument, you'll get a pickfile selector box)


    Return to the top of the page


  10. How do I obtain and compile the lvis release reader source code into an executible for my platform?

      Download the source code here: (It will compile for Unix/Linux/Mac OS X.):

      1. LVIS CODE UTILITIES

      Copy that file into a directory on your machine and unzip it:

        >> unzip lvis_release_reader_v1.03.zip

      Compile it with gcc:

        >> gcc -Wall lvis_release_reader.c -o lvis_release_reader

      OR

      Compile it with make: (the included Makefile should work for any flavor of Unix/Linux)

        >> make


    Return to the top of the page