[cig-commits] r17065 - seismo/3D/ADJOINT_TOMO/flexwin/scripts

liuqy at geodynamics.org liuqy at geodynamics.org
Tue Aug 3 12:30:30 PDT 2010


Author: liuqy
Date: 2010-08-03 12:30:29 -0700 (Tue, 03 Aug 2010)
New Revision: 17065

Modified:
   seismo/3D/ADJOINT_TOMO/flexwin/scripts/process_ds.py
Log:
update scripts/process_ds.py



Modified: seismo/3D/ADJOINT_TOMO/flexwin/scripts/process_ds.py
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/scripts/process_ds.py	2010-08-03 14:31:27 UTC (rev 17064)
+++ seismo/3D/ADJOINT_TOMO/flexwin/scripts/process_ds.py	2010-08-03 19:30:29 UTC (rev 17065)
@@ -8,6 +8,8 @@
 # remaining question: do we need -h for process_syn?
 # back up your raw data and synthetics before processing
 # channels may become a command-line option in the future
+# when number of matching files is large, we may face issues of
+# 'argument list too long' (especially when derivatives are includede)
 #
 # need process_data_new.pl, process_syn_new.pl, pad_zeros.pl and rotate.pl as well as sac_merge
 
@@ -191,8 +193,10 @@
         if der_syn:
           rsyn_list=rsyn_list+' '+new_syndir+'/'+os.path.basename(syn)+'.???.c'+hole_list[i]+' '
   sac_input=sac_input+'quit\n'
-  if (os.system('sac <<EOF > /dev/null\n'+sac_input+'EOF\n') != 0):
-    print 'error cutting data and synthetics'; exit()
+  f = open('sac.cmd', "w"); f.write('#!/bin/bash\nsac<<EOF\n')
+  f.write(''.join(sac_input)); f.write('EOF\n'); f.close()
+  if (os.system('chmod a+rx sac.cmd; sac.cmd') != 0):
+    print 'error cutting data and synthetics '+str(nerror); exit()
 
   # further band-pass filtering data and all syn
   print '**** band-passing data and synthetics ****'
@@ -265,7 +269,7 @@
   if (not os.path.isdir('MEASURE')):
     os.mkdir('MEASURE')
 
-os.system('rm -f data.tmp '+datadir+'/*.c '+syndir+'/*.c '+syndir+'/*.c??')
+os.system('rm -f data.tmp sac.cmd '+datadir+'/*.c '+syndir+'/*.c '+syndir+'/*.c??')
 print '**** Done ****'
 
 



More information about the CIG-COMMITS mailing list