;+ ; NAME: ; smei_mkdrives ; PURPOSE: ; Rewrites the file smei_drives.txt ; CATEGORY: ; camera/idl/frm ; CALLING SEQUENCE: PRO smei_mkdrives ; INPUTS: ; OPTIONAL INPUT PARAMETERS: ; OUTPUTS: ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; EXTERNAL: ; CALLS: ; FindAllSubdirs, hide_env, who_am_i ; TimeSet, TimeGet, TimeOp, TimeUnit ; PROCEDURE: ; MODIFICATION HISTORY: ; JUL-2007, G. Megally, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- ;Initializes the file with comments out = $ ['; File used by smei_filepath to locate SMEI frames across multiple' , $ '; hard drives.' , $ '; Col 1: is combined with "SMEIDB" to make an env var "SMEIDB1", etc.' , $ '; Col 2-3: year and day of year of first data' , $ '; Col 4-5: year and day of year of last data' , $ '; Usually the end time for one drive is identical to the start time for the', $ '; next one.' , $ ''] machines = ['','zorro','zelda','zulu ','ziggy','sid ', 'sun '] idb = 1 cdb = getenv('SMEIDB'+strcompress(idb,/rem)) WHILE cdb NE '' DO BEGIN message, /info, hide_env(cdb) tt = FindAllSubdirs(cdb,count=count) IF count NE 0 THEN BEGIN tt = strmid(tt,strlen(cdb)+1,strlen('YYYY_DOY')) ii = sort(tt) tt = tt[ii[[0,n_elements(tt)-1]]] tt = TimeSet(tt) tt[1] = TimeOp(/add,tt[1],TimeSet(1,TimeUnit(/day))) tt = TimeGet(tt,format='YYYY DOY') cdb = getenv('SMEIDB'+strcompress(idb+1,/rem)) IF cdb NE '' THEN cdb = (file_search(cdb))[0] IF cdb EQ '' THEN tt[1] = '2008 001' tt = [string(idb,format='(I2.2)'),tt,machines[idb]] out = [out,strjoin(tt,' ')] ENDIF idb += 1 cdb = getenv('SMEIDB'+strcompress(idb,/rem)) ENDWHILE print FOR i=0,n_elements(out)-1 DO print, out[i] print print file = filepath(root=who_am_i(/dir),'smei_drives.txt') message, /info, 'write '+hide_env(file) openw, /get_lun, iu, file FOR i=0,n_elements(out)-1 DO printf, iu, out[i] free_lun, iu RETURN & END