<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear List members,<br><br>The python script pasted below does a calculation using the each pixel value of input data and writes it to new output raster. I also want to retrieve the extent and projection details from the input raster and pass it to output raster. gp.defineprojection() adds the projection details, but out.transform() fails to update the extent details in output raster. Am I doing anything wrong here or Is there any other way to pass the extent details from input to output raster?<br><br>I would appreciate any suggestion or help on this problem.<br><br>Thanks in advance...<br>Santosh<br><br>script:<br>from PIL import Image, ImageMath<br>import os, math, arcgisscripting<br>gp = arcgisscripting.create(9.3)<br>os.curdir = 'C:/temp'<br>input = raw_input("Enter input raster name and path with extension: ")<br>output = raw_input("Enter output raster
 name with extension: ")<br>lmax = float(raw_input("Enter lmax value: "))<br>lmin = float(raw_input("Enter lmin value: "))<br>d = float(raw_input("Enter d value: "))<br>eSun = float(raw_input("Enter esun value: "))<br>elv = float(raw_input("Enter elevation value: "))<br>im = Image.open(input)<br>def function(pixel):<br>&nbsp;&nbsp;&nbsp; return float((math.pi*((((lmax - lmin)/255)*pixel) + lmin)* d**2)/(eSun * math.cos((90 - elv)* .017453293)))<br>size = im.size<br>out = im.point(function)<br><br>out.transform(size, Image.AFFINE, (30, 0, 326385, 0, 30, 6391185))<br>out.save(output)<br>projection = 'C:/Program Files/ArcGIS/Coordinate Systems/Projected Coordinate Systems/UTM/WGS 1984/WGS 1984 UTM Zone 4N.prj'<br>gp.DefineProjection_management(output, projection)<br>print 'All done...'<br></td></tr></table><br>
      <!--6--><hr size=1></hr> Add more friends to your messenger and enjoy! <a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"> Invite them now.</a>