Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Winter Quarter 2004Rolando V. Raqueño Getting Started SIMG 726.

Similar presentations


Presentation on theme: "1 Winter Quarter 2004Rolando V. Raqueño Getting Started SIMG 726."— Presentation transcript:

1 1 Winter Quarter 2004Rolando V. Raqueño Getting Started SIMG 726

2 2 Winter Quarter 2004Rolando V. Raqueño Location of Class Notes http://wiki.cis.rit.edu Search for SyllabusSimg7262004 –Arranged by Class Date –Watch out for Posted Messages, particularly the link to QuestionsSimg7262004 Previous year’s notes –SyllabusSimg7262003

3 3 Winter Quarter 2004Rolando V. Raqueño Readings detailed at SyllabusSimg7262004 –On-Line Tour of IDL –UNIX Reading Assignment Guide –IDL Reading Assignment Guide

4 4 Winter Quarter 2004Rolando V. Raqueño Objective VNC Demo Requested How do you search in wiki.cis.rit.edu? Quiz #1 Topics Define Homework/Project #1 Brief Introduction to UNIX IDL demo More Final Project Details

5 5 Winter Quarter 2004Rolando V. Raqueño How Do Search on Wiki?

6 6 Winter Quarter 2004Rolando V. Raqueño Wiki Search Page

7 7 Winter Quarter 2004Rolando V. Raqueño Entries/Selection for Search

8 8 Winter Quarter 2004Rolando V. Raqueño Sample Search Results

9 9 Winter Quarter 2004Rolando V. Raqueño Quiz #1 Topics for December 9 man ls cp mv pwd Make a weekly post to CIS wiki for practice –May be class related or research related –QuestionsSimg7262004 –http://wiki.cis.rit.edu/bin/view/Help/NewQuestions

10 10 Winter Quarter 2004Rolando V. Raqueño Homework/Project #1 - Part 1 Part 1 –Copy the file.plan.blank from ~rvrpci to your home directory –Modify it to reflect your schedule –Rename the file to.plan –Change the permissions of the file to have it accessible by others (test-ask your neighbor to check to see if they can access the file through the finger command) –Upload your.plan to your wiki home page (put a file comment stating that this is for winter quarter of 2004)

11 11 Winter Quarter 2004Rolando V. Raqueño Purpose of Part 1 Exercises UNIX file navigation skills –copying, renaming, changing directories –handling being aware of hidden files Exercising vi skills Working with concept of file permissions and protections Uploading files to the wiki system

12 12 Winter Quarter 2004Rolando V. Raqueño Homework/Project #1 - Part 2 Part 2 –Write the following IDL functions that will compute the following statistics for any dimension array(s) Minimum Maximum Sum Mean Sum_Squares Variance Standard_Deviation

13 13 Winter Quarter 2004Rolando V. Raqueño Purpose of Part 2 Getting acquainted with the IDL array characteristics. –Function utilities to extract array properties Mechanics of IDL “compilation” Opportunity for Modular design of routines –Reduce, Reuse, Recycle –Debugging LaTeX documentation exercise

14 14 Winter Quarter 2004Rolando V. Raqueño Homework/Project #1 - Part 2 Test for the ambitious –Read in a PBMPLUS formatted image to test your statistics routine

15 15 Winter Quarter 2004Rolando V. Raqueño Homework/Project #1 Guidelines Due After Break Follow program submission guidelines –should be in LaTeX Hardcopy submission –for marking up Minimal volume of text –save text volume for final project –focus on LaTeX mechanics

16 16 Winter Quarter 2004Rolando V. Raqueño Brief Introduction to UNIX

17 17 Winter Quarter 2004Rolando V. Raqueño UNIX History Approaching 30 years of development and user use/abuse –BSD Flavor –System V Flavor –Other Flavors - LINUX Originally developed by programmers for programmers Way too many commands to cover

18 18 Winter Quarter 2004Rolando V. Raqueño Before we start % source ~rvrpci/.simg726.rc WHY? –Uniform UNIX environment

19 19 Winter Quarter 2004Rolando V. Raqueño The “Original” UNIX Desktop $

20 20 Winter Quarter 2004Rolando V. Raqueño The “New and Improved” UNIX Desktop %

21 21 Winter Quarter 2004Rolando V. Raqueño These represent UNIX Shells % prompt indicates The C-shell (csh) $ prompt indicates The Bourne-shell (sh)

22 22 Winter Quarter 2004Rolando V. Raqueño Other UNIX Shells tcsh - C-shell variant –Allows the use of up-arrow keys bash -“Bourne again” shell –Distributed with LINUX ksh - Korn shell

23 23 Winter Quarter 2004Rolando V. Raqueño UNIX Shell Prompt % prompt indicates C-shell or tcsh $ prompt indicates Bourne-shell

24 24 Winter Quarter 2004Rolando V. Raqueño What is a shell? Captures commands and schedules it for execution. Several shells running at a time –each shell is its own environment –each window is its own shell Shells in UNIX are created through a process called “spawning”

25 25 Winter Quarter 2004Rolando V. Raqueño Make individual directories for each class session For example % mkdir 20031204 % cd 20031204 …

26 26 Winter Quarter 2004Rolando V. Raqueño In order to log your session Use the script command % script Script started, file is typescript To stop the command ^D

27 27 Winter Quarter 2004Rolando V. Raqueño % xterm example % Under the X windowing environment –Repeatedly start several windows by giving the xterm command. % xterm &

28 28 Winter Quarter 2004Rolando V. Raqueño UNIX Command Form % command [options] arg2 arg3... argn Very Important Concept –The command can be a compiled program (FORTRAN, C/C++) a file containing other UNIX commands (also called a shell script) –e.g. commands to run IDL UNIX makes no distinction between the two

29 29 Winter Quarter 2004Rolando V. Raqueño % Most Important UNIX Command % % man Usage: man [-] [-M | -P pathname] [-t] [section] title... man [-] [-M | -P pathname] [-t] [section title...]... man [-M | -P pathname] -f title... man [-M | -P pathname] -k keyword... A Usage: message typically indicates that not enough arguments were given to a command or incorrect options

30 30 Winter Quarter 2004Rolando V. Raqueño % Most Important UNIX Command % To correct the command we can type % man manman(1) NAME man - Displays reference pages SYNOPSIS man [-] [-M | -P pathname] [-t] [ section[suffix] ] title... man [-] [-M | -P pathname] [-t] [ section[suffix] title...]... man [-M | -P pathname] pathname] -f title... man [-M | -P pathname] -k keyword....

31 31 Winter Quarter 2004Rolando V. Raqueño % Other UNIX Commands % You know the name of the command, but you need a reminder of what it does. % whatis man man (1) - Displays reference pages man, man.page (5) - The man macro packages for reference pages

32 32 Winter Quarter 2004Rolando V. Raqueño % Other UNIX Commands % You know a keyword about a command, but don’t remember the command itself % apropos printer

33 33 Winter Quarter 2004Rolando V. Raqueño Keyboard Control Characters ^[ - ESC key equivalent ^C - stops a currently running process (totally abort) ^Z - suspends a running process (can be restarted) ^U - erases a complete line being typed ^S - stops output to the screen ^Q - resumes output to the screen ^D - signals an interactive end-of-file condition(EOF)

34 34 Winter Quarter 2004Rolando V. Raqueño Most Common Keyboard Problem Problem: –You press the “backspace key” to erase a character – instead you get ^H whenever you press it. Solution: % stty erase ^H

35 35 Winter Quarter 2004Rolando V. Raqueño Most Common Keyboard Problem Problem: –Press the “delete key” to erase a character –instead you get ^? whenever you press it. Solution: % stty erase ^?

36 36 Winter Quarter 2004Rolando V. Raqueño % UNIX Commands To Try % % whoami #This will print out your username. % hostname #This will print out computer name. % finger #This will print out current users % date #Gives current system time and date

37 37 Winter Quarter 2004Rolando V. Raqueño Sample UNIX Directory Tree Structure

38 38 Winter Quarter 2004Rolando V. Raqueño Where am I? (Two Types of Pathnames) Absolute Path (always starts with a / ) /usr/local/bin/ls /cis/students/neg3153/.login Relative Path (does not start with a / ) pub./pub../testing ~neg3153/.login

39 39 Winter Quarter 2004Rolando V. Raqueño % Fundamental UNIX Commands % List files in the current directory. % ls List files in the rvrpci’s home directory. % ls /cis/staff/rvrpci % ls ~rvrpci List files in the YOUR home directory. % ls ~ Lists all files including hidden files in current directory % ls -a

40 40 Winter Quarter 2004Rolando V. Raqueño % What “Else” UNIX Can Do (How do you spell releif?) % % look rel % look re % look re | more % look re | wc

41 41 Winter Quarter 2004Rolando V. Raqueño % “Excuse me, Do you sell beer in the special hogshead size” % % units #Unit Conversion Program #Try miles to feet #Try furlong to yards #Try barrel to hogshead #Try dollar to yen (unreliable) # hectopascals vs. millibars # km vs. astronomicalunits #Type ^D to get out

42 42 Winter Quarter 2004Rolando V. Raqueño % #%?!, I forgot my calculator! % % bc -l 2+2 10*20 3^100 sqrt(625) p=3.1415926535 c(p/2) s(p/2) for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)} (type quit to get out)

43 43 Winter Quarter 2004Rolando V. Raqueño % UNIX is Y2K Compliant % % cal % cal 2000 % cal 9 1752

44 44 Winter Quarter 2004Rolando V. Raqueño Metacharacters, Schmetacharacters In UNIX there are several characters that are not interpreted literally but contain some special meaning. These are called metacharacters. Examples |<>*&\()!

45 45 Winter Quarter 2004Rolando V. Raqueño UNIX Plumbing facilities ( Piping and Input/Output File Redirection) Output File Redirection % command1 > output_file Input File Redirection % command2 < input_file Piping % command1 | command2

46 46 Winter Quarter 2004Rolando V. Raqueño % Piping and Redirection Examples % % echo 2+2 % echo 2+2 > input.dat % bc -l < input.dat

47 47 Winter Quarter 2004Rolando V. Raqueño % Piping and Redirection Examples % % echo 2+2 | bc -l % echo 2+2 | bc -l > output.dat % echo 2+2 | tee input.dat | bc -l > output.dat

48 48 Winter Quarter 2004Rolando V. Raqueño % Line Continuation Metacharacter % In the previous command % echo 2+2 | tee input.dat | bc -l > output.dat Should technically be the following % echo 2+2 | tee input.dat | \ bc -l > output.dat Where the character “ \ ” indicates the continuation of a command line

49 49 Winter Quarter 2004Rolando V. Raqueño % More Elaborate Example % % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc -l

50 50 Winter Quarter 2004Rolando V. Raqueño % Public Service Announcement to Prevent Repetitive Motion Injury % % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc -l % !! This recalls the last command executed % !! | paste - - % !! > sine.dat

51 51 Winter Quarter 2004Rolando V. Raqueño Primitive Plotting Capabilities % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc –l | paste - - | graph | dumbplot % cat sine.dat | graph | dumbplot

52 52 Winter Quarter 2004Rolando V. Raqueño Result of dumbplot

53 53 Winter Quarter 2004Rolando V. Raqueño Less than Primitive Graphing Capabilities While depressing the Ctrl button with the mouse pointer in the xterm window, –Depress the middle mouse button –Select “tekshow” –Give the following command in the new window % cat sine.dat | graph | tek

54 54 Winter Quarter 2004Rolando V. Raqueño Result of tek plot

55 55 Winter Quarter 2004Rolando V. Raqueño The gnuplot utility % gnuplot G N U P L O T unix version 3.5 patchlevel 3.50.1.17, 27 Aug 93 last modified Fri Aug 27 05:21:33 GMT 1993 Copyright(C) 1986 - 1993 Thomas Williams, Colin Kelley Send comments and requests for help to info-gnuplot@dartmouth.edu Send bugs, suggestions and mods to bug-gnuplot@dartmouth.edu Terminal type set to 'x11' gnuplot> plot 'sine.dat' gnuplot>

56 56 Winter Quarter 2004Rolando V. Raqueño

57 57 Winter Quarter 2004Rolando V. Raqueño The UNIX History Channel: Studying history so you can repeat it UNIX remembers the commands you have typed in through a “history list” By giving the history command, you will see a numbered list of previously executed commands

58 58 Winter Quarter 2004Rolando V. Raqueño % Other Obscure UNIX Short Cuts % % !! # Recalls the last command and execute % !:p # Recalls the last command (don’t execute) % !c # Recalls the last command that begins with a c % !5 # Recalls the #5 argument in the history list

59 59 Winter Quarter 2004Rolando V. Raqueño More Esoteric UNIX Short Cuts % ^string1^string2 # Performs a substitution on the previous command of the first occurrence of string1 with string2 % command !$ # Recalls the very last argument of the previous command % command !* # Recalls the all the arguments of the very last command

60 60 Winter Quarter 2004Rolando V. Raqueño Or simply use up arrows if tcsh is available –It is available on our system –To switch to it simply type tcsh at the %

61 61 Winter Quarter 2004Rolando V. Raqueño IMPORTANT UNIX Concepts Environment and Shell Variables –These allow you to customize your UNIX environment –They are different in terms of their SCOPE SCOPE determines the visibility of a variable

62 62 Winter Quarter 2004Rolando V. Raqueño Other IMPORTANT UNIX Concepts Environment Variable –Examples are TERM and DISPLAY –Set a particular variable to a value by using the setenv command –You can print the value of a particular variable or all the environment variable using the printenv command

63 63 Winter Quarter 2004Rolando V. Raqueño % Environment Variables % Examples –To set environment variables % setenv TERM vt100 % setenv DOG Goofy –print out the terminal type % printenv TERM vt100 –print out all environment variables % printenv

64 64 Winter Quarter 2004Rolando V. Raqueño Shell Variables Shell variables similar to Environment variables –they have a limited scope, – exist only in the shell which they are defined. Environment variables –exist in all its children shells

65 65 Winter Quarter 2004Rolando V. Raqueño Environment vs. Shell Variables % set prompt = "Parent Shell > " Parent Shell > setenv DOG Goofy Parent Shell > set mouse=Mickey Parent Shell > printenv DOG Goofy Parent Shell > echo $mouse Mickey Parent Shell > xterm & (YOU SHOULD NOW HAVE A NEW xterm WINDOW) THIS IS KNOWN AS “SPAWNING A NEW (OR CHILD) PROCESS”

66 66 Winter Quarter 2004Rolando V. Raqueño Environment vs. Shell Variables (IN THE NEW xterm WINDOW, DO THE FOLLOWING) % set prompt = "Child Shell > " Child Shell > printenv DOG Goofy Child Shell > echo $mouse mouse: Undefined variable.

67 67 Winter Quarter 2004Rolando V. Raqueño Environment vs. Shell Variables Child Shell > setenv DOG Pluto Child Shell > set mouse=Minnie Child Shell > printenv DOG Pluto Child Shell > echo $mouse Minnie Child Shell > exit (THE xterm WINDOW SHOULD NOW GO AWAY - THIS PROCESS HAS NOW BEEN KILLED)

68 68 Winter Quarter 2004Rolando V. Raqueño Environment vs. Shell Variables Parent Shell > Parent Shell > printenv DOG Goofy Parent Shell > echo $mouse Mickey Parent Shell >

69 69 Winter Quarter 2004Rolando V. Raqueño Environment & Shell Variables Why is this important? –UNIX uses Environment and Shell Variables control a number of processes – Customizes your working environment –Variables used for UNIX Scripts They are typically defined and initialized in your.login and.cshrc files

70 70 Winter Quarter 2004Rolando V. Raqueño Useful Shell Variables filec #Allows file completion path #List of command directories cdpath #List of candidate directories to cd into history #Number of commands to remember

71 71 Winter Quarter 2004Rolando V. Raqueño The X-Windows Environment

72 72 Winter Quarter 2004Rolando V. Raqueño X-Windowing System Vendor independent Graphical User Interface (GUI) Works on a network client/server concept. The client is some entity (in this case a software package, IDL, for instance) that requests from another entity some form of service (e.g., IDL requests for program input or requests some output data to be displayed)

73 73 Winter Quarter 2004Rolando V. Raqueño X-Windowing System Windowing interface is decoupled from the software application Possible to remotely control software running at another location. rocky.cis.rit.edu bullwinkle.whatsomatau.edu

74 74 Winter Quarter 2004Rolando V. Raqueño Starting IDL remotely 0. Find out the name of the local workstation you are working on by typing the following commands % hostname 1. On the local workstation, type the following % xhost + ride.cis.rit.edu 2. Remotely log on to another machine using telnet. If you choose to use the computer “ride”, you would type % ssh ride.cis.rit.edu.

75 75 Winter Quarter 2004Rolando V. Raqueño Starting IDL 3. Check environment variable telling the remote system the name of your workstation. For example, if your local workstation was named “glen”, you would type % echo $DISPLAY % setenv DISPLAY glenn.cis.rit.edu:0.0 4. Run idldemo on the remote system; display graphics will be directed back to your local workstation.

76 76 Winter Quarter 2004Rolando V. Raqueño Other X-clients xterm xclipboard gnuplot ghostview acroread xfig xv

77 77 Winter Quarter 2004Rolando V. Raqueño xclipboard Allows cutting and pasting text fragments to and from files

78 78 Winter Quarter 2004Rolando V. Raqueño gnuplot Allows quick plotting of data files

79 79 Winter Quarter 2004Rolando V. Raqueño ghostview X client used to view files in postscript format (*.ps)

80 80 Winter Quarter 2004Rolando V. Raqueño acroread X client to read PDF (portable document files) files

81 81 Winter Quarter 2004Rolando V. Raqueño xfig X client to create drawings in EPS format

82 82 Winter Quarter 2004Rolando V. Raqueño xv X client to view most standard images

83 83 Winter Quarter 2004Rolando V. Raqueño FINAL Project Information Two design review presentations –(10-15 minutes long) What’s already out there to solve your problem How can you improve on it? Your plan of implementation and testing A Final Document of your Project –(PDF or HTML file desirable) Teaming is Encouraged Final Presentation Tuesday or Thursday of Finals Week (February 22 or 24) –12:00-4:00 in room 76-1275

84 84 Winter Quarter 2004Rolando V. Raqueño Previous Projects –Visualization of a DIRSIG Geometric Database –Visualization and modification of radiosonde data –IDL GUI to Visualize MODTRAN Output Data –Graphical User Interface for generating and modifying a MODTRAN Card deck –GUI for generating and modifying object material parameters –GUI for visualizing emissivity files

85 85 Winter Quarter 2004Rolando V. Raqueño Previous Projects –An IDL FFT Widget Based on Dr. Easton's Signals. –GUI for Displaying the CIELAB Color Matching Functions –Astronomical Image Analysis in IDL –Stereo Visualization of Plots –GUI for Visualizing Atmospheric Parameters –GUI for texture image creation and visualization

86 86 Winter Quarter 2004Rolando V. Raqueño Previous Projects –GUI for Modifying Material Parameters –Spectral Unmixing GUI Utilizing ENVI –Interface to Generate Satellite Image Preview and rendering using IDL’s globe and map database –Bi-directional Reflectance Parameter Viewer –Ephemeris program interface –Thermal Image apparent temperature predictor

87 87 Winter Quarter 2004Rolando V. Raqueño Location of Previous Project Archive http://www.cis.rit.edu/rolo/teaching/si mg726/project_archive/http://www.cis.rit.edu/rolo/teaching/si mg726/project_archive/ –project_archive.html Search wiki.cis.rit.edu –Keyword: Simg726 Final Project

88 88 Winter Quarter 2004Rolando V. Raqueño In order to log your session Use the script command % script Script started, file is typescript To stop the command ^D


Download ppt "1 Winter Quarter 2004Rolando V. Raqueño Getting Started SIMG 726."

Similar presentations


Ads by Google