@@ -94,6 +94,10 @@ def __init__(self, startingpoint, meta={}) :
94
94
if 'data_type' in self .meta :
95
95
self .properties = self .meta ['data_type' ]
96
96
97
+ if 'skip' in self .meta :
98
+ self .skip = self .meta ['skip' ]
99
+ else :
100
+ self .skip = None ;
97
101
98
102
## Private holding place for returned Vp data.
99
103
self .vplist = []
@@ -111,6 +115,9 @@ def __init__(self, startingpoint, meta={}) :
111
115
else :
112
116
self .threshold = None
113
117
118
+ self .ucvm = UCVM (install_dir = self .installdir , config_file = self .configfile , z_range = self .z_range ,floors = self .floors )
119
+
120
+
114
121
##
115
122
# Generates the elevation profile in a format that is ready to plot.
116
123
def getplotvals (self ) :
@@ -129,17 +136,17 @@ def getplotvals(self) :
129
136
point_list .append (Point (self .startingpoint .longitude , self .startingpoint .latitude , elevation = i ))
130
137
self .meta ['elevation' ].append (i )
131
138
132
- u = UCVM ( install_dir = self .installdir , config_file = self . configfile , z_range = self . z_range , floors = self . floors )
139
+ ucvm = self .ucvm
133
140
134
141
###MEI
135
142
if (self .datafile != None ) :
136
143
print ("\n Using --> " + self .datafile )
137
- data = u .import_matprops (self .datafile )
144
+ data = ucvm .import_matprops (self .datafile )
138
145
if len (data ) == 0 :
139
146
print ("ERROR: no matprops plot data." )
140
147
exit (1 )
141
148
else :
142
- data = u .query (point_list , self .cvm , elevation = 1 )
149
+ data = ucvm .query (point_list , self .cvm , elevation = 1 )
143
150
144
151
tmp = []
145
152
for matprop in data :
@@ -153,8 +160,8 @@ def getplotvals(self) :
153
160
154
161
if (self .datafile == None ) :
155
162
blob = { 'matprops' : tmp }
156
- u .export_matprops (blob ,self .filename )
157
- u .export_metadata (self .meta ,self .filename )
163
+ ucvm .export_matprops (blob ,self .filename )
164
+ ucvm .export_metadata (self .meta ,self .filename )
158
165
159
166
##
160
167
# Adds the elevation profile to a pre-existing plot.
@@ -265,7 +272,13 @@ def addtoplot(self, plot, colors=None, customlabels=None) :
265
272
##
266
273
# Plots a new elevation profile using all the default plotting options.
267
274
#
268
- def plot (self ) :
275
+ def plot (self ):
276
+ if self .skip :
277
+ self ._file ()
278
+ else :
279
+ self ._plot_file ()
280
+
281
+ def _plot_file (self ):
269
282
270
283
if self .startingpoint .description == None :
271
284
location_text = ""
@@ -293,3 +306,8 @@ def plot(self) :
293
306
plt .show ()
294
307
else :
295
308
plt .savefig (self .filename )
309
+
310
+ def _file (self ):
311
+
312
+ # Get the material properties.
313
+ self .getplotvals ()
0 commit comments