pro select_data ; 给出指定的文件夹 datapath=' ' read,prompt='enter the dir of the original data===========>',datapath ;确定活动区号 decide_arnum,datapath,q_name,ar_num ;确定所要拷贝的Q的文件 decide_qfile,datapath,ar_num,q_name ;确定要拷贝的l,u的文件 decide_lufile,datapath,ar_num,q_name,ll_name,uu_name lname=ll_name qname=q_name uname=uu_name lname=lname(sort(lname)) qname=qname(sort(qname)) uname=uname(sort(uname)) nq=n_elements(qname) sname=strarr(nq) tname=strarr(nq) rname=strarr(nq) for i=0L,nq-1 do begin ll_name=lname(i) qq_name=qname(i) uu_name=uname(i) l_name=strsplit(ll_name,'/\',/extract) l_name=l_name(n_elements(l_name)-1) q_name=strsplit(qq_name,'/\',/extract) q_name=q_name(n_elements(q_name)-1) u_name=strsplit(uu_name,'/\',/extract) u_name=u_name(n_elements(u_name)-1) if n_elements(o_name) eq 0 then begin o_name=strsplit(l_name,'.',/extract) o_name=o_name(0)+'.vps' endif llen1=strlen(ll_name) llen2=strlen(l_name) qlen1=strlen(qq_name) qlen2=strlen(q_name) ulen1=strlen(uu_name) ulen2=strlen(u_name) ss_name=ll_name tt_name=qq_name rr_name=uu_name strput,ss_name,'S',llen1-llen2 strput,tt_name,'T',llen1-llen2 strput,rr_name,'R',llen1-llen2 sname(i)=ss_name tname(i)=tt_name rname(i)=rr_name endfor outdir='D:\wgp\863data'+strmid(datapath,2,14)+'\' print,outdir f1='mkdir '+outdir spawn,f1 file=[lname,qname,uname,sname,tname,rname] n=n_elements(file) for i=0L,n-1 do begin f1='copy '+datapath+'\'+file(i)+' '+outdir+file(i) spawn,f1 endfor print,lname,qname,uname,sname,tname,rname end ;################################################################## pro decide_arnum,datapath,q_name,ar_num cd,datapath q_name=findfile('Q5*.fit') if q_name(0) eq '' then begin print,'no q data' stop endif q_name=q_name(sort(q_name)) ar_num=strmid(q_name,4,3) ar_num=ar_num(sort(ar_num)) n=n_elements(ar_num) ss=0 temp=ar_num(0) for i=1,n-1 do begin if ar_num(i) ne ar_num(i-1) then begin ss=[ss,i] temp=[temp,ar_num(i)] endif endfor ar_num=temp q_name=q_name(ss) print,'active region number ==============>',ar_num end ;######################################## pro decide_qfile,datapath,ar_num,q_name nn=n_elements(ar_num) temp_q_name=' ' ar_num=ar_num(sort(ar_num)) for j=0L,nn-1 do begin q_name=findfile('Q5*'+ar_num(j)+'*.fit') num=strmid(q_name,4,3) ss=where(num eq ar_num(j)) q_name=q_name(ss) dd=float(strmid(q_name,7,2)) hh=float(strmid(q_name,9,2)) mm=float(strmid(q_name,11,2)) n=n_elements(hh) for i=0L,n-1 do begin ss=-1 if hh(i) eq 4 then begin qq_name=q_name(i) ss=i endif if ss eq -1 then begin if hh(i) eq 3 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 5 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 2 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 6 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 1 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 7 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 23 then begin qq_name=q_name(i) ss=i endif endif if ss eq -1 then begin if hh(i) eq 8 then begin qq_name=q_name(i) ss=i endif endif endfor if n eq 1 then begin q_name=q_name endif else begin if ss lt n-1 then q_name=[q_name(ss),q_name(ss+1)] else q_name=[q_name(ss-1),q_name(ss)] endelse n=n_elements(q_name) if n gt 2 then q_name=q_name[0:1] temp_q_name=[temp_q_name,q_name] temp_q_name=temp_q_name(sort(temp_q_name)) endfor n=n_elements(temp_q_name) q_name=temp_q_name[1:n-1] end pro decide_lufile,datapath,ar_num,q_name,ll_name,uu_name nq=n_elements(q_name) n_ar_num=n_elements(ar_num) temp_ll_name=' ' temp_uu_name=' ' q_name=q_name(sort(q_name)) for k=0L,n_ar_num-1 do begin ss=where(strmid(q_name,4,3) eq ar_num(k),nq) qq_name=q_name(ss) ll_name=strarr(nq) uu_name=strarr(nq) l_name=findfile('L5*'+ar_num(k)+'*.fit') nl=n_elements(l_name) ldd=float(strmid(l_name,7,2)) lhh=float(strmid(l_name,9,2)) lmm=float(strmid(l_name,11,2)) tl=(ldd-ldd)*24.*60+lhh*60+lmm qdd=float(strmid(qq_name,7,2)) qhh=float(strmid(qq_name,9,2)) qmm=float(strmid(qq_name,11,2)) tq=(qdd-qdd)*24.*60+qhh*60+qmm for j=0L,nq-1 do begin for i=0L,nl-1 do begin if abs(tl(i)-tq(j)) le 10 then ll_name(j)=l_name(i) endfor endfor u_name=findfile('U5*'+ar_num(k)+'*.fit') nu=n_elements(u_name) udd=float(strmid(u_name,7,2)) uhh=float(strmid(u_name,9,2)) umm=float(strmid(u_name,11,2)) tu=(udd-udd)*24.*60+uhh*60+umm for j=0L,nq-1 do begin for i=0L,nu-1 do begin if abs(tu(i)-tq(j)) le 5 then uu_name(j)=u_name(i) endfor endfor temp_ll_name=[temp_ll_name,ll_name] temp_uu_name=[temp_uu_name,uu_name] endfor n=n_elements(temp_ll_name) ll_name=temp_ll_name[1:n-1] uu_name=temp_uu_name[1:n-1] end