|
Re: Matlab to IDL [message #36619 is a reply to message #12606] |
Sun, 12 October 2003 17:47  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
dino.nicola@libero.it (dino nicola) writes:
> I forgot to say that when I run the code I get this message if I use
> the TVSCL command:
>
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating overflow
> % Program caused arithmetic error: Floating illegal operand
>
> while I get this one using TV:
>
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating illegal operand
>
> Don't know if this makes sense but I' m just a beginner in IDL. Thank
> you.
Sounds like the format, or the endianness, of your data are not what
you expected. Since you are reading unformatted floating point data,
you need to take special care that the file is formatted in the same
way, and written by a computer with the same endianness
(byte-ordering).
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Matlab to IDL [message #36620 is a reply to message #12606] |
Sun, 12 October 2003 16:12  |
andrew.cool
Messages: 47 Registered: July 2003
|
Member |
|
|
dino.nicola@libero.it (dino nicola) wrote in message news:<688447c0.0310121046.298717c5@posting.google.com>...
> I forgot to say that when I run the code I get this message if I use
> the TVSCL command:
>
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating overflow
> % Program caused arithmetic error: Floating illegal operand
>
> while I get this one using TV:
>
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating illegal operand
>
> Don't know if this makes sense but I' m just a beginner in IDL. Thank
> you.
Hi Dino,
How about trying this snippet of code that generates some dummy data.
On my Windows 2000 machine running IDL 6.0 it produces a window of
skewed rainbow coloured contours.
pro pcon
condensor = DIST(1025,512)
openw,lun,'c:\test.sdt',/get
writeu,lun,condensor
free_lun,lun
file='c:\test.sdt'
rad=fltarr(1024,512)
openr,lun,file,/get_lun
;point_lun,lun,0
readu,lun,rad
close,lun
window,xs=1024,ys=512
device,decomposed=0
loadct,38
tvscl,rad
end
Also, note that you need to either :-
a. specifically size the window to your data,
e.g. window,xsize=1024,ysize=512 to see all your consensor image, or
b. reduce the condensor array to the default window size using the
Congrid command.
If you don't get the same effect, there's something deeply wrong!
Perhaps your file doesn't contain what you think it contains!
Good Luck,
Andrew
------------------------------------------------------------ -------------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ -------------------
|
|
|
Re: Matlab to IDL [message #36621 is a reply to message #12606] |
Sun, 12 October 2003 11:46  |
dino.nicola
Messages: 7 Registered: October 2003
|
Junior Member |
|
|
I forgot to say that when I run the code I get this message if I use
the TVSCL command:
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating overflow
% Program caused arithmetic error: Floating illegal operand
while I get this one using TV:
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand
Don't know if this makes sense but I' m just a beginner in IDL. Thank
you.
|
|
|
Re: Matlab to IDL [message #36622 is a reply to message #12606] |
Sun, 12 October 2003 11:43  |
dino.nicola
Messages: 7 Registered: October 2003
|
Junior Member |
|
|
I forgot to say that when I run the code I get this message if I use
the TVSCL command:
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating overflow
% Program caused arithmetic error: Floating illegal operand
while I get this one using TV:
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand
Don't know if this makes sense but I' m just a beginner in IDL. Thank
you.
|
|
|
Re: Matlab to IDL [message #36623 is a reply to message #12606] |
Sun, 12 October 2003 10:50  |
dino.nicola
Messages: 7 Registered: October 2003
|
Junior Member |
|
|
> I'd try using TVSCL rather than the TV command. With
> floating point data, the chance of it already being
> scaled into the range of 0 to 255 is slim. :-)
>
> Cheers,
>
> David
I've tried the TVSCL command too, but the result is very bad anyway.
It appears like a 'starry night', with some white dots over a black
background while it should be an x-ray photograph of a condenser.
Thanks, Dino
|
|
|
Re: Matlab to IDL [message #36626 is a reply to message #12606] |
Sat, 11 October 2003 13:38  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
dino nicola writes:
> Here is the IDL script:
>
> file='c:\pcon_1.sdt'
> rad=fltarr(1024,512)
> openr,lun,file,/get_lun
> point_lun,lun,0
> readu,lun,rad
> close,lun
> device,decomposed=0
> loadct,0
> tv,rad
> end
>
>
> Anybody can help me? thanks!
I'd try using TVSCL rather than the TV command. With
floating point data, the chance of it already being
scaled into the range of 0 to 255 is slim. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|