-
Notifications
You must be signed in to change notification settings - Fork 0
/
SumMask.pro
42 lines (33 loc) · 912 Bytes
/
SumMask.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
PRO timemark
common time,runtime,resultfolder
print,'Start!',systime()
runtime=string(systime())
resultfolder=strcompress('/nfshome/byliu/Data/result/'+string(runtime)+'/')
FILE_MKDIR,resultfolder
return
END
PRO SumMask
timemark
common time
print,resultfolder
print,'Read-in the mask'
fitsname='/nfshome/byliu/Data/MAGMADR3/gm/LMC_MAGMA_DR3.co.gm.mask.fits'
maskfit=mrdfits(fitsname)
maskhead=headfits(fitsname)
print,'Mask fits read!'
print,size(maskfit)
sumed=make_array(1600,1533)
for x=0,1599 do begin
print,x
for y=0,1532 do begin
sumed(x,y)=total(maskfit(x,y,*),/NAN)
;if sumed(x,y) gt 0 then print,x,y,sumed(x,y)
endfor
endfor
outfilename=strcompress(resultfolder+'LMC_MAGMA_DR3.co.gm.mask_sum.fits')
outhead=maskhead
sxaddpar,outhead,'NAXIS',2
sxdelpar,outhead,['NAXIS3','CRPIX3','CDELT3','CRVAL3','CTYPE3']
mwrfits,sumed,outfilename,outhead
print,'finished!'
END