Differences between revisions 29 and 30
|Deletions are marked like this.||Additions are marked like this.|
|Line 46:||Line 46:|
|MDX is now available to members of WInSAR who have signed the ISCE license http://winsar.unavco.org/ISCE. For hints on installation see InstallingMdx.||MDX is now available to members of WInSAR who have signed the ISCE license [http://winsar.unavco.org/isce.html]. For hints on installation see InstallingMdx.|
There are several ways to display ROI_pac processing results. If you want more information on the file formats used so that you can load the results into your own favorite analysis tool such as Matlab, see the ROI_pac Internals document on the ShortCourse page.
Two programs have been developed by Scott Shaffer at JPL/Caltech for viewing SAR images, interferograms and other imagery on X Window System displays. There are Perl scripts included with ROI_pac (dgx.pl and mdx.pl) that will automatically run DGX and MDX, respectively, with the proper parameters to display the ROI_pac results.
The older program DGX, which only works on certain older computer systems with 8-bit color displays, is available from Open Channel Foundation
The newer program MDX, which works on modern 24-bit displays with the X Window System (a.k.a X11), is available for licensing from JPL.
The present MDX license procedure is to access http://download.jpl.nasa.gov, select "Request Software" and follow the instructions provided. NOTE: You must be a "professor or higher" permanent to complete a successful application -- students or other "individuals" will not be approved for use of this software. The "designated signatory" needs to be either the head of a department or someone from who can legally bind the organization to the terms of the license. It typically takes several weeks to months to receive a response from JPL to your application, especially for institutions outside of the USA. Once the JPL Software Release office has the signed license forms, they can give a user name and password to download MDX. The MDX license, like ROI_pac, is free for non-commercial purposes.
The old procedure was to send an email to firstname.lastname@example.org . You will have to fill out some forms, the license goes through an approval process, and then a license is sent out for signature.
Another option is to convert the ROI_pac files to "flat" binary files and load them into GMT or other visualization software. A rmg2grd.pl script that converts files to GMT is available on the ContribSoftware page.
Some basic mdx commands:
Intro: MDX is ideal for reading the various ROI_pac file formats. ROI_pac includes a Perl script "mdx.pl" that can run MDX to view ROI_pac output files. The "mdx.pl" script automatically reads the extension at the end of the file (*.slc, *.unw, *.dem, *.hgt, *.cor, *.msk, *.int) to figure out the file format, and reads the .rsc file for the information on the number of rows and columns. Remember that many of the files follow the Richard M. Goldstein (RMG) format (-rmg option) (real*4: including .unw, .hgt, .msk and .cor): each line has twice the number of columns specified. For each line, first there is a column width of "amplitude" values, then a column's width of "phase" values. The other common types of file formats are integer*2 (-i2 option) (.dem) and complex*8 (-c8 option) (.slc and .int). The "mdx.pl" script should add the correct option for you. For example:
will read the geo_20100502-20100606_4rlks.unw.rsc file to determine the width and it will determine that the file is an RMG file from the ".unw" suffix (adding the -rmg option). It will display the amplitude and phase with a default color wrap of 6.28.
Basic features: For all files except .dem there should be two buttons in the lower left: an "amplitude" button and a "phase" button. If you left click on one or the other it should show that component of the file you are looking at. If you'd like to see both phase and amplitude simultaneously, left click on one of the buttons then center click on the other.
If you left click on a given pixel, the COL (column) and ROW value of that pixel will appear immediately above the image as well as the amplitude and phase values of that pixel.
If you'd like to change the stretch on the amplitude or the wrap rate on the phase right click on the "amplitude" or "phase" buttons, and then use the scroll down menus and type in the values that you'd like. For example, we often need to change the wrap rate to 6.28 radians. To do this we right click on "phase", find "WRAP" in the scroll menu then type "6.28" next to the word "Wrap:" Sometimes the amplitude image might appear washed out. It sometimes helps to right click on "amplitude" and select SDEV from the pull down menu. You can also use the "right click" menu to change the color table on the last line of the pop-up window. Common choices are cmy and grey.
Most of the pop-up window settings can be specified from the command line when you summon mdx. To get a full list of the options, just type mdx. For example, I often type mdx.pl filename -le (or -be) to view a file that is little endian or big endian.
To create a colorbar, move the mouse over the "Mag" or "Phs" button and press the shift and left mouse button keys simultaneously. You need the xmgrace package for this to work. An easy way to download this package on a Mac is with the MacPorts program.
There are a series of menus across the top of the viewer that will allow you to zoom in and zoom out, print to a file or perform other commands. You can also execute these commands with key strokes as long as you type the key strokes while the cursor is over the active image area.
Known issues: If you want to view a file with more than 30,000 lines you will first have to zoom out and then zoom in to your region of interest.
There is currently no functionality to flip an image left to right like there was in the old DGX. This was useful for descending images which look backwards (if we consider north to be up in the image).
Viewing output with ArcGIS or ArcMap
First step is to use the ROI_pac function “rmg2mag_phs” which separates the bands into two floating point grids (.mag and .phs). Make a copy of these files and rename the grids with the extension .flt. Then you must create a .hdr file from the .unw.rsc (ascii file) that looks like this...
NCOLS 990 NROWS 1110 XLLCORNER -72.9995833333334 YLLCORNER 17.9995833 CELLSIZE 0.00083333333333 BYTEORDER LSBFIRST
Because ArcGIS uses the lower left (LL) corner, use the X_FIRST for the XLLCORNER. For the YLLCORNER you must take the Y_FIRST + (Y_STEP*YMAX).
Finally, perform the "floatgrid" command(ArcINFO)/Tool(Toolbox).
Viewing output in IDL
The IDL procedure read_roipac.pro (available on the ContribSoftware page) reads automatically common ROI_pac data files. The result image is in BIP order (band interleaved by pixel) for easier visualization, e.g. with the procedure mtv.pro. For example, to read and show the interferogram and elevation images one would write:
read_roipac, insar_dir+'930110-950523.int', img mtv, img, /ka, /i ;; show intensity image (/i for intensity, /ka for keep aspect ratio, ;; but reduced window size; or use /orig for original image size) mtv, img, /ka, /p ;; show interferometric phase (/p for phase) read_roipac, insar_dir+'SIM_4rlks.hgt', img mtv, img, ch=0, /o, /m ;; show amplitude (ch: which channel to show, ;; /m for magnitude, /o for original/full image size) mtv, img, ch=1, /o, /cont ;; show elevation (/cont for show contours)
Alternatively, if one only wants to see the result, one can call read_roipac with the /SHOW keyword (needs mtv.pro to be reachable by idl), which will then visualize the data automatically. The "img" parameter for the data is then optional. More mtv keywords can be given, which will be forwarded by read_roipac. For the two examples above the code would be:
read_roipac, insar_dir+'930110-950523.int', /SHOW read_roipac, insar_dir+'SIM_4rlks.hgt', /SHOW, /o
For more information, see the source files.
Another option is the RoiView package from Ran Novitsky Nof. This is built upon Python. See http://rnovitsky.blogspot.com/search/label/roiview for more info and downloading instructions.