[Tutor] [tutor] Finding image statistics

Eike Welk eike.welk at gmx.net
Mon Mar 10 02:40:26 CET 2008


On Monday 10 March 2008 01:53, Varsha Purohit wrote:
>  # read the ascii file
>     hdr = read_ascii.header(inFile)
>     temp= hdr[4].strip().split() # temp is a list which is
> ['cellsize', '127']
>     cellsize = temp[1]

"cellsize" is a character string I think! You must convert it to a 
number to use it in a multiplication:

     cellsize = float(temp[1])

or

     cellsize = int(temp[1])


Regards, Eike.


More information about the Tutor mailing list