pro get_movy_parts,filelist=filelist,hdr,index=index,data=data,$ tsl=tsl,tsm=tsm,tss=tss,sfrdir=sfrdir ;+ ; NAME ; get_movy_parts ; PURPOSE ; Given an SXT movie FITS header structure go and get ; the SFR index and data files that went into making that ; movie. ; CALLING SEQUENCE ; get_movy_parts,filelist=filelist,hdr,index=index,data=data,$ ; tsl=tsl,tsm=tsm,tss=tss,sfrdir=sfrdir ; Simple example: get_movy_parts,header,index=index,data=data ; INPUT ; hdr, SXT movie FITS header structure. ; OPTIONAL KEYWORD INPUT ; filelist, list of all SFR files for the week. ; ** Saves a little time. ** ; sfrdir, path to weekdir directory. ; Default: '/disk/pd1/weekdirs/' ; KEYWORD OUTPUT ; index, index structures of the SFRs in the movie. ; data, data cube of the SFRs in the movie. ; OPTIONAL KEYWORD OUTPUT ; tsl,tsm,tss - numbers of the image records in the roadmap ; structure for the entire week (rd_roadmap,filelist,rdm) ; for the long, medium and short exposures comprising each ; movie image. The definition of these is in mk_sff_pair.pro. ; RESTRICTIONS ; Cannot cross FEM-week boundaries unless filelist is supplied. ; Will default to weekid of hdr(0). ; HISTORY ; 22-Aug-2007 LWA ;- if not keyword_set(sfrdir) then sfrdir='/disk/pd1/weekdirs/' $ else sfrdir=sfrdir if not keyword_set(filelist) then begin wkid=anytim2weekinfo(hdr(0)) filelist=file_search(sfrdir+wkid+'/sfr*') endif rd_roadmap,filelist,rdm for i=0,n_elements(hdr)-1 do begin ss=strwhere(hdr(i).history,'*Used:*') ss2=stregex(hdr(i).history(ss),'Used') nimg=fix(strmid(hdr(i).history(ss),ss2+5,2)) case 1 of nimg eq 1 : begin tsl0=tim2dset(rdm,strmid(hdr(i).history(ss+1),7,23)) tsm0=tsl0 tss0=tsl0 end nimg eq 2 : begin tsl0=tim2dset(rdm,strmid(hdr(i).history(ss+2),7,23)) tsm0=tim2dset(rdm,strmid(hdr(i).history(ss+1),7,23)) tss0=tsm0 end nimg eq 3 : begin tsl0=tim2dset(rdm,strmid(hdr(i).history(ss+3),7,23)) tsm0=tim2dset(rdm,strmid(hdr(i).history(ss+2),7,23)) tss0=tim2dset(rdm,strmid(hdr(i).history(ss+1),7,23)) end endcase if i eq 0 then begin tsl=tsl0 tsm=tsm0 tss=tss0 endif else begin tsl=[tsl,tsl0] tsm=[tsm,tsm0] tss=[tss,tss0] endelse endfor tst=[tsl,tsm,tss] ass=sort(tst) uss=uniq(tst(ass)) tst=tst(ass(uss)) rd_xda,filelist,tst,index,data end