Title: FINAL Project Information
1FINAL Project Information
- Two Design Review presentations (10-15 minutes
long) - A Final Document of your Project (LaTeX)
- HTML Page Describing your Project
- Choice of Topic Due after break
- Teaming is Encouraged
2Final Project
- E-mail me your Final Project Topic after break
- E-mail should contain
- a half page abstract of your intended GUI
design, and the problem domain that it addresses.
3Quiz 2 Topics
- RCS commands (ci and co)
- mv
- cp
- grep
- jobs
4Working with Data
5Representation of Information in a Computer
- All information in a computer is stored as a
collection of bits - A bit, also known as a binary digit, is a number
represented in base 2. It can only be either a 1
(one) or 0 (zero) - Think of information as data with structure
- All the ones and zeros represented by the
computer is data. How they are interpretted
generates information (or garbage)
6Representation of Information in a Computer
- Information stored in a computer can represent
- Instructions
- Executable Programs
- Data
- Numbers - integers and real values
- Characters - ASCII, multinational characters
- Others - imagery, sound, etc.
7Representation of Information in a Computer
- Bits in a computer are usually grouped into the
following units - 4 bits 1 nibble
- 8 bits 1 byte or 1 ( char ) - a single
character - 16 bits 2 bytes or 1 ( short int, int ) -
integer value - 32 bits 4 bytes or 1 ( long int, int ) -
integer value or 1( float) - real value - 64 bits 8 bytes or 1 (double) - real value
8Representation of Information in a Computer
- Numbers can be represented as either integers or
real values - integers -5, 0, 125, -32767
- real 3.14159, -2.71828, -1.0e-20, 10.000
- Text is typically represented using the ASCII
character set where each character is represented
as a byte value.
9Representation of Information in a Computer
10Representation of Information in a Computer
11Line Delimiters on Different Systems
- UNIX System, lines delimited by linefeed
- designated as nl
- ASCII value of 012 or 10
- In MACS and PCs, lines delimited by carriage
returns - designated as cr
- ASCII value of 015 or 13
- Still other systems use a combination of carriage
return-line feeds to delimit lines
12Common Cross PlatformFile Problem
- Some one gave you a text file created on a PC
which you transferred to the UNIX system. - You try to edit the file using vi, but vi
complains that the line is too long - Solution (A Stupid Unix Trick)
- cat old_file tr \015 \012 gt new_file
- This command translates all carriage returns to
line feeds.
13Numbering Systems
14Converting Number Bases
15Converting Number Bases
16Negative Number Representation
17Converting a Negative Number into Binary using
2s Complement
18How Does This All Relate to Computers and
Programming
191-bit Address Line and 1-bit Data Line Computer
Architecture
202-bit Address Line and 1-bit Data Line Computer
Architecture
211-bit Address Line and 2-bit Data Line Computer
Architecture
222-bit Address Line and 2-bit Data Line Computer
Architecture
238-bit Address Line and 8-bit Data Line Computer
Architecture
24In General
25Caveat on Multi-Byte Data
- When dealing with data that encompasses more than
a single byte (e.g. integer value greater than
255), you must know the endian of the data - Endian represents how a machine interprets the
significance of a set of bytes. - There are big-endian machines and little-endian
machines
26Caveat on Multi-Byte Data (Big Endian)
- Big Endian Machines (Suns, Motorolas) would
represent the integer value 512 internally as two
bytes in the following order. - MSB LSB
- 00000010 00000000
27Caveat on Multi-Byte Data (Little Endian)
- Little Endian Machines (DECS, Intels) would
represent the integer value 512 internally as two
bytes in the following order. - LSB MSB
- 00000000 00000010
28Caveat on Multi-Byte Data
- This is typically not a problem as long as you
stay on the same machine. - If you, however, start transferring data (e.g.
images) in raw form from one machine to another,
you will need to be aware of this situation. - You can often transpose multibyte data using the
dd utility (does not work for data spanning more
than two bytes)
29Working with IDL Variables
- Variable names must start with a letter but can
include, letters, digits, underscore or dollar
characters. - Variables are not case sensitive, i.e.,
- Celsius is equivalent to celsius
30Working with IDL Variables
- Variables in IDL have two important attributes
- Data type
- Attributes
31IDL Variable Data Types
- Undefined
- Integer Values
- Byte, Integer, Long Integer
- Floating Point Values
- Floating Point, Double Precision
- Single Precision Complex, Double Precision
Complex - String
32IDL Variable Data Structures
- Scalar
- Vector (one-dimensional array)
- Array (up to eight dimensions)
- Structure (combination of any mixture of data -
Very Important in understanding Object-Oriented
Programming Concepts)
33Initializing Scalar Variables
- byte_variable 0B
- integer_variable 0
- long_integer 0L
- float_variable 0.0
- double_variable 0.0D
- complex_variable Complex(0.0, 0.0)
- dcomplex_variable DComplex(0.0, 0.0)
- string_variable
34Initializing Array Variables
- byte_array bytarr( 256, 256, 3 )
- integer_array intarr( 256, 256 )
- long_array lonarr( 256, 256 )
- float_array fltarr( 256, 256 )
- double_array dblarr( 256, 256 )
- complex_array complexarr( 256, 256 )
- dcomplex_array dcomplexarr( 256, 256)
- string_array strarr(80)
35Shortcut Creating Indexed Array
- Some sample command
- IDLgt num findgen(40)
- IDLgt help,num
- NUM FLOAT Array(40)
- IDLgt print,num
- 0.00000 1.00000 2.00000 3.00000
4.00000 5.00000 6.00000 - 7.00000 8.00000 9.00000 10.0000
11.0000 12.0000 13.0000 - 14.0000 15.0000 16.0000 17.0000
18.0000 19.0000 20.0000 - 21.0000 22.0000 23.0000 24.0000
25.0000 26.0000 27.0000 - 28.0000 29.0000 30.0000 31.0000
32.0000 33.0000 34.0000 - 35.0000 36.0000 37.0000 38.0000
39.0000
36Initializing Array Variables
- Initializing Array with each element set to its
subscript - bindgen, indgen, lindgen, findgen, dindgen,
cindgen, dcindgen, sindgen - Only real parts of complex numbers are set to the
subscripts - An array of strings containing the numbers is
created by sindgen
37Initializing Array Variables (make_array and
replicate)
- Make_array function is a general way of creating
and initializing arrays - arraymake_array(10,12,Value1,/Int)
- Replicate functions allows initialization of all
elements of an array with a given variable
(useful in structures) - initial_value 1
- arrayreplicate(initial_value, 10,12)
38Structures in IDL
- Allows more abstract data types to be created
from other basic data types - Example
- Date data structure
- IDLgt adate, month0B, day0B, year0B
- IDLgt print,a
- 0 0 0
39Structures in IDL(Names Structure)
- Date Example (using a Named Structure)
- IDLgt a.month12
- IDLgt a.day25
- IDLgt a.year96
- IDLgt print,a
- 12 25 96
- IDLgt print,a.month
- 12
- IDLgt print,a.day
- 25
- IDLgt print,a.year
- 96
40Using Named Structures
- Date Named Structure Example
- IDLgt cdate
- IDLgt print,c
- 0 0 0
- IDLgt help,c
- C STRUCT -gt DATE Array(1)
41Anonymous Structures in IDL
- Anonymous Structures
- IDLgt dmonth1,day1,year97
- IDLgt print,d
- 1 1 97
- IDLgt ed
- IDLgt print,e
- 1 1 97
42Anonymous Structure Example
- Anonymous Structures
- IDLgt emonth'January',dayd.day,yeard.year
- IDLgt print,e
- January 1 97
- IDLgt e.month'December'
- IDLgt print,e
- December 1 97
43Querying Structures in IDL
- Determining Variable Structure
- IDLgt help,e,/structure
- Structure lt761058gt, 3 tags, length12, refs1
- MONTH STRING 'December'
- DAY INT 1
- YEAR INT 97
44Structures in IDL
- Determining Structure Characteristics
- IDLgt print,n_tags(e)
- 3
- IDLgt print,tag_names(e)
- MONTH DAY YEAR
45Array Manipulation in IDL
- Lets create an array representing a multiband
image - IDLgt imagebindgen(2,3,4)
- IDLgt print,image
- 0 1
- 2 3
- 4 5
46Array Manipulation in IDL
- image continued
- 6 7
- 8 9
- 10 11
- 12 13
- 14 15
- 16 17
47Array Manipulation in IDL
- image continued
- 18 19
- 20 21
- 22 23
48Array Manipulation in IDL
- Extract the first and last band of the image
- IDLgt print,image(,,0)
- 0 1
- 2 3
- 4 5
- IDLgt print,image(,,3)
- 18 19
- 20 21
- 22 23
49Array Manipulation in IDL
- Extracting the color or spectral vector of
the first pixel - IDLgt print,image(0,0,)
- 0
- 6
- 12
- 18
50Array Manipulation in IDL
- Assign band 1 to band 4
- IDLgt band1image(,,0)
- IDLgt image(,,3) band1
- Shortcut
- IDLgt image(,,3)image(,,0)
51Array Manipulation in IDL
- Subsectioning parts of an image
- IDLgt print,image(01,01,)
- 0 1
- 2 3
- 6 7
- 8 9
- 12 13
- 14 15
- 0 1
- 2 3
52Array Manipulation
- where function to find indices of elements that
meet certain criteria - IDLgtprint, where(image gt 5 and image lt 12)
- Use of other arrays to index other arrays
- IDLgtindiceswhere(image gt 5 and image lt 12)
- IDLgtimage(indices)-1
- Try the above as an exercise.
53(No Transcript)