X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Feb 2007 12:34 PM by  anon
Windows question
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Feb 2007 12:34 PM
    Hi all. I just got my IDL student edition for Windows today. I'm excited to have this on my home computer (no more waiting at school for a terminal :) I have a few questions: I wrote a short IDL program on my school's computer, but it won't run on my home PC. My first error was the undefined variable"readfits". I'm new at this. I had no idea that readfits wasn't simply part of the language. So I downloaded readfits.pro from the Nasa site and put it in my Lib folder. That took care of the first error message. The next error message is "Attempt to call undefined procedure/function: 'SXPAR'. Error occured at: READFITS 332" Sure enough, line 332 in readfits is bitpix = sxpar(header,'BITPIX') So I downloaded sxpar.pro from the Nasa website and put it im my Lib folder. But that didn't solve the problem. I still get this same error message. Did I place it in the wrong folder?? Thanks!!

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Feb 2007 12:34 PM
    Unless you are extremely hard-pressed for disk storage space, I doubt you want to cherry-pick from the 'astrolib' .pro library. It is only 4 MB in size. I would instead recommend that you download the whole library (for Windows it is compressed into a file named 'astron.zip'), that: - you extract the zipped contents to a location other than IDL's 'lib' directory - add the path to its install directory to your IDL search path (via the IDLDE's 'File->Preferences...->Path tab page'). Put it after the path, but before any other paths you may have added to the IDL search path. - delete the couple of files you added earlier to IDL's 'lib' directory. Finally, you may want to read the documentation about READFITS at: http://idlastro.gsfc.nasa.gov/fitsio.html Exit IDL before you retest. Use IDLDE for your testing, not command-line IDL. Now, if you run and get the same SXPAR error, these are always the first debug steps I attempt after being surprised by an "Attempt to call undefined procedure/function" error: 1) I type: ".EDIT SXPAR" at the IDL> command prompt. This should open in my IDLDE editor the first 'sxpar.pro' file found in the IDL search path. If nothing comes up, then it means that I actually do not have 'sxpar.pro' in my search path ... at least not set with permissions to allow my current login to read it. If, on the other hand, 'sxpar.pro' DOES come up in the editor, then what I usually, if not always, will find is that the first 'sxpar.pro' that IDL found in my search path has an SXPAR PROcedure, when I was calling a FUNCTION (or vice versa). Generally, this second problem will happen only when I have my own custom file(s) called 'sxpar.pro' on my system, and their implementations are conflicting. 2) If 'sxpar.pro' did not show up in my editor, or if the wrong 'sxpar.pro' showed up (i.e. the PROcedure, not the FUNCTION), then I will generally go out on my file system with 'File->Open...' and find what I am sure must be the correct 'sxpar.pro'. I then compile this SXPAR, either overwriting the previous compilation or adding a FUNCTION compilation next to a previous PROcedure compilation. If I have found the correct 'sxpar.pro' the "Attempt to call undefined procedure/function" problem should go away. Best of luck. Enjoy your new programming toy. James Jones
    You are not authorized to post a reply.