comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Rounding errors and the New Graphics image routine
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Rounding errors and the New Graphics image routine [message #86040] Wed, 25 September 2013 12:42 Go to previous message
Gordon Farquharson is currently offline  Gordon Farquharson
Messages: 48
Registered: December 2010
Member
Hi All

I'm posting this message as a reference, primarily for myself, in case I ever again find myself beating my head against the wall for several hours.

IDL> a = findgen(350,332)
IDL> x = 2000. * findgen(350) / 350.
IDL> y = 2000. * findgen(332) / 332.
IDL> p = image(a, x, y, AXIS_STYLE=2)
% Loaded DLM: PNG.

Everything is fine in IDL land so far...

IDL> x = 2000. * findgen(350) / 350. + 2.8e5
IDL> y = 2000. * findgen(332) / 332. + 3.8e6
IDL> p = image(a, x, y, AXIS_STYLE=2)
% Loaded DLM: QHULL.
% QHULL: Vector must have 350 elements: YIN
% Execution halted at: $MAIN$

WTF!

Several hours later (and many more expletives):

IDL> x = 2000. * findgen(350) / 350. + 2.8D5
IDL> y = 2000. * findgen(332) / 332. + 3.8D6
IDL> p = image(a, x, y, AXIS_STYLE=2)
IDL> p = image(a, x/1000., y/1000., AXIS_STYLE=2)

I guess I should have realized sooner that the problem would be due to a rounding error. Maybe this post will help somebody else out.

Gordon
[Message index]
 
Read Message
Read Message
Previous Topic: Secret of Failed IDL Business Plan
Next Topic: Error with MapProjection::Forward

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:13:14 PDT 2025

Total time taken to generate the page: 0.00188 seconds