
56f418d868d662266c6965089a9423c9.ppt
- Количество слайдов: 80
Getting Started SIMG 726 Rolando V. Raqueño 1 Sunday, March 18, 2018
Location of Class Notes • http: //www. cis. rit. edu/~rvrpc i/teaching/simg 726/20022 – Arranged by Class Number – Watch out for Posted Messages – Link to e-mail • Previous year’s notes – http: //www. cis. rit. edu/~rvrpci/t eaching/simg 726/20012 Rolando V. Raqueño 2 Sunday, March 18, 2018
Reading • On-Line Tour of IDL • UNIX Reading Assignment Guide • IDL Reading Assignment Guide Rolando V. Raqueño 3 Sunday, March 18, 2018
Objective • • • Quiz #1 Topics Define Homework/Project #1 Brief Introduction to UNIX IDL demo More Final Project Details Rolando V. Raqueño 4 Sunday, March 18, 2018
Quiz #1 Topics for December 6 • man • ls • cp • mv • pwd Rolando V. Raqueño 5 Sunday, March 18, 2018
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) 6 Rolando V. Raqueño Sunday, March 18, 2018
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 Rolando V. Raqueño 7 Sunday, March 18, 2018
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 Rolando V. Raqueño 8 Sunday, March 18, 2018
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 • La. Te. X documentation exercise Rolando V. Raqueño 9 Sunday, March 18, 2018
Homework/Project #1 - Part 2 • Test for the ambitious - Read in a PBMPLUS formatted image to test your statistics routine Rolando V. Raqueño 10 Sunday, March 18, 2018
Homework/Project #1 Guidelines • Due Before Break • Please follow the program submission guidelines (should be in La. Te. X) • Hardcopy submission (for marking up) Rolando V. Raqueño 11 Sunday, March 18, 2018
Brief Introduction to UNIX Rolando V. Raqueño 12 Sunday, March 18, 2018
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 Rolando V. Raqueño 13 Sunday, March 18, 2018
Before we start % source ~rvrpci/. simg 726. rc Rolando V. Raqueño 14 Sunday, March 18, 2018
The “Original” UNIX Desktop $ Rolando V. Raqueño 15 Sunday, March 18, 2018
The “New and Improved” UNIX Desktop % Rolando V. Raqueño 16 Sunday, March 18, 2018
These represent UNIX Shells % prompt indicates The C-shell (csh) $ prompt indicates The Bourne-shell (sh) Rolando V. Raqueño 17 Sunday, March 18, 2018
Other UNIX Shells • bash -“Bourne again” shell – Distributed with LINUX • tcsh - C-shell variant – Allows the use of up-arrow keys • ksh - Korn shell Rolando V. Raqueño 18 Sunday, March 18, 2018
UNIX Shell Prompt % prompt indicates C-shell $ prompt indicates Bourne-shell Rolando V. Raqueño 19 Sunday, March 18, 2018
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” Rolando V. Raqueño 20 Sunday, March 18, 2018
% xterm example % • Under the X windowing environment – Repeatedly start several windows by giving the xterm command. % xterm & Rolando V. Raqueño 21 Sunday, March 18, 2018
UNIX Command Form % command [options] arg 2 arg 3. . . 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 Rolando V. Raqueño 22 Sunday, March 18, 2018
% 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 Rolando V. Raqueño 23 Sunday, March 18, 2018
% Most Important UNIX Command % • To correct the command we can type % man man(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] -f title. . . man [-M | -P pathname] -k keyword. . 24 Rolando V. Raqueño Sunday, March 18, 2018
% Other UNIX Commands % • You know the name of the command, but you need a reminder of what it does. % whatis man (1) man, man. page (5) reference pages Rolando V. Raqueño - Displays reference pages - The man macro packages for 25 Sunday, March 18, 2018
% Other UNIX Commands % • You know a keyword about a command, but don’t remember the command itself % apropos printer Rolando V. Raqueño 26 Sunday, March 18, 2018
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) 27 Rolando V. Raqueño Sunday, March 18, 2018
Most Common Keyboard Problem: You press the “backspace key” to erase a character, but instead you get ^H whenever you press it. Solution: % stty erase Rolando V. Raqueño 28 ^H Sunday, March 18, 2018
Most Common Keyboard Problem: You press the “delete key” to erase a character, but instead you get ^? whenever you press it. Solution: % stty erase Rolando V. Raqueño 29 ^? Sunday, March 18, 2018
% 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 Rolando V. Raqueño 30 Sunday, March 18, 2018
Sample UNIX Directory Tree Structure Rolando V. Raqueño 31 Sunday, March 18, 2018
Where am I? (Two Types of Pathnames) • Absolute Path (always starts with a / ) /usr/local/bin/ls /cis/students/neg 3153/. login • Relative Path (does not start with a / ) pub. /pub. . /testing ~neg 3153/. login 32 Rolando V. Raqueño Sunday, March 18, 2018
% 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 33 % ls -a Rolando V. Raqueño Sunday, March 18, 2018
% What “Else” UNIX Can Do (How do you spell releif? ) % % % look Rolando V. Raqueño rel re re | more re | wc 34 Sunday, March 18, 2018
% “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 Rolando V. Raqueño 35 Sunday, March 18, 2018
% #%? !, 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) Rolando V. Raqueño 36 Sunday, March 18, 2018
% UNIX is Y 2 K Compliant % % cal 2000 Rolando V. Raqueño 37 Sunday, March 18, 2018
Metacharacters, Schmetacharacters • In UNIX there are several characters that are not interpreted literally but contain some special meaning. These are called metacharacters. • Examples | < Rolando V. Raqueño > * & 38 ( ) Sunday, March 18, 2018 !
UNIX Plumbing facilities (Piping and Input/Output File Redirection) • Output File Redirection % command 1 > output_file • Input File Redirection % command 2 < input_file • Piping % command 1 | command 2 Rolando V. Raqueño 39 Sunday, March 18, 2018
% Piping and Redirection Examples % % echo 2+2 > input. dat % bc -l < input. dat Rolando V. Raqueño 40 Sunday, March 18, 2018
% Piping and Redirection Examples % % echo 2+2 | bc -l > output. dat % echo 2+2 | tee input. dat | bc -l > output. dat Rolando V. Raqueño 41 Sunday, March 18, 2018
% 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 Rolando V. Raqueño 42 Sunday, March 18, 2018
% More Elaborate Example % % echo “for( f=-10. 0; f<=10. 0; f+=0. 1 ) {f; s(f)}” | bc -l Rolando V. Raqueño 43 Sunday, March 18, 2018
% 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 Rolando V. Raqueño 44 Sunday, March 18, 2018
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 Rolando V. Raqueño 45 Sunday, March 18, 2018
Result of dumbplot Rolando V. Raqueño 46 Sunday, March 18, 2018
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 • % echo “for( f=-10. 0; f<=10. 0; f+=0. 1 ) {f; s(f)}” | bc –l | paste - - | graph | tek Rolando V. Raqueño 47 Sunday, March 18, 2018
Result of tek plot Rolando V. Raqueño 48 Sunday, March 18, 2018
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 'x 11' gnuplot> plot 'sine. dat' gnuplot> Rolando V. Raqueño 49 Sunday, March 18, 2018
Rolando V. Raqueño 50 Sunday, March 18, 2018
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 Rolando V. Raqueño 51 Sunday, March 18, 2018
% Other Obscure UNIX Short Cuts % % !! % !: p # Recalls the last command execute # 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 Rolando V. Raqueño 52 Sunday, March 18, 2018
More Esoteric UNIX Short Cuts % ^string 1^string 2 # Performs a substitution on the previous command of the first occurrence of string 1 with string 2 % command !$ # Recalls the very last argument of the previous command % command !* # Recalls the all the arguments of Rolando V. Raqueño 53 the very last command Sunday, March 18, 2018
Or simply use up arrows • if tcsh is available Rolando V. Raqueño 54 Sunday, March 18, 2018
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 Rolando V. Raqueño 55 Sunday, March 18, 2018
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 Rolando V. Raqueño 56 Sunday, March 18, 2018
% Environment Variables % • Examples – To set environment variables % setenv TERM vt 100 % setenv DOG Goofy – print out the terminal type % printenv TERM vt 100 – print out all environment variables % printenv 57 Rolando V. Raqueño Sunday, March 18, 2018
Shell Variables • Shell variables are similar to Environment variables except they have a limited scope, i. e. , they exist only in the shell which they are defined. • Environment variables on the other hand, exist in all its children shells • To illustrate this concept, let us look at the following example Rolando V. Raqueño 58 Sunday, March 18, 2018
Environment vs. Shell Variables % set prompt Parent Shell Goofy Parent Shell Mickey Parent Shell = > > > "Parent Shell > " setenv DOG Goofy set mouse=Mickey printenv DOG > echo $mouse > xterm & (YOU SHOULD NOW HAVE A NEW xterm WINDOW) THIS IS KNOWN AS “SPAWNING A NEW (OR CHILD) PROCESS” Rolando V. Raqueño 59 Sunday, March 18, 2018
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: Undefined variable. Rolando V. Raqueño 60 Sunday, March 18, 2018
Environment vs. Shell Variables Child Shell Pluto Child Shell Minnie Child Shell > setenv DOG Pluto > set mouse=Minnie > printenv DOG > echo $mouse > exit (THE xterm WINDOW SHOULD NOW GO AWAY - THIS PROCESS HAS NOW BEEN KILLED) Rolando V. Raqueño 61 Sunday, March 18, 2018
Environment vs. Shell Variables Parent Goofy Parent Mickey Parent Shell > printenv DOG Shell > echo $mouse Shell > Rolando V. Raqueño 62 Sunday, March 18, 2018
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 Rolando V. Raqueño 63 Sunday, March 18, 2018
Useful Shell Variables filec path #Allows file completion #List of command directories cdpath #List of candidate directories to cd into history #Number of commands to remember Rolando V. Raqueño 64 Sunday, March 18, 2018
The X-Windows Environment Rolando V. Raqueño 65 Sunday, March 18, 2018
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) Rolando V. Raqueño 66 Sunday, March 18, 2018
X-Windowing System • Windowing interface is decoupled from the software application • Possible to remotely control software running at another location. bullwinkle. whatsomatau. edu Rolando V. Raqueño 67 rocky. cis. rit. edu Sunday, March 18, 2018
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 + 2. Remotely log on to another machine using telnet. If you choose to use the computer “ride”, you would type % telnet ride. cis. rit. edu. Rolando V. Raqueño 68 Sunday, March 18, 2018
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. Rolando V. Raqueño 69 Sunday, March 18, 2018
Other X-clients • • xterm xclipboard gnuplot ghostview acroread xfig xv Rolando V. Raqueño 70 Sunday, March 18, 2018
xclipboard • Allows cutting and pasting text fragments to and from files Rolando V. Raqueño 71 Sunday, March 18, 2018
gnuplot • Allows quick plotting of data files Rolando V. Raqueño 72 Sunday, March 18, 2018
ghostview • X client used to view files in postscript format (*. ps) Rolando V. Raqueño 73 Sunday, March 18, 2018
acroread • X client to read PDF (portable document files) files Rolando V. Raqueño 74 Sunday, March 18, 2018
xfig • X client to create drawings in EPS format Rolando V. Raqueño 75 Sunday, March 18, 2018
xv • X client to view most standard images Rolando V. Raqueño 76 Sunday, March 18, 2018
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 Rolando V. Raqueño 77 Sunday, March 18, 2018
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 78 Rolando V. Raqueño for visualizing emissivity files March 18, 2018 Sunday, – GUI
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 79 visualization Rolando V. Raqueño Sunday, March 18, 2018
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 80 predictor Rolando V. Raqueño Sunday, March 18, 2018