pro norp_gt_ndata,timerange,timej,ndata

;+
; NAME:
;       NORP_GT_NDATA
;
; PURPOSE:
;       This procedure is for getting the position of data
;       corresponding to the given timerange
;
; CALLING SEQUENCE:
;       norp_gt_ndata,timerange,timej,ndata
;
; INPUTS:
;       timerange: 2-elements string array indicating the
;                  time range of the data to be read
;             e.g. ['1998-1-1 4:00','1998-1-1 5:00']
;       timej: structure array with 'time internal format'. Time is in JST.
;
; OPTIONAL INPUT KEYWORDS:
;
; OUTPUTS:
;       ndata: 2-elements long-integer array indicating the
;              position of data corresponding to the given timerange
;
; 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
;
;-

   ndata=lonarr(2)
   trange=anytim(timerange,/ints)
   ndata(0)=norp_t2i(timej.time,trange(0).time)
   ndata(1)=norp_t2i(timej.time,trange(1).time)-1


return
end
