1. Start – a bit about Linux
Login to the linux environment – you already have in order to view this webpage
Linux enables both a command line interface (‘CLINT’) and a Graphic User Interface (GUI) … sometimes referred to as Windows Icon Mouse Pointer (WIMP). Usually the command line works faster, but is less familiar to new users.
For this course, you should create a new folder … use the GUI to do this:
Places -> home folder
right-click in the new window, and select new folder
name it geog432
Notes on file and folder names
1. NO spaces EVER in folder (or file) names
2. Keep them concise … GIS software has a letter limit when loading files from folders
3. Generally use only lower case letters – think like a computer !
In general you can likely do all labs using only the GUI (except for starting PCI with … PCI101). However here’s a quick tutorial on a few key commands:
Command line example introduction
applications -> accessories -> terminal (a window appears with prompt at your home folder)
Type these commands:
ls – lists all files and subfolders
cd geog432 – this changes the operating folder to your newly created geog432
ls -l – this lists the details of all files in your folder …. none so far !
du -sh – this totals your disk usage
du -sh * – this details how much disk space you are using in each subfolder
now let’s use the command line to create a new subfolder under geog432 and name it labs
one command you may need is to end a non-responsive task – this is similar to windows task manager:
ps -u username (where username is your login) … note the critical role of spaces in CLINT
this will list all active processes.
Now start GIMP (under graphics) …
repeat the command – you can use your up/down arrow to avoid retyping
ps -u username
Now you will see the GIMP process listed, and its process number
Let’s pretend it has frozen (this may happen if you try to open a large orthophoto)
end the process by typing
kill xxxx (where xxxx is the process number)
if this fails to work, try
kill -9 xxxx (the -9 option = ‘yes I really mean kill !)
this is a harsh way to end a process unless required – like stopping your car by turning off the ignition
Two more variations on cd command (change directory)
cd .. takes you back to the previous folder
cd takes you back to your home folder
OK – minimise the terminal and home folder shells for future use
2. Satellite image data download
in a firefox or seamonkey browser, Open the USGS data archive portal to view Landsat scenes (and others):
In that window, select collections -> Landsat archive -> Landsat 4-5 TM
Note also the EO-1 option for ALI (Advanced Land Imager)
search for recent scenes around PG – lat/long .. enter 54 (lat) and -122 (long)
… what happens if we omit the negative before 122 ?
Track 48 Row 22 shows a scene from 14 Sept 2011 (last wednesday!), with some high cloud in the west
Note that is already ‘downloadable’
display in more detail by selecting resolution -> 240m (the data are actually 30m)
We’ll pretend to download it, but I’ve already done it to save having 8 copies
Note that you will be prompted to create an account with USGS when you download later in the course
The result is a filename that includes track/row and date and has .tar.gz format (gzipped and ‘tarred’)
This unzips to 7 .TIF files – one for each band
I have ‘clipped’ these to a smaller area surrounding PG, that we will later compare to an earlier date
3. PCI – data import
START PCI (Focus) same as last week:
On the Linux screen, click the PCI server icon and enter password
To start the geomatica software, type pci101
The files we will use are in /home/labs/geog432/lab2data
Demo: Here is how I clipped:
- display full scene
- zoom in to desired area
- tools -> clipping/subsetting
- use ‘current display’ to clip (or similar coordinates)
TASK: create a 7 band pix file (similar to the files we used in lab 1) .. we do this by translating (converting) the TIF for band 1 to a PIX, and then transferring the remaining 6 TIF files, one at a time into the newly created PIX file
Note: we do NOT want 7 different PIX files !
open the first tif (band 1) in Focus
File-> Utility -> Translate
Options: the output file MUST be in your folder – place it in your geog432/labs folder
name it something like pg14sept2011.pix
select all files and translate .. it should work quickly
Now select file-> utilities-> Transfer
the input file is the next band (2) TIF (in home/labs/geog432/lab2data)
the output file is your new PIX file – just created
select and TRANSFER
Repeat this process for bands 3-7 … you only need to change the INPUT file
Take care to select and transfer each band in the correct order — it takes longer to correct a mistake
Bands, channels, Image planes and guns
Bands: the data layers captured by the satellite sensor
Channels: the layers in the image database (logically in the same order as the bands: Band 1 = channel 1 etc..)
Guns: the three colour guns available for display – R G B
4. Display in Geomatica – Focus
Now you can open the new PIX file
The default display will be 123 in RGB Switch 1 and 3 so it is 321 and always stretch
Switch to 543 in RGB and stretch; also try 742 for comparison
Note: another way to do this is to expand the pix file (+) .. and right click on each gun to make the switch
Enhance to linear then root stretch – usually but not always the best
Display DNs: at bottom, value at cursor for each channel displayed (5,4,3)
Check these by clicking in these land cover types:
Black = low DN in each channel in RGB (e.g. water)
Bright = high in each channel e.g. cloud or chip pile
Red = high in Mid IR e.g. fields
Green = high in near-IR (e.g. deciduous)
Blue = high in visible band
To see the surrounding pixel values, Select View-> Numeric Values … and click on pixels in each region.
View the general range of DNs for water in Band 4 (near-IR)
Now view values for the whole area: Select View-> Histograms
It displays the 3 histograms for the bands displayed plotting frequency against Digital Number (DN)
click on each histogram to get more info – wider spread = more detail.
Note that the histogram displays the orginal DNs, not the result of a stretch.
Add the other bands to see their histograms – you must always highlight the new selection in the contents to query it.
… either individually or as a new RGB to get more info e.g. 1-2-7 RGB and 6 grayscale
Note that the bands have no values on the extreme left, but this gap decreases as wavelength increases – it is due to haze.
Which band has the greatest amount of haze ?
Now zoom right in on a fairly homogenous area such as industrial areas or UNBC, and click to no enhancement, and then root – it should look quite different to the previous stretch as it is working on a different data sample. This may be useful later if you are focussing on a particular surface such as forests, urban or ice.
Look at the projection for the file:
Select Files Tab on the left (instead of maps), and right-click on the filename, properties, look for projection
The projection should be familiar – All downloaded files from USGS are in this for your local zone
Now open the file we used last week: /home/labs/geog432/pg2005.pix
it may protest at first, but should overlay the two files
Review its projection – most BC data are in this projection. PCI does not “reproject on the fly” as neatly as ArcMap. In another lab we’ll see how to reproject images from one projection to the other
5. Display in ArcMap
ArcMap 9.3 and 10.x (but not earlier versions) can display (open) a .pix file. Start arcmap and add data – the pixfile (remember you will need to link to the folder).
Like PCI, the 1-2-3 combo will appear. Change to 5-4-3 … right-click-> properties -> display
Also like PCI, you will need to stretch it (for the same reasons) … do this by right-click on the filename -> properties -> symbology …. pick standard deviations (2).
Note that stretch options are ‘from this raster set’ and from current display – as in PCI – you get a different stretch if you zoom in. Try this – zoom in on a downtown section and select ‘from current display’ to view the difference.
Add the rivers vector shapefiles (in the geog432 folder). You may notice that arcmap loads layers with different projections without complaining (unlike PCI).
While arcmap can display a .pix file, operations are not super-stable, so if you plan to do much, save (export) it either as TIF or IMG – the latter is best if you have > 3 bands. You may find this useful if you plan many vector operations such as digitising or adding vector layers.
6. Data search
What is Lansdat up to today: http://earthnow.usgs.gov
You can access and download Landsat 5 and 7 data for anywhere … there is not much data above 80N
http://glovis.usgs.gov/ .. select Landsat 4-7 combined, zoom in to your area
For the EO-1 ALI exercise (details coming), data are less common … try a search for an area of interest. use the resolution option to get highest display detail on a dataset in an area of interest – not only BC … could be anywhere.
Images should be no more than 10% cloud cover