-
Create a 2-D
array, A, with 5 columns and 3 rows using the INDGEN function
-
Print the array to the screen and verify its structure and
contents
-
Print TRANSPOSE(A). What are its
characteristics?
-
Print REVERSE(A). What are its
characteristics?
-
Now let B=[0,1,2]
-
Predict, then
verify, the outcome of the following operations:
-
C = A+1
-
C = A*0
-
C = A^2
-
C = A*(A+3)
-
C = A/A
-
C = EXP(A)
-
C = A+B
-
C = A*B
-
C = A(*,2)*B
-
C = A(4,2)*B
-
C = A#B
-
C = B#A
-
C = B##A
-
Now replace the element in
A[3,1] with the value 100
-
Verify the result by printing
-
Type the following command and interpret the
result:
PRINT, WHERE(A EQ 100)
-
Create Z, a 301x301
array, using the FINDGEN function.
-
What are the maximum and minimum values of
Z?
-
Using internal subscript notation, print to the terminal:
-
The first 50 elements of the first row of Z
-
The first 50 elements of the 99th column of Z
-
The last 10 elements of the 100th row of Z
-
Use the AstUseLib
(use add_path,/astro before) routine IMLIST to double-check the results of
the preceding exercise for the last 10 elements of the 100th row of Z. To get information on the IMLIST routine, type
MAN,'IMLIST. [Note: you will have to use the optional WIDTH keyword to increase the size of the printed display in order to
read all digits in the Z entries.]
-
Write an IDL expression which yields the contents of
Z[I,J] as a
function of I and J. [NOTE: remember the IDL subscripting convention for arrays is reversed from FORTRAN's: in
IDL A[I,J] yields the value of the I-th column and J-th row.]
-
Verify the expression against the actual contents
of Z for selected locations.
-
Now define B =
FLTARR(101,101)+20000.
-
What are the maximum and minimum values of
B?
-
Using internal subscript notation, set the 51st column of B equal
to 100000.
-
Then set the 51st row of B equal to 100000.
-
Now insert the array B into the original array Z, with the lower
left-hand corner of the insert beginning at Z[100,100].
-
Confirm the placement of the insert using IMLIST