Bug workaround: sometimes rotate2zne fails resulting in an permanent
error
This commit is contained in:
		
							parent
							
								
									9486d7aced
								
							
						
					
					
						commit
						7023bc4ce4
					
				| @ -960,6 +960,7 @@ def check4rotated(data, metadata=None, verbosity=1): | |||||||
|                 return wfstream |                 return wfstream | ||||||
|             # to rotate all traces must have same length, so trim them |             # to rotate all traces must have same length, so trim them | ||||||
|             wfstream = trim_station_components(wfstream, trim_start=True, trim_end=True) |             wfstream = trim_station_components(wfstream, trim_start=True, trim_end=True) | ||||||
|  |             try: | ||||||
|                 z, n, e = rotate2zne(wfstream[0], azimuts[0], dips[0], |                 z, n, e = rotate2zne(wfstream[0], azimuts[0], dips[0], | ||||||
|                                      wfstream[1], azimuts[1], dips[1], |                                      wfstream[1], azimuts[1], dips[1], | ||||||
|                                      wfstream[2], azimuts[2], dips[2]) |                                      wfstream[2], azimuts[2], dips[2]) | ||||||
| @ -980,6 +981,10 @@ def check4rotated(data, metadata=None, verbosity=1): | |||||||
|                     elif az > 45 and az <= 135 or az > 225 and az <= 315: |                     elif az > 45 and az <= 135 or az > 225 and az <= 315: | ||||||
|                         trace.data = e |                         trace.data = e | ||||||
|                         trace.stats.channel = trace.stats.channel[0:-1] + 'E' |                         trace.stats.channel = trace.stats.channel[0:-1] + 'E' | ||||||
|  |             except (ValueError) as e: | ||||||
|  |                 print(e) | ||||||
|  |                 return wfstream | ||||||
|  | 
 | ||||||
|         return wfstream |         return wfstream | ||||||
| 
 | 
 | ||||||
|     if metadata is None: |     if metadata is None: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user