Changeset 13338
- Timestamp:
- 09/12/12 10:07:34 (13 years ago)
- Location:
- issm/trunk-jpl/src/m/exp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/expread.m
r13332 r13338 46 46 %Get Icon 47 47 A=fscanf(fid,'%s %s',2); 48 if ~strncmp(A,'##Icon:', 6), break; end48 if ~strncmp(A,'##Icon:',7), break; end 49 49 50 50 %Get Info -
issm/trunk-jpl/src/m/exp/expread.py
r13332 r13338 1 1 import os.path 2 2 import numpy 3 from collections import OrderedDict 3 4 from MatlabFuncs import * 4 5 … … 38 39 39 40 #update number of profiles 40 Struct= {}41 Struct=OrderedDict() 41 42 42 43 #Get file name 43 A=fid.readline().split(None,1) 44 A=fid.readline() 45 while A=='\n': 46 A=fid.readline() 44 47 if not A: 45 48 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)): 48 51 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] 51 54 else: 52 55 Struct['name']='' … … 54 57 #Get Icon 55 58 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)): 58 60 break 59 61 60 62 #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')): 64 65 break 65 66 … … 70 71 71 72 #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')): 75 76 break 76 77
Note:
See TracChangeset
for help on using the changeset viewer.