@@ -139,30 +139,9 @@ def create_config(
139
139
)
140
140
return config
141
141
else :
142
- if (
143
- self .local_mth5_path is not None
144
- and self .local_station_id is not None
145
- ):
146
- self ._initialize_kernel_dataset ()
147
- cc = ConfigCreator ()
148
- config = cc .create_from_kernel_dataset (self , ** kwargs )
149
- if self .sample_rate > 1000 :
150
- decimation_kwargs .update (
151
- self .default_window_parameters ["high" ]
152
- )
153
- else :
154
- decimation_kwargs .update (
155
- self .default_window_parameters ["low" ]
156
- )
157
- self ._set_decimation_level_parameters (
158
- config , ** decimation_kwargs
159
- )
160
- return config
161
-
162
- else :
163
- raise ValueError (
164
- "Cannot make config because KernelDataset has not been set yet."
165
- )
142
+ raise ValueError (
143
+ "Cannot make config because KernelDataset has not been set yet."
144
+ )
166
145
else :
167
146
cc = ConfigCreator ()
168
147
config = cc .create_from_kernel_dataset (kernel_dataset , ** kwargs )
@@ -203,7 +182,10 @@ def _initialize_kernel_dataset(self, sample_rate=None):
203
182
if sample_rate is not None :
204
183
run_summary = self .run_summary .set_sample_rate (sample_rate )
205
184
else :
206
- run_summary = self .run_summary .clone ()
185
+ # have to use a single sample rate otherwise an error is thrown.
186
+ run_summary = self .run_summary .set_sample_rate (
187
+ self .run_summary .df .sample_rate .unique ()[0 ]
188
+ )
207
189
208
190
self .from_run_summary (run_summary )
209
191
@@ -213,7 +195,6 @@ def create_kernel_dataset(
213
195
local_station_id = None ,
214
196
remote_station_id = None ,
215
197
sample_rate = None ,
216
- inplace = False ,
217
198
):
218
199
"""
219
200
This can be a stane alone method and return a kds, or create in place
@@ -227,14 +208,8 @@ def create_kernel_dataset(
227
208
if sample_rate is not None :
228
209
run_summary = self .run_summary .set_sample_rate (sample_rate )
229
210
230
- if inplace :
231
- self .from_run_summary (run_summary )
232
- else :
233
- kernel_dataset = KernelDataset ()
234
- kernel_dataset .from_run_summary (
235
- run_summary , local_station_id , remote_station_id
236
- )
237
- return kernel_dataset
211
+ self .from_run_summary (run_summary )
212
+ return self .clone ()
238
213
239
214
def process_single_sample_rate (
240
215
self , sample_rate , config = None , kernel_dataset = None
@@ -254,15 +229,15 @@ def process_single_sample_rate(
254
229
sample_rate = sample_rate ,
255
230
)
256
231
if config is None :
257
- config = self .create_config ()
232
+ config = self .create_config (kernel_dataset = kernel_dataset )
258
233
259
234
try :
260
235
tf_obj = process_mth5 (config , kernel_dataset )
261
236
except Exception as error :
262
237
close_open_files ()
263
238
logger .exception (error )
264
239
logger .error (f"Skipping sample_rate { sample_rate } " )
265
- return None
240
+ return
266
241
267
242
tf_obj .tf_id = self .processing_id
268
243
mt_obj = MT (survey_metadata = tf_obj .survey_metadata )
0 commit comments