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 
Switch to threaded view of this topic Create a new topic Submit Reply
Rounding errors and the New Graphics image routine [message #86040] Wed, 25 September 2013 12:42 Go to next 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
Re: Rounding errors and the New Graphics image routine [message #86682 is a reply to message #86040] Thu, 28 November 2013 05:22 Go to previous message
robseigel is currently offline  robseigel
Messages: 3
Registered: November 2013
Junior Member
On Wednesday, September 25, 2013 3:42:59 PM UTC-4, Gordon Farquharson wrote:
> 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

Very helpful. Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
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 16:03:30 PDT 2025

Total time taken to generate the page: 0.00526 seconds