Changeset 17696
- Timestamp:
- 04/09/14 16:33:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/plot/processdata.py ¶
r17618 r17696 29 29 numberofelements2d=npy.nan 30 30 31 procdata=npy.copy(data) 32 31 33 #process patch 32 34 … … 35 37 36 38 #get datasize 37 if npy.ndim( data)==1:38 datasize=npy.array([len( data),1])39 if npy.ndim(procdata)==1: 40 datasize=npy.array([len(procdata),1]) 39 41 else: 40 datasize=npy.shape( data)42 datasize=npy.shape(procdata) 41 43 42 44 #process NaN's if any 43 nanfill=options.getfieldvalue('nan',-999 )44 if npy.any(npy.isnan( data)):45 data[npy.isnan(data)]=nanfill46 print "WARNING: nan's treated as -999 by default. Change using pairoption 'nan',nan_fill_value in plotmodel call"45 nanfill=options.getfieldvalue('nan',-9999) 46 if npy.any(npy.isnan(procdata)): 47 procdata[npy.isnan(procdata)]=nanfill 48 print "WARNING: nan's treated as -9999 by default. Change using pairoption 'nan',nan_fill_value in plotmodel call" 47 49 48 50 #non-patch processing … … 72 74 73 75 #convert rank-2 array to rank-1 74 if npy.ndim( data)==2 and npy.shape(data)[1]==1:75 data=data.reshape(-1,)76 if npy.ndim(procdata)==2 and npy.shape(procdata)[1]==1: 77 procdata=procdata.reshape(-1,) 76 78 77 79 #if datatype is still zero, error out … … 79 81 raise ValueError("processdata error: data provided not recognized or not supported") 80 82 else: 81 return data, datatype83 return procdata, datatype
Note:
See TracChangeset
for help on using the changeset viewer.