pro norh_synth_byf,dayfr $ ,norun=norun,host=host,queue=queue $ ,freq=freq,event=event,prog=prog,version=version $ ,outfile=outfile,imgdir=imgdir $ ,usewk=usewk,useac=useac,usead=usead,szfile=szfile,rawdir=rawdir $ ,nfrcal=nfrcal,nfrint=nfrint $ ,cenunit=cenunit,cenfnl=cenfnl,size=size $ ,clcrfac=clcrfac,clcra=clcra,clcrs=clcrs $ ,clc2a=clc2a,clc2s=clc2s $ ,ref_frame=ref_frame,ref_nfrcal=ref_nfrcal ;+ ; NAME: ; NORH_SYNTH_BYF ; ; PURPOSE: ; This procedure gives a front-end for synthesizing ; the NORH images from the raw data. ; after calling this procedure. ; The input arguments must be the [date,frame] array. ; ; CALLING SEQUENCE: ; norh_synth_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: ; prog: The program for synthesizing. ; 'hanaoka', 'koshix' or 'fujiki' is available. ; Default is 'hanaoka'. ; rawdir: Destination of requested files. ; Default is the current directory. ; imgdir: Directory for synthesized image 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 run yet. ; event: Set if you synthesize the event (50/100 msec) data ; ; HISTORY: ; Written 1998-05-29 TY ; Modified 1998-09-08 TY ; Modified 1998-11-11 TY for multi-schedule support ; Modified 1998-11-12 TY for non-NSRO user support ; Modified 1998-11-17 TY for Fujiki-synth. support ; Modified 1999-02-04 TY /event support ; Modified 2000-06-22 TY bug fix ; Modified 2001-03-06 TY for ver6.3 ; ;- if (n_elements(outfile) eq 0) then outfile=curdir()+'/'+'norh_synth_input' if (n_elements(rawdir) eq 0) then rawdir=curdir() if (n_elements(freq) eq 0) then freq=17 if (n_elements(imgdir) eq 0) then imgdir=curdir() if (n_elements(prog) eq 0) then prog='hanaoka' if (n_elements(version) eq 0) then version='-1' if (n_elements(event) eq 0) then event=0 if (n_elements(host) eq 0) then host='' if (n_elements(queue) eq 0) then queue='' freqst=strtrim(freq,1) if keyword_set(event) then evf=norh_f2evf(dayfr,freq=freq) case prog of 'koshix' : begin if (freqst ne '17') then $ message,'Sorry, koshix can handle only 17GHz data' ; if keyword_set(event) then $ ; message,'Sorry, koshix cannot handle event (50/100msec) data' end 'fujiki' : begin if (freqst ne '17') then $ message,'Sorry, fujiki can handle only 17GHz data' ; if keyword_set(event) then $ ; message,'Sorry, fujiki cannot handle event (50/100msec) data' end else : begin end endcase if (n_elements(dayfr) ge 2) then begin dayj_unq=dayfr(uniq(dayfr.dayjst)).dayjst endif else begin dayj_unq=dayfr.dayjst endelse mdayjx=n_elements(dayj_unq) for mdayj=0,mdayjx-1 do begin todayj=dayj_unq(mdayj) whr=where(dayfr.dayjst eq todayj) dayfr_todayj=dayfr(whr) if (n_elements(dayfr_todayj) ge 2) then begin schedule_unq=dayfr_todayj(uniq(dayfr_todayj.schedule)).schedule endif else begin schedule_unq=dayfr_todayj.schedule endelse mschedulex=n_elements(schedule_unq) for mschedule=0,mschedulex-1 do begin thissche=schedule_unq(mschedule) whr=where(dayfr.schedule eq thissche) dayfr_thissche=dayfr(whr) if (n_elements(dayfr_thissche) ge 2) then $ dayfr_thissche=dayfr_thissche(uniq(dayfr_thissche.frame)) whr1=where((dayfr_thissche.frame ne -1), mfrx) if (mfrx ne 0) then begin dayfr0=dayfr_thissche(whr1) el=anytim([0,todayj],/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)") yyyys=string(yyyy,format="(i4.4)") mms=string(mm,format="(i2.2)") dds=string(dd,format="(i2.2)") if not keyword_set(event) then begin ; steady if (thissche ge 0) then begin sccar='a' & sccar_byte=byte(sccar) for m=0,thissche-1 do sccar_byte=sccar_byte+1B sccar=string(sccar_byte) endif else sccar='' if keyword_set(useac) then begin rawdir=getenv('DIR_NORH_RAW')+'/steady/'+yyyys+'/'+mms+'/'+dds endif if keyword_set(usead) then begin rawdir=getenv('DIR_NORH_RWD')+'/steady/'+yyyys+'/'+mms+'/'+dds endif if keyword_set(usewk) then begin rawdir=getenv('DIR_NORH_RWK')+'/'+'ss'+yymmdd endif rawdir0=rawdir rawfile=rawdir+'/'+'ss'+ff+yymmdd+sccar endif else begin ; event sccar='' rawdir0=rawdir if keyword_set(useac) then begin rawdir=getenv('DIR_NORH_RAW')+'/event/'+yyyys+'/'+mms+'/'+dds rawdir0=getenv('DIR_NORH_RAW')+'/steady/'+yyyys+'/'+mms+'/'+dds endif if keyword_set(usead) then begin rawdir=getenv('DIR_NORH_RWD')+'/event/'+yyyys+'/'+mms+'/'+dds rawdir0=getenv('DIR_NORH_RWD')+'/steady/'+yyyys+'/'+mms+'/'+dds endif if keyword_set(usewk) then begin rawdir=getenv('DIR_NORH_RWK')+'/' $ +'se'+yymmdd rawdir0=getenv('DIR_NORH_RWK')+'/' $ +'ss'+yymmdd endif rawfile=rawdir+'/'+evf(mschedule) endelse if keyword_set(szfile) then szfile0=szfile else begin szdir=getenv('DIR_NORH_SZU') if (szdir ne '') then szpath=[curdir(),szdir,rawdir0] $ else szpath=[curdir(),rawdir0] szname= 'sz00'+yymmdd +sccar+'001' if n_elements(szpath) ge 2 then szpath=szpath(uniq(szpath)) flist=file_list(szpath,szname) if (n_elements(flist) eq 1) then begin if (flist(0) eq '') then begin print,'Warning: No sz file found' szfile0=curdir()+'/'+szname endif else begin szfile0=flist(0) endelse endif else begin szfile0=flist(0) endelse endelse rlphdiffile=norh_sel_diff([0,todayj]) imgfile=imgdir+'/'+'s'+ff+yymmdd+sccar+'_' outfile0=outfile+strtrim(mdayj,2)+sccar frame=dayfr0.frame case prog of 'hanaoka' : begin if (version eq '5.0') then imgdir=imgfile norh_hanaoka,rawfile,szfile0,frame $ ,outfile=outfile0,rlphdiffile=rlphdiffile,imgdir=imgdir $ ,version=version,freq=freq $ ,cenfnl=cenfnl,cenunit=cenunit,size=size $ ,nfrint=nfrint $ ,nfrcal=nfrcal,ref_frame=ref_frame,ref_nfrcal=ref_nfrcal $ ,clcra=clcra,clcrs=clcrs,clcrfac=clcrfac progfreq=prog+freqst end 'koshix' : begin norh_koshix,rawfile,szfile0,frame $ ,outfile=outfile0,rlphdiffile=rlphdiffile,imgdir=imgdir $ ,version=version,freq=freq $ ,cenfnl=cenfnl,cenunit=cenunit,size=size $ ,nfrint=nfrint $ ,nfrcal=nfrcal,ref_frame=ref_frame,ref_nfrcal=ref_nfrcal $ ,clcra=clcra,clcrs=clcrs progfreq=prog+freqst end 'fujiki' : begin if (n_elements(cenfnl) eq 0) then begin print,'Warning: coordinate of the Sun center not given' cenfnl=[0,0] endif if (version eq '3') then imgdir=imgfile norh_fujiki,rawfile,szfile0,frame $ ,outfile=outfile0,rlphdiffile=rlphdiffile,imgdir=imgdir $ ,version=version,freq=freq $ ,cenfnl=cenfnl,cenunit=cenunit $ ,nfrint=nfrint $ ,nfrcal=nfrcal,ref_frame=ref_frame,ref_nfrcal=ref_nfrcal $ ,clcrfac=clcrfac,clcra=clcra,clcrs=clcrs,clc2a=clc2a,clc2s=clc2s progfreq=prog+freqst end endcase option='' if (host ne '') then option=option+' -h '+host if (queue ne '') then option=option+' -q '+queue if (version ne '-1') then option=option+' -v '+version if not keyword_set(norun) then begin print,'norh_synth -p '+progfreq+' '+option+' '+outfile0 spawn,'norh_synth -p '+progfreq+' '+option+' '+outfile0 endif endif endfor endfor return end