X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Sep 2013 05:21 AM by  anon
ENVI_CONVERT_FILE_MAP_PROJECTION problem
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
25 Sep 2013 05:21 AM
    Hi everyone, I am having some issue when I call the function ENVI_CONVERT_FILE_MAP_PROJECTION in my code. Basically I am trying to convert a MODIS ET product from sinusoidal to a UTM projection. ENVI_OPEN_FILE, filename(i), r_fid=fid ENVI_FILE_QUERY, fid, dims=dims map_info = envi_get_map_info(fid=fid) ;define the output projection o_pixel_size = [1000.0, 1000.0] datum='WGS-84' units = ENVI_TRANSLATE_PROJECTION_UNITS('m') o_proj = envi_proj_create(/utm, datum=datum, zone=40, units=units) out_name='C:\Desktop\ET\test.tif' ENVI_CONVERT_FILE_MAP_PROJECTION,fid=fid, dims=dims, o_proj=o_proj,o_pixel_size=o_pixel_size, grid=[25,25], $ out_name=out_name, warp_method=2, resampling=0, background=0 I get this error: reg_warp_doit Variable is undefined WL. Any clue? I cannot find nor the function reg_warp_doit neither the WL variable. I checked on the forum and somebody else got the same problem (but no answer). http://www.exelisvis.com/...e/posts/Default.aspx

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    26 Sep 2013 12:21 PM
    I think the error is misleading and may have nothing to do with the 'wl' parameter (which typically is the variable for wavelengths). Sometimes you can get strange errors when unexpected parameters are passed to the routine. A good first start is to insert PRINT statements for all your variables and make sure they are returning what you think they are returning. For example, what does your map_info variable show? Another test is to use the Project Raster tool in ENVI 5 and see if you can successfully reproject using the GUI. If so, then it should be possible to use the code to do it.

    Deleted User



    New Member


    Posts:
    New Member


    --
    30 Sep 2013 12:16 AM
    Yes I tried the GUI and everything was fine. I compared the two processes (GUI and command lines) and apparently I am passing all the required varibles. By the way, at the end I solved the problem in ArcGIS, extracting the Python code from the model builder. It would be nice to see in the future versions of ENVI, a IDL code from ENVI GUI automatically generated, like Python in ArcGIS and M-code in MATLAB.
    You are not authorized to post a reply.