示例#1
0
def _to_tfrecord(batch):
    example_list = []
    for example in batch:
        feature = Feature(example)
        feature.get_picks('p', 'predict')
        feature = feature.to_feature()
        example_list.append(feature_to_example(feature))
    return example_list
示例#2
0
def _write_picked_stream(batch_picks, pick_list, pick_time_key, geom, pickset):
    example_list = []
    for pick in batch_picks:
        if not pick.phase_hint in ['P']:
            continue
        window = get_window(pick)
        streams = read_sds(window)

        for _, stream in streams.items():
            stream = stream_preprocessing(stream, pick_list, pick_time_key, geom)
            feature = stream_to_feature(stream, pickset)
            example = feature_to_example(feature)
            example_list.append(example)
    return example_list
示例#3
0
 def to_tfrecord(self, file_path):
     feature = self.to_feature()
     example = feature_to_example(feature)
     write_tfrecord([example], file_path)
示例#4
0
 def to_example(self):
     feature = self.to_feature()
     example = feature_to_example(feature)
     return example