X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Jun 2011 11:56 AM by  anon
Using an array (instead of fid=fid) in IDL to run TOPO_DOIT
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 Jun 2011 11:56 AM
    Dear all, I searched the forum, google, and the help files but couldn't find an answer. I have two brief questions; I would appreciate if you could answer them. Q1) I want to use a variable of my own inside idl to run TOPO_DOIT.. Briefly instead of saying: ENVI_DOIT, 'TOPO_DOIT', fid=fid, elevation= 45.00, azimuth=110.00, BPTR = [2], DIMS = dims, POS = [0], R_FID = r_dif, PIXEL_SIZE = pixel_size, IN_MEMORY = 1 I want to use DEM = load(filename) DEM = DEM+500. ENVI_DOIT, 'TOPO_DOIT', DEM , elevation= 45.00, azimuth=110.00, BPTR = [2], DIMS = dims, POS = [0], R_FID = r_dif, PIXEL_SIZE = pixel_size, IN_MEMORY = 1 I want to input the variable of my own (here "DEM") that I obtained previously in idl rather than using "fid=fid".. Can I do it? Q2) TOPO_DOIT assumes the solar-elevation and the solar-azimuth are same for all the input pixels. However, in real life solar elevation and solar azimuth changes from pixel to pixel (for calculation of shade relief). So, ideally I would like to input arrays of "solar elevation", "solar azimuth", and even "pixel_size" (need the accuracy for a scientific calculation). Can I do it? I tried two different ways of shade-relief calculation (below) but they gave me two different answers; a) ENVI_DOIT, 'TOPO_DOIT', fid=fid, elevation= 45.00, azimuth=110.00, BPTR = [2], DIMS = dims, POS = [0], R_FID = r_dif, PIXEL_SIZE = pixel_size, IN_MEMORY = 1 and elev = fltarr( (dims[2]+1), (dims[4]+1) ) elev[*] = 45.00 azim = fltarr( (dims[2]+1), (dims[4]+1) ) azim[*] = 110.00 b) ENVI_DOIT, 'TOPO_DOIT', fid=fid, elevation= elev, azimuth=azim, BPTR = [2], DIMS = dims, POS = [0], R_FID = r_dif, PIXEL_SIZE = pixel_size, IN_MEMORY = 1 I would have expected both "a" and "b" would give the same results (because input elevations and the azimuths are same) but while "a" gave me a reasonable answer, "b" did not give me the same.. In fact "b" gave very unrealistic results.. I can potentially getaway with this by writing the input image to a disk pixel by pixel (~40million pixels), and create a header file for each of them, and then use the "fid=fid" option to calculate the shaded relief, but this is too inefficient and possibly would take too long time to calculate. Thank you very much for your time, Ray
    You are not authorized to post a reply.