cleanup (worker)
This commit is contained in:
		
							parent
							
								
									e341994825
								
							
						
					
					
						commit
						9996033ca5
					
				@ -1,14 +1,11 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import numpy as np
 | 
					import numpy as np
 | 
				
			||||||
from pylot.core.active import seismicshot
 | 
					from pylot.core.active import seismicshot
 | 
				
			||||||
from pylot.core.active.surveyUtils import cleanUp
 | 
					from pylot.core.active.surveyUtils import cleanUp
 | 
				
			||||||
import copy_reg
 | 
					 | 
				
			||||||
import types
 | 
					 | 
				
			||||||
from pylot.core.util.utils import worker, _pickle_method
 | 
					from pylot.core.util.utils import worker, _pickle_method
 | 
				
			||||||
 | 
					
 | 
				
			||||||
copy_reg.pickle(types.MethodType, _pickle_method)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def ppick(shot):
 | 
					def ppick(shot):
 | 
				
			||||||
    picks = []
 | 
					    picks = []
 | 
				
			||||||
    for traceID in shot.getTraceIDlist():
 | 
					    for traceID in shot.getTraceIDlist():
 | 
				
			||||||
@ -120,6 +117,15 @@ class Survey(object):
 | 
				
			|||||||
               "cutwindow = %s, tMovingWindow = %f, tsignal = %f, tgap = %f"
 | 
					               "cutwindow = %s, tMovingWindow = %f, tsignal = %f, tgap = %f"
 | 
				
			||||||
               % (cutwindow, tmovwind, tsignal, tgap))
 | 
					               % (cutwindow, tmovwind, tsignal, tgap))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def loadArray(self, path, receiverfile, sourcefile):
 | 
				
			||||||
 | 
					        from pylot.core.active.seismicArrayPreparation import SeisArray
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        array = SeisArray(os.path.join(path, receiverfile))
 | 
				
			||||||
 | 
					        array.addSourceLocations(os.path.join(path, sourcefile))
 | 
				
			||||||
 | 
					        self.seisArray = array
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
    def setManualPicksFromFiles(self, directory='picks'):
 | 
					    def setManualPicksFromFiles(self, directory='picks'):
 | 
				
			||||||
        '''
 | 
					        '''
 | 
				
			||||||
        Read manual picks from *.pck files in a directory.
 | 
					        Read manual picks from *.pck files in a directory.
 | 
				
			||||||
@ -230,6 +236,7 @@ class Survey(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        shotlist = []
 | 
					        shotlist = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        print('pickAllShots: Setting pick parameters...')
 | 
				
			||||||
        for shot in self.data.values():
 | 
					        for shot in self.data.values():
 | 
				
			||||||
            tstartpick = datetime.now()
 | 
					            tstartpick = datetime.now()
 | 
				
			||||||
            shot.setVmin(vmin)
 | 
					            shot.setVmin(vmin)
 | 
				
			||||||
@ -238,7 +245,9 @@ class Survey(object):
 | 
				
			|||||||
            shot.setPickParameters(folm = folm, method = HosAic, aicwindow = aicwindow)
 | 
					            shot.setPickParameters(folm = folm, method = HosAic, aicwindow = aicwindow)
 | 
				
			||||||
            shotlist.append(shot)
 | 
					            shotlist.append(shot)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        print('pickAllShots: Starting to pick...')
 | 
				
			||||||
        picks = worker(ppick, shotlist, cores)
 | 
					        picks = worker(ppick, shotlist, cores)
 | 
				
			||||||
 | 
					        print('Done!')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for shot in picks:
 | 
					        for shot in picks:
 | 
				
			||||||
            for item in shot:
 | 
					            for item in shot:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user