This will create a file, fileout, containing the DATA component of the NDF called imagein. If you want to store the VARIANCE or QUALITY components you would use comp=v or comp=q respectively as additional parameters.% ndf2ascii in=imagein out=fileout
You can then employ a simple IDL batch file such as:
The above example assumes image dimensions of 339; Create IMAGE an 339x244 single precision floating point array. IMAGE=FLTARR(339,244) ; Open the existing NDF2ASCII file "fileout" for read only access. OPENR, UNIT, 'fileout', /GET_LUN ; Read formatted input from the specified file unit and ; place in the variable "IMAGE". READF, UNIT, IMAGE ; Closes the file unit used. CLOSE, UNIT ; Display the image after suitable scaling. TVSCL, IMAGE
One advantage of this route is that the ASCII data can instead be read directly into byte, integer or double-precision arrays/structures by simply substituting INTARR, DBLARR or BYTARR for FLTARR. Clearly, it should be remembered that attempting to represent floating-point values within a byte array will not work properly, whereas a double-precision array will accommodate double-precision, floating-point, integer or byte values (though somewhat inefficiently in terms of memory consumption).
CONVERT A Format-conversion Package