Changeset 13338


Ignore:
Timestamp:
09/12/12 10:07:34 (13 years ago)
Author:
jschierm
Message:

CHG: Revision for python.

Location:
issm/trunk-jpl/src/m/exp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/exp/expread.m

    r13332 r13338  
    4646        %Get Icon
    4747        A=fscanf(fid,'%s %s',2);
    48         if ~strncmp(A,'##Icon:',6), break; end
     48        if ~strncmp(A,'##Icon:',7), break; end
    4949
    5050        %Get Info
  • issm/trunk-jpl/src/m/exp/expread.py

    r13332 r13338  
    11import os.path
    22import numpy
     3from collections import OrderedDict
    34from MatlabFuncs import *
    45
     
    3839
    3940                #update number of profiles
    40                 Struct={}
     41                Struct=OrderedDict()
    4142
    4243                #Get file name
    43                 A=fid.readline().split(None,1)
     44                A=fid.readline()
     45                while A=='\n':
     46                        A=fid.readline()
    4447                if not A:
    4548                        break
    46                 A=A[0]+A[1]
    47                 if not strncmp(A,'##Name:',7):
     49                A=A.split(None,1)
     50                if not (len(A) == 2 and strcmp(A[0],'##') and strncmp(A[1],'Name:',5)):
    4851                        break
    49                 if len(A)>7:
    50                         Struct['name']=A[7:-1]
     52                if len(A[1])>5:
     53                        Struct['name']=A[1][5:-1]
    5154                else:
    5255                        Struct['name']=''
     
    5457                #Get Icon
    5558                A=fid.readline().split(None,1)
    56                 A=A[0]+A[1]
    57                 if not strncmp(A,'##Icon:',6):
     59                if not (len(A) == 2 and strcmp(A[0],'##') and strncmp(A[1],'Icon:',5)):
    5860                        break
    5961
    6062                #Get Info
    61                 A=fid.readline().split(None,3)
    62                 A=A[0]+A[1]+A[2]+A[3]
    63                 if not strncmp(A,'#Points',7):
     63                A=fid.readline().split()
     64                if not (len(A) == 4 and strcmp(A[0],'#') and strcmp(A[1],'Points')):
    6465                        break
    6566
     
    7071
    7172                #Get Info
    72                 A=fid.readline().split(None,4)
    73                 A=A[0]+A[1]+A[2]+A[3]+A[4]
    74                 if not strncmp(A,'#XposYpos',9):
     73                A=fid.readline().split()
     74                if not (len(A) == 5 and strcmp(A[0],'#') and strcmp(A[1],'X') and strcmp(A[2],'pos') \
     75                                                         and strcmp(A[3],'Y') and strcmp(A[4],'pos')):
    7576                        break
    7677
Note: See TracChangeset for help on using the changeset viewer.