|
Ge 151a - Lab 1Spring 2003Imaging Techniques & AnalysisDuring this lab you will work through:
We're going to start with a pre-selected image to demonstrate some software packages and how they're used. The image which we'll be working with is stored in the /home/ge151/lab1 directory, the filename is m1000782.imq. This is an image taken in the south polar region of Mars in December 1999 by the Mars Observer Camera (MOC), part of the ongoing Mars Global Surveyor (MGS) mission.
Introduction and BackgroundThis image has been prepared for release by the Planetary Data System (PDS). These people are responsible for providing a consistent format for all current and future planetary missions (they're slowly converting the older ones as well) known unsurprisingly as PDS format. PDS images have either an .img or an .imq suffix (.imq is simply a compressed version of .img). They have a text header with information specific to that image followed by the binary image data itself. Log on to the ge151 account with the password given out in class. Move into the lab1 directory and take a look at the image file either in a text editor or by typing 'less m1000782.imq' at the unix prompt. There are other files there but ignore them for now. The information contained in the header usually relates to things which won't change such as the time the image was taken, the gain state of the camera or the number of lines and samples in the image. Other information such as the position of the spacecraft relative to the planet, the longitude and latitude of the image or the size of the pixels in meters is subject to change as better solutions for the orbit of the spacecraft are developed. This other information is not part of the image file as it would be a huge effort to revise the whole dataset each time these new and improved numbers are derived. MOC images are identified by an 8-digit name; the first 3 characters denote the mission phase m10 in this case means the ninth mapping phase. Each mapping phase lasts roughly one calendar month. Other prefixes exist such as ab1, sp2, fha and cal which stand for aerobraking phase 1, science phasing 2, full high gain antenna and calibration phase respectively. These other phases took place early in the mission and were pretty short. The remaining 5 characters represent the orbit number (first 3 characters) and the image number (last 2 characters) within that orbit. So in the case of our image m1000782, it is the 82nd image taken on the 7th orbit in mapping phase 9. MOC is a line scan camera i.e. it has one row of detectors that sweeps across the surface of the planet as the spacecraft moves in its orbit.The resolution along this line (known as crosstrack resolution) is set by the height of the orbit i.e. if the spacecraft is far away from the planet each pixel sees more of the surface. The mapping orbit was planned to be ~400 Km high, however there is 35 Km of relief on the planet (from the summit of Olympus Mons to the bottom of the Hellas impact basin) so the crosstrack resolution can vary from place to place on the planet (by almost 10%). The downtrack resolution is determined by the groundspeed of the spacecraft (~ 3 Km s-1) combined with the length of time the camera exposes each line. Ideally you want the spacecraft to move only a fraction of a pixel (to prevent smearing) in the downtrack direction during an exposure, however the exposure must be long enough to collect sufficient light for a high signal to noise ratio. The camera sensitivity, crosstrack resolution and mapping orbit parameters have been designed so that the pixels have roughly the same resolution in the cross and down track directions. Changes in distance to the surface and surface reflectivity mean that the pixels are not entirely square so all MOC images have some non-unity aspect ratio. Sometimes this can be quite severe and must be removed before the image makes any sense. In general it is always nicer to correct the aspect ratio when looking at images (there is something fundamentally disturbing about elliptical craters). MOC images are always taken at the full resolution of the camera (~1.4 meters/pixel for the narrow angle) but to cope with the voluminous amounts of data the spacecraft computer intentionally degrades the resolution by summing and averaging pixels in both the cross and down track directions. This summing is not necessarily the same in each direction so in addition to the inherent aspect ratio there is sometimes an induced aspect ratio due to this differential summing.
ISIS (Integrated Software for Imagers and Spectrometers)(back to top)ISIS is a software package developed by the United States Geological Survey (USGS) for use with spacecraft data. ISIS is really a collection of stand-alone programs, which perform operations on datasets such as map-projecting an image onto a sphere. In this case we are going to use some of the programs in the ISIS package to calibrate our image. ISIS has its own environment from which you can call these programs known as tae. Its possible to call them as stand alone programs however there is little benefit in that extra complication here. Log on to the ge151 account and make sure you are in the correct directory. Enter the tae environment by typing 'tae' at the unix prompt. Some text blurb should appear along with the cursor at the tae prompt. There are two ways to call ISIS programs from here. Each program needs some set of parameters that you have to feed it e.g. the input file or what format to put the output in etc… If you know all the parameters you want to use in advance you can just type the program name followed by the parameters and their values and that will run the program. If (in our case) you don't know everything in advance then you can use the user-friendlier 'tutor mode'. To enter tutor mode just type t, a space and then the program name e.g. to run the program banana in tutor mode enter 't banana' at the tae prompt and press return.Tutor mode will show you all the parameters for your chosen command and allow you to fill them in individually and get help on each one. ISIS works with its own image format called 'cubes' with a .cub extension. An ISIS cube contains header information like the PDS format does. The first step will be to convert this image into the ISIS format. This is known, as level 0 processing i.e. it isn't really processing at all but just data translation. There is a script called moclev0 that will run all the necessary ISIS programs to do this conversion. Type 't moclev0' at the tae prompt to enter tutor mode for this command.Use the down arrow to cycle through the different parameters, there aren't too many since this is a pretty straightforward procedure. Use the arrow keys to move to the 'FROM' field. Enter the filename, 'm1000782.imq' and press enter. The other fields are fine as they are. Type run and press enter (make sure you are not entering run as a parameter somewhere :) ). The ISIS programs should whirl seamlessly into action. Text messages will scroll past, as these programs run letting you know what's going on. OK, now we can take a look at this image. You should be back at the tae prompt now. ISIS has created a file called m1000782.lev0.cub; this is the raw data in ISIS format. Run the program 'qview' (no need for tutor mode this time, just type the program name at the tae prompt and press enter). Qview is a cube-viewing program, after it loads use it to open the new cube file, which you just made (File -> Open Display), just click the 'ok' button for the load options. Pretty ugly! It's streaky, got some weird garbage lines in the middle, looks like it has an aspect ratio problem and looks pretty uninspiring in general. However you will turn this into a thing of beauty and scientific worth in a few easy steps. You can use the magnifying glass to zoom in (left button), zoom to image resolution (middle button) and zoom out (right button). Take a moment to look over the image zooming up on the interesting stuff. The world button on the upper right will bring you back to the state you started in if you need it. The other buttons do other things not of interest to us at the moment apart from the 'MD' button (5th from the left). This is the 'doctor' button and lets you edit the image. Before that can happen though go to the options menu and select doctor options. On the panel that comes up select the rectangle option on top and the null option on the bottom. Ok those choices and go back to the image display window. Zoom up on the garbage lines one or twice (you should still be able to see the entire line in the window, zoom out if you can't). Select the MD button and drag a rectangle around the bad lines they should disappear. Go to the file menu and exit qview, no need to save the file has been automatically updated. Getting rid of those garbage lines was necessary to make the rest of the processing go smoothly. You should be back at the tae prompt now. We'll run the next program without tutor mode since all we need to provide it with is a filename and we know how to do that. We'll use the program 'moclev1' next. As before this calls several ISIS programs in succession, we need only tell it what the input file is. Type moclev1 from="m1000782.lev0.cub" at the tae prompt.This takes the level zero file we made and converts it to a level one cube file. Level one means that the image has been radiometricaly corrected i.e. the previous DN values have been converted into meaningful I/F values (see tutorial one for the explanation of what I/F means). More text blurb will scroll past; basically listing the parameters used in the DN --> I/F conversion. When the dust has settled and you have the tae prompt back again, startup qview as before. There should be a new cube file there called m1000782.lev1.cub, open it up and take a look. It should be looking a whole lot better now; the streakiness was due to different pixels on the line array having different efficiencies. The bright ones were very efficient at recording light and the darker one were not. The calibration process has taken account of that and 'flattened' all the columns. Press the button on the top right marked with the 'paw' symbol. This turns on the information display at the bottom left, pan the mouse cursor around the image and watch the numbers in the bottom left. This is still not the ideal situation the image is still distorted because of its aspect ratio and we have no idea of what the scale is and which way is north. We'll answer some of those concerns now. What we really need to do to answer all of them is map project the image into some coordinate system. Map projection is something we'll worry about later in the course. For now we'll work around it. You can exit qview from the File menu in the main box. Two useful routines in ISIS that can give you some information are lev1pt and avg_sd. lev1pt must be used with a level one cube. It works for one pixel in the image, which by default is the center pixel. Try running it… Type lev1pt from="m1000782.lev1.cub" at the tae prompt.Lots of information comes up such as the latitude and longitude (of the center pixel) and the pixel size in both the horizontal and vertical (sample and line) directions (in km/pixel) along with the value of the aspect ratio. Take note of the pixel sizes, that information will be useful later. Also displayed is the value of north azimuth, which gives the direction of north in the image. To find north you need to draw an imaginary line from the center to the right edge of the image and then move it clockwise around the center from there by the number of degrees in the north azimuth figure. The line should now point north. Lets get rid of the annoying aspect ratio; the program that will do this for us is called mocaspect. There's a small complication here so lets use the tutor mode for this one. Enter tutor mode in the usual way (type 't mocaspect' ) In the FROM field enter the name of the level one cube file and press enter. Use the down arrow until you get to the IMGINDX field and enter ~/cumindex.tab here and press return. The default index file doesn't cover this image so we'll force it to use this more up to date version instead. Run the program just by giving the run command. This program makes all the pixels square so there are no more aspect ratio problems. The new resolution of the image is the average of the previous two resolutions (which you noted down earlier). A new cube file called m1000782.asp.cub has been produced, take a look at it in qview, the aspect ratio distortion is gone.Now try the other information gathering program 'avg_sd' on this new aspect corrected cube. Type avg_sd from="m1000782.asp.cub" More information will scroll up. This information pertains mostly to the pixel values themselves and shows things like the average value, min and max values and standard deviation etc… Note down the min and max pixel values, we going to use them in another procedure now.To communicate with other image processing programs some other file format other than ISIS cubes must be used. Firstly we'll output the final image we have (m1000782.asp.cub) as simple raw 8-bit data. At the moment the pixel values are the I/F numbers, which are stored as floating point values. We just want the picture for the moment so 8-bit numbers from 0 to 255 will do fine. When converting to 8-bit we must decide what the zero represents in I/F units and what the 255 represents in I/F units. All I/F values will be scaled, any above 255 will be set equal to 255 and any below 0 will be set equal to zero. So we could potentially lose a lot of information here and we certainly don't want to do that after all this effort. So we must choose a low and a high I/F value so that all the other I/F values fall between them. So its lucky indeed that we happen to know what the min and max I/F values are since you just noted them down (you did note them down….didn't you?). We're going to use the program isis2raw to get out of cube format and just get a raw picture. Type 't isis2raw' to go into tutor mode for this command. Set the FROM field to the m1000782.asp.cub file. Set the TO field to m1000782.raw. Set the OTYPE to 1 for 8-bit output. Set the ORANGE 1 & 2 to the min and max values that you got from the avg_sd procedure. Make sure to press return after entering each field so the value sticks, if you use the down arrow without hitting return first then what you entered for that field won't be registered. Run the program and watch the text that scrolls by. At one point the input file characteristics will appear. There you will see how many lines and samples the image has. This is important information so note it down; raw files have no header and no memory of how many lines and samples they have.We're briefly going to startup IDL and convert that raw file to something a little more normal like a tiff file. Quit out of the tae environment by typing exit at the tae prompt. Type IDL at the unix prompt to start that program. You should be in the IDL environment with an IDL prompt. This will only take a few commands, type: openr,1,'m1000782.raw' In place of XXXX type the number of samples and in place of YYYY type the number of lines. After this you can exit IDL just by typing exit at the prompt. You now have a processed image in tiff format. This part of the lab is over, you need to transfer the tiff file to a PC or a MAC that has photoshop running for the next part of the lab. If you need help with the transfer then let me know. Make sure you have the north azimuth and sample and line resolution figures noted for the next section of the lab. To recap the whole process:
Something for you to do yourself now…. In the directory there was a second .imq file m1000783.imq. This is the context image for the narrow angle image we just processed i.e. it's a small low-resolution image taken at the same time to show the regional setting. Using the exact same technique, process this image and create a tiff file. The method will be exactly the same although this time there won't be any garbage lines you need to cut out with the qview doctor. Note down the north azimuth and line and sample resolution number for the next section. Photoshop(back to top)Full on scientific image processing programs usually lack a fast simple interface and performing simple tasks like contrast stretching, zooming and panning often take more effort than is really warranted. Adobe photoshop is a good compromise between convenience and usefulness. We're going to use it to touch up the tiff images you processed in the last section. Firstly load in the two tiff images you've made and take a moment to look them over zoom in and out a few times. In the case of the narrow angle image (m1000782) try and stretch the contrast in the image --> adjust --> levels menu. You'll probably notice that the best stretch is a compromise between the light and dark areas. Here's a trick to try, in the filters -> others menu select the high pass filter and a value of around 100 (play around with this and experiment with very high and very low values). The best value still preserves the image details but the large scale (low frequency) bright/dark variations have been removed, you can contrast stretch the entire image now. The filter also serves to emphasize small-scale detail, which is usually a good thing unless the image is very noisy. Experiment around with other filters and techniques; you can always undo changes from the edit menu. For this exercise you need to produce some products. Narrow angle: Select a subset of the m1000782 image that has some interesting features. Touch it up as best you can with different filters and stretches. Put a scale bar on the image that is some appropriate number of meters long. You have the resolution of the image so you can figure out how many pixels long a 500-meter scale bar should be. Also use the line tool with the arrowhead option to indicate on the image which way is south. Wide Angle: As before touch up the image as best you think and include a scale bar and a south-pointing arrow. Also draw a rough outline where the narrow angle image lies in this scene. I want you to make these as if they were figures in an article you're about to publish, include a caption on why the features you choose are worthy of note and what they mean. Include any information about the image you think is relevant in the caption. Searching for your own images(back to top)Staying with the case of MOC images, several websites are now offering various search mechanisms. Each one has its advantages and disadvantages a quick summary of the main three follow. This site is run by the USGS. Its main benefit is that if you know the image name then you can find and download it very fast as everything is arranged by orbit number. The database runs only up until the end of the mapping mission its not as useful as it could have been. This is the website of the company that actually built the MOC camera. They are also interested in the science it returns and have constructed a graphical database for all the publicly released images. Its difficult to find a specific image in here but this site is great for browsing regions of the planet if you don't know exactly what you're looking for. http://www-pdsimage.jpl.nasa.gov/PDS/public/Atlas/Atlas.html This site has recently been finished and is provided by the PDS. It's an extension of a search engine from the previous major Mars mission (Viking). This allows searching graphically by zooming up on a map of the planet. However, the thing that makes this site so very useful is the ability to search the MOC dataset using forms. You can specify any number of image parameters (including latitude and longitude ranges) and get a list of all the images, which match your search. Preview thumbnails are available and each image can be viewed online and downloaded in any number of formats. Use any one of these sites (I recommend the third) to search in some region you find interesting, such as the Valles Marineris canyon system or the Tharsis volcanoes. Download the PDS version of the image and process it as before. As before make up a respectable figure and caption saying what is of interest in the picture. Include things you deem relevant in the image such as scale bars, north arrows, context views, direction to the sun etc... Advanced techniques: Photoclinometry(back to top)This section is aimed at being an introduction to the concept of photoclinometry (deriving topography from surface shading).If you've read tutorial one by now you should know how local slopes as well as albedo can affect the brightness of a particular patch of ground (if you haven't read it yet now would be a good time). Photoclinometry is difficult to do in any quantitative way but this exercise will illustrate some of the qualitative concepts associated with it. In the lab1 directory start IDL by typing 'idl -32' at the unix prompt. There should also be an IDL program called 'pclin.pro' in the same directory. This is a basic photoclinometry program, which will allow you to vary some input parameters and see their effects.This program uses the I/F values in the image m0201989.asp.cub (also stored in that directory). Some of the program lines are reproduced below.
name = 'm0201989.asp.cub' ;Name of file to read in These lines set up the variables specific to this image. b = b-shadow b is the variable that stores the I/F values alone the sun's line of sight. Here we remove some estimate of the I/F value, which is due solely to the atmosphere (called shadow brightness because this is the only way shadows can be illuminated)
c = acos(b * !PI * cos(inc_ang) / albedo) These 4 lines are the guts of the program. The first calculates the incidence angle for each pixel based on its I/F value. The second then removes the incidence angle that a flat surface would have, leaving just the local slopes for each pixel. The third line converts the slope of each pixel to the change in height of that pixel. The fourth and final line adds up all these height changes to find the actual height of each pixel. This isn't a programming class so you don't need to learn this, only notice what important. Notice for example that we have to assume some value for the albedo and that the atmosphere can have an important role due to its ability to scatter light. You can start the program by typing 'pclin' at the IDL prompt. The standard case will come up i.e. the program selects an interesting part of the image, guesses an albedo and assumes no atmospheric effects. You can force it to use some particular albedo by calling it like 'pclin, albedo=0.25' for an albedo of 25%. You can make some correction for the atmosphere by assuming some amount of I/F is due to scattering e.g. 'pclin, shadow=0.02' will assume that 0.02 needs to be subtracted from each I/F value as a first order atmospheric correction. You can use a third keyword 'pclin, sl=3000' to select the starting line for the section of image you want to look at. You can use all three of these keywords in any combination you like. The solar azimuth means that only tracks that cut across the image at the right angle can be used for photoclinometry so the profiles will be quite short. Experiment with different albedos, letting the program guess first and then trying higher and lower values. Try this for a number of areas and try to figure out what goes wrong when the albedo is far away from the real answer. Explain it as best you can in words. Do the same for the shadow illumination parameter. On the website is a section of image along with the MOLA altimetry track. We'll learn more about MOLA in the next lab. This figure should guide you in what the true topography is (but note that the MOLA track and photoclinometry profiles are not parallel). That's it, good luck. PS. Getting Help(back to top)We will have a lab help session, in addition you can come and see me whenever you like at 156 South Mudd. If you email in advance we can fix a time or you could just try and catch me there. Photoshop has an extensive help section that can be accessed from the program. IDL help manager can be started by typing '?' at the IDL prompt. ISIS can provide help for any routine or any parameter when in tutor mode. In addition the USGS web-site at http://wwwflag.wr.usgs.gov/isis-bin/isis.cgi, documents all ISIS programs very well. GPS homepage - Home - General Info - Schedule - Assignments - Reading - Lectures - Tutorials - Labs - Brainteasers - Projects - References |