@@ -164,7 +164,7 @@ def ImageDataWidget(TxType):
164
164
165
165
# TxType MUST be: "EM61", "TEMTADS" or "MPV"
166
166
167
- if TxType is "EM61" :
167
+ if TxType == "EM61" :
168
168
169
169
Out = interactive (
170
170
fcnImageDataWidgetEM61 ,
@@ -338,7 +338,7 @@ def ImageDataWidget(TxType):
338
338
),
339
339
)
340
340
341
- elif TxType is "TEMTADS" :
341
+ elif TxType == "TEMTADS" :
342
342
Out = interactive (
343
343
fcnImageDataWidgetTEMTADS ,
344
344
x0 = FloatSlider (
@@ -511,7 +511,7 @@ def ImageDataWidget(TxType):
511
511
),
512
512
)
513
513
514
- elif TxType is "MPV" :
514
+ elif TxType == "MPV" :
515
515
Out = interactive (
516
516
fcnImageDataWidgetMPV ,
517
517
x0 = FloatSlider (
@@ -692,7 +692,7 @@ def InversionWidget(TxType):
692
692
693
693
# TxType MUST be: "EM61", "TEMTADS" or "MPV"
694
694
695
- if TxType is "EM61" :
695
+ if TxType == "EM61" :
696
696
697
697
Out = interactive (
698
698
fcnInversionWidgetEM61 ,
@@ -906,7 +906,7 @@ def InversionWidget(TxType):
906
906
),
907
907
)
908
908
909
- elif TxType is "TEMTADS" :
909
+ elif TxType == "TEMTADS" :
910
910
911
911
Out = interactive (
912
912
fcnInversionWidgetTEMTADS ,
@@ -1120,7 +1120,7 @@ def InversionWidget(TxType):
1120
1120
),
1121
1121
)
1122
1122
1123
- elif TxType is "MPV" :
1123
+ elif TxType == "MPV" :
1124
1124
1125
1125
Out = interactive (
1126
1126
fcnInversionWidgetMPV ,
@@ -1887,22 +1887,22 @@ def fcnImageDataWidgetMPV(
1887
1887
# Anomaly
1888
1888
titlestr1 = "Anomaly at t = " + "{:.3e}" .format (uxoObj .times [tn - 1 ]) + " s"
1889
1889
1890
- if dComp is "X" :
1890
+ if dComp == "X" :
1891
1891
k = 0
1892
- elif dComp is "Y" :
1892
+ elif dComp == "Y" :
1893
1893
k = 1
1894
- elif dComp is "Z" :
1894
+ elif dComp == "Z" :
1895
1895
k = 2
1896
1896
1897
1897
di = 1e6 * np .reshape (data [6 + k : 15 * N ** 2 : 15 , tn - 1 ], (N , N ))
1898
1898
Cplot = ax1 .contourf (X , Y , di .T , 40 , cmap = "viridis" )
1899
1899
cbar = plt .colorbar (Cplot , ax = ax1 , pad = 0.02 )
1900
1900
1901
- if dComp is "X" :
1901
+ if dComp == "X" :
1902
1902
cbar .set_label ("dBx/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
1903
- elif dComp is "Y" :
1903
+ elif dComp == "Y" :
1904
1904
cbar .set_label ("dBy/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
1905
- elif dComp is "Z" :
1905
+ elif dComp == "Z" :
1906
1906
cbar .set_label ("dBz/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
1907
1907
cbar .ax .tick_params (labelsize = FS - 2 )
1908
1908
@@ -2026,12 +2026,12 @@ def fcnInversionWidgetEM61(
2026
2026
2027
2027
# PREDICT TRUE DATA
2028
2028
uxoObj2 = EM61problem (rt , phi , L , times , I )
2029
- if Nx is 1 :
2029
+ if Nx == 1 :
2030
2030
Xn = 0.0
2031
2031
else :
2032
2032
Xn = np .linspace (- Dx / 2 , Dx / 2 , Nx )
2033
2033
2034
- if Ny is 1 :
2034
+ if Ny == 1 :
2035
2035
Yn = 0.0
2036
2036
else :
2037
2037
Yn = np .linspace (- Dy / 2 , Dy / 2 , Ny )
@@ -2059,7 +2059,7 @@ def fcnInversionWidgetEM61(
2059
2059
COUNT = 0
2060
2060
m_vec = [Misfit ]
2061
2061
2062
- while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT is 0 :
2062
+ while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT == 0 :
2063
2063
2064
2064
MisPrev = Misfit
2065
2065
@@ -2164,7 +2164,7 @@ def fcnInversionWidgetEM61(
2164
2164
+ ")"
2165
2165
)
2166
2166
fm_str = "Final Misfit = " + "{:.2f}" .format (m_vec [- 1 ])
2167
- if COUNT is 1 :
2167
+ if COUNT == 1 :
2168
2168
ax21 .text (0.1 , 0.92 * m_vec [0 ], rt_str , fontsize = FS )
2169
2169
ax21 .text (0.1 , 0.83 * m_vec [0 ], rn_str , fontsize = FS )
2170
2170
ax21 .text (0.1 , 0.74 * m_vec [0 ], fm_str , fontsize = FS )
@@ -2267,12 +2267,12 @@ def fcnInversionWidgetTEMTADS(
2267
2267
2268
2268
# PREDICT TRUE DATA
2269
2269
uxoObj2 = TEMTADSproblem (rt , phi , L , times , I )
2270
- if Nx is 1 :
2270
+ if Nx == 1 :
2271
2271
Xn = 0.0
2272
2272
else :
2273
2273
Xn = np .linspace (- Dx / 2 , Dx / 2 , Nx )
2274
2274
2275
- if Ny is 1 :
2275
+ if Ny == 1 :
2276
2276
Yn = 0.0
2277
2277
else :
2278
2278
Yn = np .linspace (- Dy / 2 , Dy / 2 , Ny )
@@ -2299,7 +2299,7 @@ def fcnInversionWidgetTEMTADS(
2299
2299
COUNT = 0
2300
2300
m_vec = [Misfit ]
2301
2301
2302
- while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT is 0 :
2302
+ while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT == 0 :
2303
2303
2304
2304
MisPrev = Misfit
2305
2305
@@ -2402,7 +2402,7 @@ def fcnInversionWidgetTEMTADS(
2402
2402
+ ")"
2403
2403
)
2404
2404
fm_str = "Final Misfit = " + "{:.2f}" .format (m_vec [- 1 ])
2405
- if COUNT is 1 :
2405
+ if COUNT == 1 :
2406
2406
ax21 .text (0.1 , 0.92 * m_vec [0 ], rt_str , fontsize = FS )
2407
2407
ax21 .text (0.1 , 0.83 * m_vec [0 ], rn_str , fontsize = FS )
2408
2408
ax21 .text (0.1 , 0.74 * m_vec [0 ], fm_str , fontsize = FS )
@@ -2506,12 +2506,12 @@ def fcnInversionWidgetMPV(
2506
2506
2507
2507
# PREDICT TRUE DATA
2508
2508
uxoObj2 = MPVproblem (rt , phi , L , times , I )
2509
- if Nx is 1 :
2509
+ if Nx == 1 :
2510
2510
Xn = 0.0
2511
2511
else :
2512
2512
Xn = np .linspace (- Dx / 2 , Dx / 2 , Nx )
2513
2513
2514
- if Ny is 1 :
2514
+ if Ny == 1 :
2515
2515
Yn = 0.0
2516
2516
else :
2517
2517
Yn = np .linspace (- Dy / 2 , Dy / 2 , Ny )
@@ -2540,7 +2540,7 @@ def fcnInversionWidgetMPV(
2540
2540
COUNT = 0
2541
2541
m_vec = [Misfit ]
2542
2542
2543
- while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT is 0 :
2543
+ while Misfit > 1.001 and COUNT < 100 and dMis > 1e-5 or COUNT == 0 :
2544
2544
2545
2545
MisPrev = Misfit
2546
2546
@@ -2579,11 +2579,11 @@ def fcnInversionWidgetMPV(
2579
2579
ax22 = fig .add_axes ([0.5 , 0.0 , 0.4 , 0.45 ])
2580
2580
FS = 18
2581
2581
2582
- if dComp is "X" :
2582
+ if dComp == "X" :
2583
2583
k = 0
2584
- elif dComp is "Y" :
2584
+ elif dComp == "Y" :
2585
2585
k = 1
2586
- elif dComp is "Z" :
2586
+ elif dComp == "Z" :
2587
2587
k = 2
2588
2588
2589
2589
# True Anomaly
@@ -2592,11 +2592,11 @@ def fcnInversionWidgetMPV(
2592
2592
) # 1e6 for uV
2593
2593
Cplot1 = ax11 .contourf (X1 , Y1 , d11 .T , 40 , cmap = "viridis" )
2594
2594
cbar1 = plt .colorbar (Cplot1 , ax = ax11 , pad = 0.02 , format = "%.2e" )
2595
- if dComp is "X" :
2595
+ if dComp == "X" :
2596
2596
cbar1 .set_label ("dBx/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2597
- elif dComp is "Y" :
2597
+ elif dComp == "Y" :
2598
2598
cbar1 .set_label ("dBy/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2599
- elif dComp is "Z" :
2599
+ elif dComp == "Z" :
2600
2600
cbar1 .set_label ("dBz/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2601
2601
cbar1 .ax .tick_params (labelsize = FS - 2 )
2602
2602
@@ -2617,11 +2617,11 @@ def fcnInversionWidgetMPV(
2617
2617
) # 1e6 for uV
2618
2618
Cplot2 = ax12 .contourf (X1 , Y1 , d12 .T , 40 , cmap = "viridis" )
2619
2619
cbar2 = plt .colorbar (Cplot2 , ax = ax12 , pad = 0.02 , format = "%.2e" )
2620
- if dComp is "X" :
2620
+ if dComp == "X" :
2621
2621
cbar2 .set_label ("dBx/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2622
- elif dComp is "Y" :
2622
+ elif dComp == "Y" :
2623
2623
cbar2 .set_label ("dBy/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2624
- elif dComp is "Z" :
2624
+ elif dComp == "Z" :
2625
2625
cbar2 .set_label ("dBz/dt [$\mu$V]" , rotation = 270 , labelpad = 25 , size = FS )
2626
2626
cbar2 .ax .tick_params (labelsize = FS - 2 )
2627
2627
@@ -2664,7 +2664,7 @@ def fcnInversionWidgetMPV(
2664
2664
+ ")"
2665
2665
)
2666
2666
fm_str = "Final Misfit = " + "{:.2f}" .format (m_vec [- 1 ])
2667
- if COUNT is 1 :
2667
+ if COUNT == 1 :
2668
2668
ax21 .text (0.1 , 0.92 * m_vec [0 ], rt_str , fontsize = FS )
2669
2669
ax21 .text (0.1 , 0.83 * m_vec [0 ], rn_str , fontsize = FS )
2670
2670
ax21 .text (0.1 , 0.74 * m_vec [0 ], fm_str , fontsize = FS )
@@ -2788,9 +2788,9 @@ def computePolarVecs(self, karg=False):
2788
2788
2789
2789
if karg is False :
2790
2790
A = self .computeRotMatrix ()
2791
- elif np .size (karg ) is 3 :
2791
+ elif np .size (karg ) == 3 :
2792
2792
A = self .computeRotMatrix (karg )
2793
- elif np .size (karg ) is 9 :
2793
+ elif np .size (karg ) == 9 :
2794
2794
A = karg
2795
2795
2796
2796
q = np .zeros ((6 , N ))
@@ -3794,7 +3794,7 @@ def get_dobs_dunc(self, dpre, FloorVal, Pct):
3794
3794
3795
3795
Floor = FloorVal * np .max (np .abs (dpre )) * np .ones (np .shape (dpre ))
3796
3796
3797
- if len (Pct ) is 1 :
3797
+ if len (Pct ) == 1 :
3798
3798
dunc = Floor + Pct * np .abs (dpre )
3799
3799
else :
3800
3800
dunc = Floor
0 commit comments