function norp_gt_npa,stat,iatt=iatt ;+ ; NAME: ; NORP_GT_NPA ; ; PURPOSE: ; This function is for getting the mode number of ATT ; ; CALLING SEQUENCE: ; npa=norp_gt_npa(stat) ; ; INPUTS: ; stat: 1-dimensional integer array indicating the status of observation ; ; OPTIONAL INPUT: ; iatt: 1-dimensional integer array indicating ; threshold value for the status of ATT (only for old NoRP) ; ; OUTPUTS: ; npa: 1-dimensional integer array indicating the ATT mode ; ; HISTORY: ; programmed by T. Kosugi in 1984 May as Fortran program ; for old NoRP data format ; re-programmed by H.Sekiguchi 1987 July - 1988 Dec. ; ; 1995 July,20 N,Shinox for new format NoRP data ; 95.04.19 ed. add ATT correction for pol data ,correction data type ; changed intarr() to fltarr()., ; 95.09.04 Ver.2.0 M. Nishio and K. Hori ; 95.11.10 Ver.3.0 M. Nishio refernce level at 9.4GHz= amb -> zero ; <> ; 95.12.12 Ver.3.1 M. Nishio and K. Shibasaki (1GHz ATT 7dB -> 4.3) ; 95.09.06 V1.0 M. Nishio ; 95.11.10 V1.1 K. Hori and M. Nishio debug ; 96.04.01 M. Nishio (bug fix) ; 98.08.28 H.Sekiguchi: add 80GHz ; 98.11.17 KH: Done only for specified data period ; 98.09.03 sekix & shinox add 80GHz ; 98.11.20 K. Hori ; 1999-1-12 TY unify program for old/new NoRP data ; ;- npa=intarr(n_elements(stat)) if keyword_set(iatt) then begin ;old for matt=0,n_elements(iatt)-1 do begin whr=where((stat gt iatt(matt)),count) if (count ge 1) then npa(whr)=matt+1 endfor endif else begin ;new for m=0,3 do begin whr=where((stat and '0F0'x) eq 16*(m+1),count) if (count ge 1) then npa(whr)=m+1 endfor endelse return,npa end