;+ ; Contains the list_freq function ; ; :Author: ; Baptiste Cecconi ; ; :History: ; V2.4 [27-fev-2006] ; LIST_FREQ is now a FUNCTION instead of a procedure. ; Added /Freq_index and /verbose keyword ; modified /Quiet keyword behaviour ; ; V3.0 [28-fev-2006] ; reading .lis files to check for op-modes and then reads only necessary N1/N2 ; ; 2013/03/01: Last Edit ;- ; ;+ ; liste des frequences utilisees (frequency table) ; ; :Uses: ; read_data_opmode ; ; :Returns: ; <return desc here> ; ; :Params: ; aaaajjjd: in, required, type=string ; date de debut ; hd: in, required, type=int ; heure de debut ; aaaajjjf: in, required, type=string ; date de fin ; hf: in, required, type=int ; heure de fin ; ; :Keywords: ; quiet: in, optional, type=byte ; no output on screen ; verbose: in, optional, type=byte ; long output on screen (useful for debug) ; freq_index: in, optional, type=byte ; outputs FREQ_INDEX instead of FREQ. ;- FUNCTION LIST_FREQ, aaaajjjd, hd, aaaajjjf, hf, $ quiet=quiet, verbose=verbose, $ freq_index=freq_index ; checking freq_index keyword and setting data_level accordingly if keyword_set(freq_index) then data_level = 'n1' else data_level = 'n2' ; verbose output if keyword_set(verbose) then message,'Loading opmodes .lis data for '+$ string(format='(I7,".",I2.2,"-",I7,".",I2.2)',aaaajjjd, hd, aaaajjjf, hf),/info read_data_opmode,aaaajjjd, hd, aaaajjjf, hf,opmode,verbose=verbose,/keep_valid_only;,/mode_change nopmode = n_elements(opmode) ; loading data file list FileList=[''] nFileList = 0L for imode = 0,nopmode-1 do begin aj = long(t97_aj(opmode(imode).t97)) hh = fix((opmode(imode).t97 mod 1.d0)* 24.d0) ptrDataFileList = make_file_list(aj, hh, aj, hh+1, level=data_level) if ~ptr_valid(ptrDataFileList) then stop fileList=[fileList,*ptrDataFileList] nFileList =nfilelist + 1l ptr_free, ptrDataFileList endfor FileList = FileList[1:*] ; initializing freq list if keyword_set(freq_index) then xf = [0l] else xf=[0.] nf = 0l ; load files and find new freqs for iFile = 0l,nFileList-1l do begin if keyword_set(verbose) then message,fileList(iFile),/info read_data_binary,fileList(iFile),data,level=data_level if keyword_set(freq_index) then xf = uniq_list([xf,data.fi]) $ else xf = uniq_list([xf,data.f]) if n_elements(xf)-1 ne nf then begin if not keyword_set(quiet) then $ message,'% found '+string(n_elements(xf)-1-nf)+' new frequencies in '+fileList(iFile),/info nf = n_elements(xf)-1 endif endfor ; removing seed from freq list xf=xf(1:*) if not keyword_set(quiet) then help,xf return,xf end