pro RunXuePusCode, obs @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; RunXuePusCode ; ; PURPOSE: ; Read a file that lists a set of Nick's WSO files. ; Reformat those files, run X's code on them, ; and put the results in the right place. (xwso) ; ; MODIFICATION HISTORY: ; Jun 2002 (tjd, tdunn@ucsd.edu) ; Spt 2002 (tjd, tdunn@ucsd.edu) removed the intermediary ; printing of files to /xwso/sync, which formerly ; worked as a checking procedure, ; and is now commented out. ; Made code flexible to changes in $dat dir. ;- InitVar, obs, 'wso' ;observatory (wso, mdi, KPNO) ;only WSO currently supported ;for file conversions ARRAY = FLTARR(20,1) ;array to hold list of files ghfcsss = filepath(root=getenv('TUB'),'ghf.txt') ;spherical harmonic expansion coeff, ;trash after use FILE = filepath(root=getenv('TUB'),'maglist.forx.txt') ;name of master file containing ; the list of files to modify ;(awkwardness so linux/win compat. ;note IDL openw very sensitive) OPENR,UNIT,file,/GET_LUN PRINT, 'runxuepuscode - reading master file: ',FILE LINE = '' WHILE(NOT EOF(UNIT)) DO BEGIN READF, UNIT, LINE PRINT, 'read line: ', LINE SetFileSpec, LINE NewLine = GetFileSpec(upto='dir') NewFile = GetFileSpec(from='name') Print, 'Now cranking on ', NewFile, ' from ', NewLine PRINT, 'Reading DATA from', LINE DATA = mapreadwsodaily(LINE) ;write the data in the desired format and put it in xwso fullnewf = filepath(root=getenv('DAT'),subdir=['map','xwso'],NewFile) print, 'writing data to ', fullnewf mapwritewsodaily, fullnewf, DATA, 1 scbf = fullnewf ;source file for x's code (already placed in xwso directory) ;run X's code to generate the desired SS brfrss = fullnewf ;br file (output replaces input in xwso dir) print, 'Bss placed in: ',brfrss brss_csss_scbf_tjd,scbf,obs,ghfcsss,brfrss ENDWHILE CLOSE,UNIT FREE_LUN,UNIT return & end