;+ ;NAME: ; ksc_commands0 ;PURPOSE: ; FTP the SXTSPT output from flare1 to a local machine ;CALLING SEQUENCE: ; IDL> ksc_commands0 ; ;INPUTS: ;OPTIONAL INPUTS: ;OPTIONAL OUTPUTS: ;RESTRICTIONS: ; This routine is intended for use mainly by the SXT CO at ISAS ; ; ;HISTORY: ; 13-May-99, DMcK, written by way of hacking JRL's program GET_KSC_RAW ; 18-May-99, DMcK, generated output filenames ;- pro ksc_commands0, qstop=qstop ; Set up the ftp get directory: file1 = 'cmdlst' file2 = 'cmplst' node = 'flare1' user = 'yohkoh' & passwd = 'UchinoUra' indir = '/home/flare1/sxt/sxtspt/' ; Set up the output directory name: outdir0='/0p/sxt_co/KSC_commands/' message,/info,'Will write data to: '+outdir0 ; Make sure the output directory exists: if not file_exist(outdir0) then begin message,/info,'Creating output directory: '+outdir0 spawn,'mkdir '+outdir0 if not file_exist(outdir0) then $ message,'Error -- Could not create output directory' endif rawdir = outdir0 ; Return the output directory home_dir = curdir() ; Save the current possition cd,outdir0 ; Generate output filenames blah=anytim(!stime,/ccsds) yyyy=strmid(blah,0,4) mo=strmid(blah,5,2) dd=strmid(blah,8,2) hh=strmid(blah,11,2) mn=strmid(blah,14,2) outname1=file1+'.'+yyyy+mo+dd+'.'+hh+mn outname2=file2+'.'+yyyy+mo+dd+'.'+hh+mn ;FIRST FILE ; Spawn the ftp command: ftp_copy,file1,node,user,passwd,indir,/get,/ascii,ftp_res=ftp_res,outfil=outname1 ; Should add a OUTFILE to this in order to change the name of the ; output, including the date+time of the ftp....DMcK print,ftp_res ; Report the ftp status ; Do a find file on the new files: new_files = findfile(outname1,count=count) if count eq 0 then print,'No files copied' else begin print,'Number of files copied = ',strtrim(count,2) print,new_files,format='(6(2x,a))' endelse ; SECOND FILE ftp_copy,file2,node,user,passwd,indir,/get,/ascii,ftp_res=ftp_res,outfil=outname2 print,ftp_res ; Report the ftp status new_files = findfile(outname2,count=count) if count eq 0 then print,'No files copied' else begin print,'Number of files copied = ',strtrim(count,2) print,new_files,format='(6(2x,a))' endelse ; Return to the original directory: cd,home_dir if keyword_set(qstop) then stop end