Subchapters:
|
Working with arraysYou can extract a part of an array, let say the 4th to the 7th elements of vec1 (the arrays begin with the index = 0): IDL>
print,vec1[3:6] The version 5.0 of IDL recommends to use [ ] instead of ( ) for the arrays. You can also extract part of an image. The * (star) symbol means all the (remaining) elements in the considered dimension. IDL>
sub_image = image1[101:400,101:400] Tip: The spectr here is a 2D array, with only 1 column. If you want to have a 1D vector, you have to reform it: IDL>
spectr = reform(spectr) This is not the case for the row vectors, compare: IDL>
help,image1[0,*] |
IDL courses C. Morisset © 2004 IA/UNAM V 2.2 |