- #1
Lyuokdea
- 154
- 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.
I've tried using a for loop:
and that produces an error on the endif statement of the first run.
Can anybody help me with this?
Thanks in advance,
~Lyuokdea
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