function norp_mvalid,ndx,nclbi

;+
; NAME:
;       NORP_MVALID
;
; PURPOSE:
;       This function is to get the information if the data is valid or not
;
; CALLING SEQUENCE:
;       mvalid=norp_mvalid(ndx,nclbi)
;
; INPUTS:
;       ndx: scalar integer value indicating the size of output array
;       nclbi: 2-dimensional (2,*) integer array
;              1st element corresponds to the start and 2nd to the end
;              of strip to be 0 in output array
;
; OPTIONAL INPUT KEYWORDS:
;
; OUTPUTS:
;       mvalid: 1-dimensional byte array
;
; 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
;  <<Caution: ambient level at 9.4GHz is incorrect. Use zero as ref. level>>
;       95.12.12 Ver.3.1  M. Nishio and K. Shibasaki (1GHz ATT 7dB -> 4.3)
;       98.09.03          sekix  & shinox   add 80GHz
;       98.11.20  K. Hori
;       1999-1-12 TY unify program for old/new NoRP data
;
;-

mvalid=bytarr(ndx)+1b

sz=size(nclbi) 
case sz(0) of
2: mclbx=sz(2) 
1: mclbx=1
else: return,mvalid
endcase


for mclb=0,mclbx-1 do begin
  ninval_st=(nclbi(0,mclb))>0
  ninval_ed=(nclbi(1,mclb))<(ndx-1)
  if (ninval_st le ninval_ed) then mvalid(ninval_st:ninval_ed)=0
endfor

return,mvalid
end
