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
|