pro norh_trans_byf,dayfr $ ,norun=norun,rawdir=rawdir,outfile=outfile $ ,freq=freq,event=event ;+ ; NAME: ; NORH_TRANS_BYF ; ; PURPOSE: ; This procedure transfers the raw-data files of NORH ; from the archive to the user's local directory. ; The input arguments must be the [date,frame] array. ; ; CALLING SEQUENCE: ; norh_trans_byf,dayfr ; ; INPUTS: ; dayfr: An n-element vector of long-type arrays. ; [[day,frame] ,[ ... ], ] ; The value for 'day' is the same as .day structure. ; ; OPTIONAL INPUT KEYWORDS: ; rawdir: Destination of requested files. ; Default is the current directory. ; event: event mode data ; freq: Observing frequency of the data. ; '17' or '34'. Default is '17'. ; outfile: Parameter file name for transfer shell script. ; Default is 'norh_trans_input'. ; norun: Set if you only need the parameter file and ; do not want really transfer yet. ; ; HISTORY: ; Written 1998-05-29 TY ; Modified 1999-02-04 TY /event support ; Modified 2001-01-12 TY insert uniq ; ;- if (n_elements(outfile) eq 0) then outfile=curdir()+'/'+'norh_trans_input' if (n_elements(rawdir) eq 0) then rawdir=curdir() if (n_elements(freq) eq 0) then freq=17 freqst=strtrim(freq,1) if keyword_set(event) then evf=norh_f2evf(dayfr,freq=freq) mfrx=n_elements(dayfr) for mfr=0,mfrx-1 do begin if not keyword_set(event) then begin el=anytim([0,dayfr(mfr).dayjst],/ex) yyyy=el(6) mm=el(5) dd=el(4) yy=yyyy-yyyy/100*100 yymmdd=string(yy,mm,dd,format="(i2.2,i2.2,i2.2)") ff=string(freq,format="(i2.2)") fileno=long((dayfr(mfr).frame-1)/600)+1 filenost=string(fileno,format="(i3.3)") sccar=dayfr(mfr).schedule if (sccar eq -1) then sccarst='-' else begin sccarst=string(byte('a')+byte(sccar)) endelse input_data= 'ss'+ff+yymmdd+filenost+' '+sccarst endif else begin input_data= evf(mfr) endelse if (mfr eq 0) then input_data_ar=input_data $ else input_data_ar=[input_data_ar,input_data] endfor if (n_elements(input_data_ar) ge 2) then $ input_data_ar=input_data_ar(uniq(input_data_ar)) openw,unit,outfile,/get_lun printf,unit,input_data_ar,form='(a)' close,unit free_lun,unit if not keyword_set(norun) then begin ; print,'norh_trans -r -t '+rawdir+' '+outfile ; spawn,'norh_trans -r -t '+rawdir+' '+outfile print,'norh_trans -t '+rawdir+' '+outfile ; 2000/5/31 by TY spawn,'norh_trans -t '+rawdir+' '+outfile ; 2000/5/31 by TY endif return end