X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Jun 2007 08:47 AM by  anon
error from envi_stats_doit
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
02 Jun 2007 08:47 AM
    Dear Forum, I would like to derive some image stats and am having trouble with the 'envi_stats_doit' function. here is the command line input that I have been using. input_file = 'path to my floating point image' envi_open_file, input_file, r_fid=input_fid envi_file_query, input_fid, dims=dims, ns=ns, nl=nl, fname=fname, data_type=data_type envi_doit, 'envi_stats_doit', fid=input_fid, dims=dims, comp_flag=1, dmin=dmin, dmax=dmax, $ mean=mean, stdv=stdv print, 'Minimum ', dmin print, 'Maximum ', dmax print, 'Mean ', mean print, 'Standard Deviation ', stdv The image opens fine and is available from the available bands list, the problem occurs with the 'envi_stats_doit' I get an error saying that the 'array dimensions must be greater than 0'. I have looked at the example in the envi help file and my approach seems to be almost similar. I think the problem lies in telling 'envi_stats_doit' which file to interogate, currently it is using input_fid which as I understand it points to the file originally opened, or I may be wrong. I know I can just open the images in envi and calculate statistics but I would rather do it programatically and save time. I am new to IDL so any help would be greatly appreciated. Regards, Wesley

    Deleted User



    New Member


    Posts:
    New Member


    --
    02 Jun 2007 08:47 AM
    It looks like you left off the POS keyword. Without it, envi_stats_doit doesn't know which bands to process. Since the keyword is required, the routine will check for it and determine that it is undefined (zero elements). That would definitely lead to the error message you received. Try something this, which will process all bands in your image: envi_open_file, input_file, r_fid=input_fid envi_file_query, input_fid, dims=dims, ns=ns, nl=nl, fname=fname, data_type=data_type, $ nb=nb envi_doit, 'envi_stats_doit', fid=input_fid, dims=dims, comp_flag=1, dmin=dmin, dmax=dmax, $ mean=mean, stdv=stdv, pos=lindgen(nb)
    You are not authorized to post a reply.