;+ ; Project : SOHO - CDS ; ; Name : HC_UPDATE ; ; Purpose : Produce list of newly arrived FITS files. ; ; Explanation : Searches the FITS data directories and creates a list ; (sent to file 'newfits') of files which have arrived ; in the specified time interval. ; ; Use : IDL> hc_update, days ; ; Inputs : days - ie get files which have arrived in the last "days" ; days. ; ; Opt. Inputs : None ; ; Outputs : Writes result to file called 'newfits' ; ; Opt. Outputs: None ; ; Keywords : None ; ; Calls : Spawns a 'find' ; ; Common : None ; ; Restrictions: Needs write access to $CDS_HEAD_CAT ; ; Side effects: None ; ; Category : Catalogue ; ; Prev. Hist. : None ; ; Written : C D Pike, RAL, ; ; Modified : Sort in reverse order of study number. CDP, 29-Aug-97 ; Add 1998. CDP, 27-Jan-98 ; Trap case of new, but not .fits, files. CDP, 29-Jun-99 ; Rename of FITS files directory. CDP, 21-Dec-99 ; Trap mirror temporary files (.s). CDP, 25-Jun-02 ; ; Version : Version 6, 25-Jun-02 ; : JAR 12-Dec-2007. Added " -L" field to nix find command ;- pro hc_update,days ; ; delete any previous incarnations ; status = delete_file(concat_dir('CDS_HEAD_CAT','newfits')) ; ; Error return ; if n_params() eq 0 then begin print,'Give update period' return endif ; ; Launch the finds ; cdays = '-'+trim(days) newf = concat_dir('CDS_HEAD_CAT','newfits') ; ; JAR 12-Dec-2007 ; Added -L field to find command ; com = 'find -L /cdsfits/ -mtime '+cdays+' -print > '+ newf spawn,com print,'*******************************************************' print,' ' print,' Writing /cs/lrg_data/headcat/newfits file ' print,' ' print,'*******************************************************' ;com = 'find /cdsfits97/ -mtime '+cdays+' -print >> '+ newf ;spawn,com ;com = 'find /cdsfits98/ -mtime '+cdays+' -print >> '+ newf ;spawn,com ; ; eliminate the directory entry ; new = rd_ascii(concat_dir('CDS_HEAD_CAT','newfits')) n = where(strpos(new,'.fits') ge 0,count) if count gt 0 then begin new = new(n) endif else begin new = '' wrt_ascii, new, concat_dir('CDS_HEAD_CAT','newfits') return endelse ; ; eliminate any temporary FTP files ; n = where(strpos(new,'.in.') eq -1,count) if count gt 0 then new = new(n) ; ; eliminate any temporary mirror files ; n = where(strpos(new,'.s') eq -1,count) if count gt 0 then new = new(n) ; ; sort in reverse order of study number ; i = str_pick(new,'/s','r') i = fix(i) n = sort(i) n = reverse(n) new = new(n) ; ; write the result ; wrt_ascii, new, concat_dir('CDS_HEAD_CAT','newfits') end