;+ ;NAME: ; get_ksc_raw ;PURPOSE: ; FTP the ksc raw ffi data from KSC (flare4) to a local machine ;CALLING SEQUENCE: ; get_ksc_raw ; Will prompt for information ; get_ksc_raw,1006 ; Get data for 6-Oct ; get_ksc_raw,1006,outdir=outdir ; Specify the output directory ; get_ksc_raw,1006,rawdir=rawdir ; (output) rawdir is location of ; ;- raw KSC files ; ;INPUTS: ; day - Must be an integer in MMDD format ;OPTIONAL INPUTS: ; outdir - To specify the output directory. The default is to ; put the data on /scr/s1//saHHMM ;OPTIONAL OUTPUTS: ; rawdir - Return the output directory ;RESTRICTIONS: ; This routine is intended for use mainly by the SXT CO at ISAS ; ; get_ksc_raw will attemp to create the outdir directory, but its parent ; must exist, since the routine does not recursively attempt to create ; any intermediate directories. ; ; If no outdir is specified, the routine will try to create a user ; directory on the /scr/s1 scratch disk ; ;HISTORY: ; 7-Oct-1997, J. R. Lemen, Written ;- pro get_ksc_raw, inday, outdir=outdir, rawdir=rawdir, qstop=qstop ; Set up the inday commmand if not keyword_set(inday) then begin inday = string((anytim2ex(addtime(!stime,del=-9*60.)))([5,4]),form='(2i2.2)') input,'* Enter the day in MMDD format', inday, inday endif else $ if datatype(inday,2) ne 7 then inday = string(inday,form='(i4.4)') ; Set up the ftp get directory: files = '*.dat' node = 'flare4' user = 'yohkoh' & passwd = 'UchinoUra' indir = '/flare4.data0/SXTffi/SA'+inday ; Set up the output directory name: if not keyword_set(outdir) then begin ; Check if the user has set up a scratch area on /scr/s1 if not file_exist('/scr/s1/'+get_user()) then $ spawn,'mkdir /scr/s1/'+get_user() outdir0 = '/scr/s1/'+get_user()+'/sa'+inday endif else outdir0 = outdir ; outdir0 is the local variable 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 ; Spawn the ftp command: ftp_copy,files,node,user,passwd,indir,/get,/binary,ftp_res=ftp_res print,ftp_res ; Report the ftp status ; Do a find file on the *.dat files: new_files = findfile(files,count=count) if count eq 0 then print,'No files copied' else begin print,'Number of *.dat files = ',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