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

  • Context: Graduate 
  • Thread starter Thread starter Lyuokdea
  • Start date Start date
Click For Summary
SUMMARY

The forum discussion addresses an error encountered while using IDL/Healpix for processing FITS maps. The user, Lyuokdea, experiences freezing in a while loop and syntax errors with the ENDIF command. The issue appears to stem from the system setup rather than the code itself, as similar errors occur in both hidl and normal IDL environments. The user seeks assistance in resolving these errors to successfully execute their code.

PREREQUISITES
  • Familiarity with IDL (Interactive Data Language) programming
  • Understanding of Healpix data format
  • Basic knowledge of FITS (Flexible Image Transport System) file handling
  • Experience with control flow structures in programming (e.g., loops and conditionals)
NEXT STEPS
  • Investigate IDL/Healpix installation and configuration settings
  • Learn about debugging techniques in IDL to identify syntax errors
  • Explore the use of the IDL command line for troubleshooting
  • Research common issues with FITS file processing in IDL
USEFUL FOR

Astrophysicists, data analysts, and software developers working with IDL and Healpix for astronomical data analysis.

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
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 4 ·
Replies
4
Views
9K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
14K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
4K