[Bugfix] No network magnitude available for screen output while tuning
This commit is contained in:
		
							parent
							
								
									d2ba8888d1
								
							
						
					
					
						commit
						854f5b8c7e
					
				@ -346,6 +346,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
 | 
				
			|||||||
                            picks[stats]['P'].update(props)
 | 
					                            picks[stats]['P'].update(props)
 | 
				
			||||||
                        evt = moment_mag.updated_event()
 | 
					                        evt = moment_mag.updated_event()
 | 
				
			||||||
                        net_mw = moment_mag.net_magnitude()
 | 
					                        net_mw = moment_mag.net_magnitude()
 | 
				
			||||||
 | 
					                        if net_mw is not None:
 | 
				
			||||||
                            print("Network moment magnitude: %4.1f" % net_mw.mag)
 | 
					                            print("Network moment magnitude: %4.1f" % net_mw.mag)
 | 
				
			||||||
                        # calculate local (Richter) magntiude
 | 
					                        # calculate local (Richter) magntiude
 | 
				
			||||||
                        WAscaling = parameter.get('WAscaling')
 | 
					                        WAscaling = parameter.get('WAscaling')
 | 
				
			||||||
@ -363,6 +364,13 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
 | 
				
			|||||||
                        evt = local_mag.updated_event(magscaling)
 | 
					                        evt = local_mag.updated_event(magscaling)
 | 
				
			||||||
                        net_ml = local_mag.net_magnitude(magscaling)
 | 
					                        net_ml = local_mag.net_magnitude(magscaling)
 | 
				
			||||||
                        print("Network local magnitude: %4.1f" % net_ml.mag)
 | 
					                        print("Network local magnitude: %4.1f" % net_ml.mag)
 | 
				
			||||||
 | 
					                        if magscaling == None:
 | 
				
			||||||
 | 
					                            scaling = False
 | 
				
			||||||
 | 
					                        elif magscaling[0] != 0 and magscaling[1] != 0:
 | 
				
			||||||
 | 
					                            scaling = False
 | 
				
			||||||
 | 
					                        else:
 | 
				
			||||||
 | 
					                            scaling = True
 | 
				
			||||||
 | 
					                        if scaling:
 | 
				
			||||||
                            print("Network local magnitude scaled with:")
 | 
					                            print("Network local magnitude scaled with:")
 | 
				
			||||||
                            print("%f * Ml + %f" % (magscaling[0], magscaling[1]))
 | 
					                            print("%f * Ml + %f" % (magscaling[0], magscaling[1]))
 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
@ -421,6 +429,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
 | 
				
			|||||||
                                    picks[stats]['P'].update(props)
 | 
					                                    picks[stats]['P'].update(props)
 | 
				
			||||||
                            evt = moment_mag.updated_event()
 | 
					                            evt = moment_mag.updated_event()
 | 
				
			||||||
                            net_mw = moment_mag.net_magnitude()
 | 
					                            net_mw = moment_mag.net_magnitude()
 | 
				
			||||||
 | 
					                            if net_mw is not None:
 | 
				
			||||||
                                print("Network moment magnitude: %4.1f" % net_mw.mag)
 | 
					                                print("Network moment magnitude: %4.1f" % net_mw.mag)
 | 
				
			||||||
                            # calculate local (Richter) magntiude
 | 
					                            # calculate local (Richter) magntiude
 | 
				
			||||||
                            WAscaling = parameter.get('WAscaling')
 | 
					                            WAscaling = parameter.get('WAscaling')
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user