[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading from process pipes in IDL?



Benno Puetz (puetz@mpipsykl.mpg.de) wrote:
: I have been trying to read image data from compressed (*.gz) files.
: I would prefer a way similar to PERL's
:     open(FILE, "gzip -cd $file |");

Benno -

If you know the array size in advance, you can use the -c flag to gunzip
to stdout and capture the output in a unit pipe: 

IDL> imagedata=intarr(1325,800)
IDL> spawn, 'gunzip -c testdata.dat.Z', unit=dataunit 
IDL> readu,dataunit,imagedata 
IDL> free_lun,dataunit 
IDL> help,imagedata 
IMAGEDATA       INT       = Array[1325, 800] 


--
  __.                                        
 /  | , , , , , ,_                           Gwyn Fireman
(__/|/(_(_)(_/|/| |_/                        gfirem1@alumni.umbc.edu
   /|        /|
  (_/       (_/