Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Converting IDL Syntax to Python?

syntax

  • Please log in to reply
1 reply to this topic

#1 rpb1323

rpb1323

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 23 July 2011 - 08:30 PM

I have some IDL code that I have been converting into Python, because the rest of my program is python. Anyways, I've been having issues with a couple lines of code:

neg = where(ra LT 0.0d0, Nneg)
if Nneg GT 0 then ra[neg] = ra[neg] + 2.0d*!DPI

Okay so this code is from a program that outputs the position of the sun in celestial coordinates. "ra" is "right ascension" (basically longitude for space), and in the context of the program, it is a variable defined previously.

Also, the !DPI, i'm assuming, is pi.

Anyways, I was having trouble with the "LT" and "GT", but I'm pretty sure those mean Less than and greater than. My issue is with the "Nneg". I'ts not a variable, so I have no idea what it does. Also, I have no idea how to interpret these lines. I don't know what it is trying to accomplish basically.

If you can help in any way that'd be great. thanks
  • 0

#2 rpb1323

rpb1323

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 25 July 2011 - 08:50 AM

bump
  • 0





Also tagged with one or more of these keywords: syntax

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download