|
|
UNIX:
Most of the satellite data and image processing will be done on the unix server ocean.stanford.edu.
logging into unix computer from A65 PCs:
To log on the PCs by using your sunet id and password. Select "stanford.edu (Kerberos Realm)" under the "Log on to:" options.
In order to use the satellite image processing software, SeaDAS, on ocean.stanford.edu an X Window system is needed, commonly called X11. This will enable you to open new windows from your Unix-session on the PC.
To log on to ocean securely with X11 enabled do the following:
- Start Xming (the X WIndow server): Start -> All Programs -> Xming -> Xming. You will see an X appear in the toolbar.
- Start SecureCRT (the secure terminal program): Start -> All Programs -> SecureCRT 5.5 -> SecureCRT 5.5.
- The first time you will have to create a New Session. I created a webpage with detailed instructions and screenshots. In short do the following:
Note down:
Username: gp235
Password: (invisible as you type)
Type xterm & to open additional windows.
If SecureCRT doesn't work, you can opt for the simpler SSH-client PuTTY. There are detailed descriptions with screenshots on another webpage.
If you brought you own Windows-laptop or want to work from home you can download Xming. Instruction on how to install can be found on a Penn State webpage. Xming works only for XP and up, for older versions of Windows you can use Cygwin/X. Instructions are on this U. of Delaware webpage. SecureCRT can be downloaded from the Stanford Essential Software website and follow the instructions. Alternatively you can use the free SSH client (with X11) PuTTY. If you have a Mac-laptop running Leopard, then an X11 server is already installed. Just open up a terminal window and log in securely to ocean with X11-forwarding enabled: ssh -X gp235@ocean.stanford.edu. On older versions of OS-X X11 was one of the optional installs. You can find it on the install DVD (click on the Optional Installs icon below 'Install Mac OS X', you might have to scroll down a bit).
moving around:
The filesystem on unix machines is organized in different directories ('folders').
At the start of the directory tree is the root (/) directory, and from there
directories and sub-directories branch out. When you log in to ocean you
will always be in your home directory (/home/gp235). To change directories
you issue the command cd followed by the (sub)directory.
To go to the root directory (/) you have to type: cd /
To go back to your home directory you can type eithercd /home/gp235
or cd /home followed by cd gp235.
Note that sometimes the directory (path) starts with a '/' and other times
it doesn't. The difference is that if the path is preceded by '/' you use
the absolute path (starting from the root directory), otherwise it
is the relative path (starting from the current directory). To
get to your home directory using cd /home/gp235 will work from anywhere,
while cd home/gp235 will only work when you are in the root (/)
directory.
To go up 1 level you type 'cd ..'. So if you were at /home/gp235/seawifs
you end up in /home/gp235. Similarly, if you would have typed cd ../avhrr
you would have ended up in /home/gp235/avhrr (if it exists).
There is a short cut to get to gp235 home directory by typing cd by itself. Note that unix is very sensitive to dots, spaces and any symbols.
basic unix commands:
Some of the commands you will use while managing your satellite data files
on ocean are:
ls, this will give you a listing of all entries in the current directory. If you want more information, like file size, date last modified, check if it is a directory or a file, use ls -al, which is aliased on ocean to ll. When the listing is rolling off your screen you can 'pipe' (|) the list command to more: ls -al | more. Then the listing will pause after each screen. Press the spacebar to see the next page or return for the next line.
mkdir, You can organize your files by putting them in different directories. The command for making a new directory is mkdir followed by the name you want to give it. Example: mkdir avhrr will make a subdirectory avhrr in your current directory. To change to that directory you have to type: cd avhrr.
Since you will be working with large files disk space on ocean is reserved for the class. The name of those disks are '/data7', '/data8' and '/raida'. You can store your files in the subdirectory 'gp235' of one of these. You will get there from the home directory (/home/gp235) by typing eg. cd /data7/gp235. Since you will share this space with other students it is less confusing if you make your own subdirectory.
cp, mv and rm are commands for copying, moving
and deleting (removing) files respectively. The syntax (i.e. format) of cp
if the file to be copied is in the same directory where you are:
cp <filename> <to this directory>
Example: if you are in the in /home/gp235 and you want to copy the file 'seawifs.txt' from this directory to directory 'johnny' on the data disk 5 (i.e. /data5/gp235/johnny/) type:
cp seawifs.txt /data5/gp235/johnny
If the file is located in another directory and you want to copy it to
directory where you currently are:
cp <that directory/><filename> <This directory>
Example: If you were located in the 'johnny' subdirectory you would have
to type and you want to copy th file to/home/gp235:
cp /home/gp235/seawifs.txt /data5/gp235/johnny
-or-
cp /home/gp235/seawifs.txt .
where '.' means the current directory. More info is at hand by looking
at the manual pages. To check out the manual pages of cp, type: man
cp.
mv works similar as cp with the difference that the
original file will be deleted.
rm is easy to use, maybe too easy. Syntax: rm seawifs.txt
to delete the file seawifs.txt. Once the file is removed it is gone
forever. There is no recycle or trash bin as on a PC or Mac! You can also
use wildcards to remove/move or copy more then one file at once. For example
rm s* will remove all files starting with 's'. Or rm *
will remove all files! Directories cannot be removed with the rm
command, use rmdir instead (e.g. rmdir johnny). You can
use wildcards with other commands as well. Example:cp *s /data5/gp235/johnny
will copy all files ending with an 's' to the johnny directory, or ls
*s* will list all files with an 's' in the name.
Some other useful commands:
df will give a list with how much free disk space there is left
on the disks/partitions. When you type df /data7 you will see how
much is used and/or available.
compress: When you finished working with large data files it is
good practise to compress them so they take up less space on the shared disks.
Three programs can be used: compress, gzip or bzip2. If you type
compress seawifs.txt the file seawifs.txt in it's compressed form
will have a '.Z' extension, like seawifs.txt.Z. For gzip the extension added
is '.gz' and bzip2 '.bz2'. Satellite data ordered will normally be in a compressed format.
If it has the .Z extension you can use uncompressto uncompress
it, if it has the .gz extension use gunzip and .bz2 bunzip2.
Renaming files can be done with the mv (move) command, e.g. if
you want to change the filename final_repport into final_report type:
mv final_repport final_report. Note that unix doesn't like spaces or
other weird characters in filenames
Command recall: Use up-arrow or down-arrow to browse to previously issued
command. If you have made a typo in a long command, just use the up-arrow
and then left-arrow to correct the typo.
With the command history you can see a listing of recent commands. Type!23to reissue the 23rd command on that list.
copying & pasting
It is a pain to type long filenames like 'S2000295203345.L2_GAC.Z'. In Unix
it is easy to copy and paste with your mouse buttons. Highlight the filename
with the left mousebutton. Move the cursor to where you want to have the
text. Click with the middle mousebutton to paste it.
want more?
To learn more about Unix, Phill Farrell (Earth Sciences Computer Systems Manager) has compiled some excellent pages on Using Unix. See esp. the sections on Using the Shell and File Manipulation. The pages are mostly referring to Pangea which runs a different flavor of unix so things might be slightly different on ocean.