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

Home » Public Forums » archive » TRIANGULATE's bug?
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
TRIANGULATE's bug? [message #92310] Sun, 15 November 2015 21:44 Go to next message
Pachacoti is currently offline  Pachacoti
Messages: 2
Registered: November 2015
Junior Member
Hi,

I'm really confused by TRIANGULATE. I got an error message with the following commands:

IDL> theta=dindgen(360L)
IDL> rad=dindgen(500L)
IDL> xpol=rad#cos(theta/1.8d2*!dpi)
IDL> ypol=rad#sin(theta/1.8d2*!dpi)
IDL> triangulate,xpol,ypol,tri
% TRIANGULATE: Points are co-linear, no solution.
% Execution halted at: $MAIN$

However, the following works:
IDL> xpol=rad#cos(float(theta/1.8d2*!dpi))
IDL> ypol=rad#sin(float(theta/1.8d2*!dpi))
IDL> triangulate,xpol,ypol,tri
IDL> help,tri
TRI LONG = Array[3, 358920]

My intention is to convert a polar coordinated image to a Cartesian projected one. I'm faced with this when trying to convert float to double. Could anybody shed some light on this? How should I correct? Thx in advance.

Cheers, Pachacoti
Re: TRIANGULATE's bug? [message #92311 is a reply to message #92310] Mon, 16 November 2015 04:24 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pachacoti writes:

>
> Hi,
>
> I'm really confused by TRIANGULATE. I got an error message with the following commands:
>
> IDL> theta=dindgen(360L)
> IDL> rad=dindgen(500L)
> IDL> xpol=rad#cos(theta/1.8d2*!dpi)
> IDL> ypol=rad#sin(theta/1.8d2*!dpi)
> IDL> triangulate,xpol,ypol,tri
> % TRIANGULATE: Points are co-linear, no solution.
> % Execution halted at: $MAIN$
>
> However, the following works:
> IDL> xpol=rad#cos(float(theta/1.8d2*!dpi))
> IDL> ypol=rad#sin(float(theta/1.8d2*!dpi))
> IDL> triangulate,xpol,ypol,tri
> IDL> help,tri
> TRI LONG = Array[3, 358920]
>
> My intention is to convert a polar coordinated image to a Cartesian projected one. I'm faced with this when trying to convert float to double. Could anybody shed some light on this? How should I correct? Thx in advance.

There is a discussion of this problem, with a possible solution, in this
article, in The Solution section:

http://www.idlcoyote.com/code_tips/usegriddata.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: TRIANGULATE's bug? [message #92314 is a reply to message #92311] Mon, 16 November 2015 17:44 Go to previous message
Pachacoti is currently offline  Pachacoti
Messages: 2
Registered: November 2015
Junior Member
David,

Thank you for your reply. I followed the solution section you wrote, and it did solve the case I mentioned here. However, it fails to solve the actual one I'm working, however I tweak TOLERANCE. I put values of rad at http://tinyurl.com/ow5zp2f and values of theta at http://tinyurl.com/ok3nvb9. Anyone who is interested may feel free to play with them. Hopefully this has nothing to do with mac, win or linux...

Cheers, Pachacoti

On Monday, November 16, 2015 at 4:24:21 AM UTC-8, David Fanning wrote:
> Pachacoti writes:
>
>>
>> Hi,
>>
>> I'm really confused by TRIANGULATE. I got an error message with the following commands:
>>
>> IDL> theta=dindgen(360L)
>> IDL> rad=dindgen(500L)
>> IDL> xpol=rad#cos(theta/1.8d2*!dpi)
>> IDL> ypol=rad#sin(theta/1.8d2*!dpi)
>> IDL> triangulate,xpol,ypol,tri
>> % TRIANGULATE: Points are co-linear, no solution.
>> % Execution halted at: $MAIN$
>>
>> However, the following works:
>> IDL> xpol=rad#cos(float(theta/1.8d2*!dpi))
>> IDL> ypol=rad#sin(float(theta/1.8d2*!dpi))
>> IDL> triangulate,xpol,ypol,tri
>> IDL> help,tri
>> TRI LONG = Array[3, 358920]
>>
>> My intention is to convert a polar coordinated image to a Cartesian projected one. I'm faced with this when trying to convert float to double. Could anybody shed some light on this? How should I correct? Thx in advance.
>
> There is a discussion of this problem, with a possible solution, in this
> article, in The Solution section:
>
> http://www.idlcoyote.com/code_tips/usegriddata.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MPFIT .TIED
Next Topic: Averaging timesteps on large geospatial dataset?

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

Current Time: Wed Oct 08 09:13:27 PDT 2025

Total time taken to generate the page: 0.00424 seconds