Re: Would you help me out? data converting problem. [message #12332] |
Tue, 21 July 1998 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <35B3EA5B.AEF03773@maxwell.ph.kcl.ac.uk>, Jouhahn Lee <jl@maxwell.ph.kcl.ac.uk> writes:
> This is a multi-part message in MIME format.
> --------------007CC9E8235FA634588EBB27
> Content-Type: text/plain; charset=x-user-defined
> Content-Transfer-Encoding: 8bit
>
> Hello friends,
>
> a string form of integer data. The data set was consist of 2048 integer
> ascii numbers.
> What I am trying to do is to make 64 x 32 image from that data file.�
> However, I could
> not convert this file to 64x32 image file.
You say the data are ASCII. If so the following IDL code should work:
data = lonarr(62, 32)
openr, lun, /get, 'aug14.dat'
readf, lun, data ; Formatted read
If the data are actually binary then do the following:
data = lonarr(62, 32)
openr, lun, /get, 'aug14.dat'
readu, lun, data ; Unformatted read
You can also read into a linear 2048 array and then convert to 2-D:
data = lonarr(2048)
openr, lun, /get, 'aug14.dat'
readf, lun, data ; Formatted read
data = reform(data, 64, 32)
____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
|
|
|