How to Fix an Error with the Setup of IDL/Healpix?

  • Thread starter Thread starter Lyuokdea
  • Start date Start date
AI Thread Summary
The user is experiencing freezing issues with IDL/Healpix code, specifically in a while loop that processes healpix format maps. The code fails to execute past the first line of the loop, and attempts to switch to a for loop result in an error at the endif statement. The user suspects a setup error on their system, as similar syntax errors occur in basic IDL commands. Suggestions for troubleshooting or fixing the setup issue are requested. The discussion highlights potential problems with the user's IDL installation or environment configuration.
Lyuokdea
Messages
154
Reaction score
0
Put this in the astro forum, since you guys are the most likely to be using this software...please move if that's inappropriate:

I have IDL/Healpix installed on my system, and I'm trying to run what I think should be a fairly simple set of commands, but the code is freezing in the first line of the while loop, without getting to any of the print commands:

The maps in question are healpix format and have about 192000 columns, so it's not that 1000 is larger than the map size.

Code:
read_fits_map, "maps.fits", map
read_fits_map, "mask.fits", mask
numpixels=0
totalvalue=0
numi = 0L
while numi lt 1000 do begin
        if mask[numi] EQ 0 then begin
                totalvalue = totalvalue + map[numi]
                numpixels = numpixels + 1
        endif
        print, numi
        numi = numi + 1
endwhile
print, totalvalue
print, numpixels

I've tried using a for loop:

Code:
Compile_Opt defint32
read_fits_map, "maps.fits", map
read_fits_map, "mask.fits", mask
numpixels=0
totalvalue=0
numi = 0L
for numi=0L, 1, 1000 do begin
        if mask[numi] EQ 0 then begin
                totalvalue = totalvalue + map[numi]
                numpixels = numpixels + 1
        endif
        print, numi
        numi = numi + 1
endfor
print, totalvalue
print, numpixels

and that produces an error on the endif statement of the first run.

Can anybody help me with this?

Thanks in advance,

~Lyuokdea
 
Astronomy news on Phys.org
It seems that it is an error with the setup with my system...

going into hidl and typing:

y=-2
if y lt 0 THEN BEGIN
t=2
ENDIF

gives a syntax error on the ENDIF command...however i believe this is entirely correct. Please correct me if I'm wrong, or let me know of a way to fix that.

The same thing happens in normal idl

Thanks,

~Lyuokdea
 
Publication: Redox-driven mineral and organic associations in Jezero Crater, Mars Article: NASA Says Mars Rover Discovered Potential Biosignature Last Year Press conference The ~100 authors don't find a good way this could have formed without life, but also can't rule it out. Now that they have shared their findings with the larger community someone else might find an explanation - or maybe it was actually made by life.
TL;DR Summary: In 3 years, the Square Kilometre Array (SKA) telescope (or rather, a system of telescopes) should be put into operation. In case of failure to detect alien signals, it will further expand the radius of the so-called silence (or rather, radio silence) of the Universe. Is there any sense in this or is blissful ignorance better? In 3 years, the Square Kilometre Array (SKA) telescope (or rather, a system of telescopes) should be put into operation. In case of failure to detect...
This thread is dedicated to the beauty and awesomeness of our Universe. If you feel like it, please share video clips and photos (or nice animations) of space and objects in space in this thread. Your posts, clips and photos may by all means include scientific information; that does not make it less beautiful to me (n.b. the posts must of course comply with the PF guidelines, i.e. regarding science, only mainstream science is allowed, fringe/pseudoscience is not allowed). n.b. I start this...
Back
Top