Back Home Up Next

Subchapters:

Working with arrays

If you have some images, you can perform operations on them in the same way. Suppose we have image1, flat1, dark1:

        IDL> help,image1,dark1,flat1
            IMAGE1          FLOAT     = Array[512, 512]
            DARK1           FLOAT     = Array[512, 512]
            FLAT1           FLOAT     = Array[512, 512]
        IDL> image2 = (image1 - dark1) / (flat1 - dark1)

You may want to create a empty array?

        IDL> image = fltarr(1024,1024)

Or a array with something like that: 1.,2.,3.,4.,5.,6.,7.,8,etc... (it's a "floating indexed
generated array"):

        IDL> x = findgen(10)
        IDL> print,x
                  0.00000      1.00000      2.00000      3.00000      4.00000      5.00000
                  6.00000      7.00000      8.00000      9.00000

Oups, it begins with 0., and you wanna 1. to be the first element. Easy:

        IDL> x = x+1
        IDL> print,x
                  1.00000      2.00000      3.00000      4.00000      5.00000      6.00000
                  7.00000      8.00000      9.00000      10.0000

 

IDL courses C. Morisset © 2004 IA/UNAM V 2.2

Back Home Up Next