-- CarmeloArcidiacono - 09 Apr 2012

$ rm -f 6*

$ rm -f 7*

$ rm -f r.6*.fits

$ rm -f r.7*.fits

f = file_search('mean.irtc*.fits',COUNT=N)

badpixel = '/OldRepository/carmelo/badpixel.irtc.fits'

for i=0,N-1 do begin & image = readfits(f[i],h)& agw_col_correct,badpixel,image,badpixel_image,ima,mask_t & writefits,'clr.'+f[i],ima,h & endfor

f = file_search('clr.mean.irtc*.fits',COUNT=N)

for i=0,N-1 do begin &ima=readfits(f[i],h) & mf=strcompress(string(median(ima),FORMAT='(I4)'),/REMOVE) & l =1 & while l eq 1 do begin &o=file_search(mf+'.fits',COUNT=l)& if l eq 1 then mf=mf+'.'+strcompress(string(i),/remove) & endwhile & writefits,mf+'.fits',ima,h & if i eq 0 then p=median(ima) else p=[p,median(ima)] & if i eq 0 then mf_=mf else mf_=[mf_,mf] & endfor

st = median(p)

;index_piu = where(p lt st)
index_meno = where(p ge st,countm)
index_piu = where(p le st,countp)

if countm gt countp then index_meno=index_meno[1:*]

if countm lt countp then index_piu=index_piu[0:countp-2]
val_meno = p[index_meno]
val_piu = p[index_piu]
mf_meno = mf_[index_meno]
mf_piu = mf_[index_piu]
in = sort(val_meno)
mf_meno = mf_meno[in]
in = sort(val_piu)
mf_piu = mf_piu[in]

openw,1,'high.list' & for i=0,n_elements(index_meno)-1 do printf,1,mf_meno[i]+'.fits' & close,1
openw,1,'low.list' & for i=0,n_elements(index_piu)-1 do printf,1,mf_piu[i]+'.fits' & close,1

openw,1,'r.high.list' & for i=0,n_elements(index_meno)-1 do printf,1,'r.'+mf_meno[i]+'.fits' & close,1
Topic revision: r1 - 09 Apr 2012, CarmeloArcidiacono
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback