[cig-commits] [commit] master: more options for input data files for obsres.py. (924da9b)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Apr 10 03:02:50 PDT 2014


Repository : ssh://geoshell/relax

On branch  : master
Link       : https://github.com/geodynamics/relax/compare/f58c3e4a3b537ce548f0dc9b6301d68585ba7587...64bc932cf611ccf4683972590830ed18b974c6e9

>---------------------------------------------------------------

commit 924da9babd73caf2a86a6e5fcaa2eb85d620c27b
Author: Sylvain Barbot <sbarbot at ntu.edu.sg>
Date:   Sat Apr 5 15:38:40 2014 +0800

    more options for input data files for obsres.py.


>---------------------------------------------------------------

924da9babd73caf2a86a6e5fcaa2eb85d620c27b
 util/obsres.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/util/obsres.py b/util/obsres.py
index 3867d73..9cd6d54 100755
--- a/util/obsres.py
+++ b/util/obsres.py
@@ -121,9 +121,17 @@ def main():
 		    try:
 		        with open(fname) as f: pass
 		    except IOError as e:
-                        # skipping station s
-                        print >> sys.stderr, 'obsres.py: could not fine '+fname+', skipping.'
-			continue
+                        fname=ddir+'/'+s.upper()+'.dat'
+                        try:
+                            with open(fname) as f: pass
+                        except IOError as e:
+                            fname=ddir+'/'+s.lower()+'.dat'
+                            try:
+                                with open(fname) as f: pass
+                            except IOError as e:
+                                # skipping station s
+                                print >> sys.stderr, 'obsres.py: could not find '+fname+', skipping.'
+			        continue
                 f=file(fname,'r')
 		try:
                     tr,nr,er,dr,sn,se,sd=np.loadtxt(f,comments='#',unpack=True,usecols=[0,1,2,3,4,5,6])



More information about the CIG-COMMITS mailing list