[cleanup] removed has_spe function, using dict.get method instead!
This commit is contained in:
		
							parent
							
								
									663d244f70
								
							
						
					
					
						commit
						469d91bfdc
					
				
							
								
								
									
										6
									
								
								PyLoT.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								PyLoT.py
									
									
									
									
									
								
							| @ -76,7 +76,7 @@ from pylot.core.util.connection import checkurl | ||||
| from pylot.core.util.dataprocessing import read_metadata, restitute_data | ||||
| from pylot.core.util.utils import fnConstructor, getLogin, \ | ||||
|     full_range, readFilterInformation, trim_station_components, check4gaps, make_pen, pick_color_plt, \ | ||||
|     pick_linestyle_plt, remove_underscores, check4doubled, identifyPhaseID, excludeQualityClasses, has_spe, \ | ||||
|     pick_linestyle_plt, remove_underscores, check4doubled, identifyPhaseID, excludeQualityClasses, \ | ||||
|     check4rotated, transform_colors_mpl, transform_colors_mpl_str, getAutoFilteroptions, check_all_obspy, \ | ||||
|     check_all_pylot, real_Bool | ||||
| from pylot.core.util.event import Event | ||||
| @ -1266,7 +1266,7 @@ class MainWindow(QMainWindow): | ||||
|                         for phasename, pick in picks.items(): | ||||
|                             if not type(pick) in [dict, AttribDict]: | ||||
|                                 continue | ||||
|                             if getQualityFromUncertainty(has_spe(pick), phaseErrors[self.getPhaseID(phasename)]) < 4: | ||||
|                             if getQualityFromUncertainty(pick.get('spe'), phaseErrors[self.getPhaseID(phasename)]) < 4: | ||||
|                                 ma_count[ma] += 1 | ||||
|                             ma_count_total[ma] += 1 | ||||
| 
 | ||||
| @ -2998,7 +2998,7 @@ class MainWindow(QMainWindow): | ||||
|                         for phasename, pick in picks.items(): | ||||
|                             if not type(pick) in [dict, AttribDict]: | ||||
|                                 continue | ||||
|                             if getQualityFromUncertainty(has_spe(pick), phaseErrors[self.getPhaseID(phasename)]) < 4: | ||||
|                             if getQualityFromUncertainty(pick.get('spe'), phaseErrors[self.getPhaseID(phasename)]) < 4: | ||||
|                                 ma_count[ma] += 1 | ||||
|                             ma_count_total[ma] += 1 | ||||
| 
 | ||||
|  | ||||
| @ -1167,20 +1167,6 @@ def identifyPhaseID(phase): | ||||
|     return identifyPhase(loopIdentifyPhase(phase)) | ||||
| 
 | ||||
| 
 | ||||
| def has_spe(pick): | ||||
|     """ | ||||
|     Check for 'spe' key (symmetric picking error) in dict and return its value if found, else return None | ||||
|     :param pick: pick dictionary | ||||
|     :type pick: dict | ||||
|     :return: value of 'spe' key | ||||
|     :rtype: float or None | ||||
|     """ | ||||
|     if not 'spe' in pick.keys(): | ||||
|         return None | ||||
|     else: | ||||
|         return pick['spe'] | ||||
| 
 | ||||
| 
 | ||||
| def check_all_obspy(eventlist): | ||||
|     ev_type = 'obspydmt' | ||||
|     return check_event_folders(eventlist, ev_type) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user