@@ -572,8 +572,7 @@ def make_mesh(self, verbose=True):
572
572
for s_north in sorted (self .station_locations .model_north ):
573
573
try :
574
574
node_index = np .where (
575
- abs (s_north - self .grid_north )
576
- < 0.02 * self .cell_size_north
575
+ abs (s_north - self .grid_north ) < 0.02 * self .cell_size_north
577
576
)[0 ][0 ]
578
577
if s_north - self .grid_north [node_index ] > 0 :
579
578
self .grid_north [node_index ] -= 0.02 * self .cell_size_north
@@ -585,7 +584,7 @@ def make_mesh(self, verbose=True):
585
584
if self .z_mesh_method == "custom" :
586
585
if self .grid_z is None :
587
586
self .z_mesh_method = "default"
588
- self ._logger .warn (
587
+ self ._logger .warning (
589
588
"No grid_z provided, creating new z mesh using default method"
590
589
)
591
590
@@ -602,9 +601,7 @@ def make_mesh(self, verbose=True):
602
601
)
603
602
604
603
# compute grid center
605
- center_east = np .round (
606
- self .grid_east .min () - self .grid_east .mean (), - 1
607
- )
604
+ center_east = np .round (self .grid_east .min () - self .grid_east .mean (), - 1 )
608
605
center_north = np .round (
609
606
self .grid_north .min () - self .grid_north .mean (), - 1
610
607
)
@@ -692,7 +689,7 @@ def add_layers_to_mesh(
692
689
layer_thickness = layer_thickness [- 1 ]
693
690
694
691
if n_add_layers != len (add_layers ):
695
- self ._logger .warn (
692
+ self ._logger .warning (
696
693
"Updating number of layers to reflect the length of the layer thickness array"
697
694
)
698
695
n_add_layers = len (add_layers )
@@ -826,8 +823,7 @@ def to_modem(self, model_fn=None, **kwargs):
826
823
if self .res_scale .lower () == "loge" :
827
824
write_res_model = np .log (self .res_model [::- 1 , :, :])
828
825
elif (
829
- self .res_scale .lower () == "log"
830
- or self .res_scale .lower () == "log10"
826
+ self .res_scale .lower () == "log" or self .res_scale .lower () == "log10"
831
827
):
832
828
write_res_model = np .log10 (self .res_model [::- 1 , :, :])
833
829
elif self .res_scale .lower () == "linear" :
@@ -945,9 +941,7 @@ def from_modem(self, model_fn=None):
945
941
self .nodes_east = np .array (
946
942
[float (nn ) for nn in ilines [3 ].strip ().split ()]
947
943
)
948
- self .nodes_z = np .array (
949
- [float (nn ) for nn in ilines [4 ].strip ().split ()]
950
- )
944
+ self .nodes_z = np .array ([float (nn ) for nn in ilines [4 ].strip ().split ()])
951
945
952
946
self .res_model = np .zeros ((n_north , n_east , n_z ))
953
947
@@ -1631,10 +1625,10 @@ def add_topography_to_model(
1631
1625
)
1632
1626
1633
1627
if self .n_air_layers is None or self .n_air_layers == 0 :
1634
- self ._logger .warn (
1628
+ self ._logger .warning (
1635
1629
"No air layers specified, so will not add air/topography !!!"
1636
1630
)
1637
- self ._logger .warn (
1631
+ self ._logger .warning (
1638
1632
"Only bathymetry will be added below according to the topofile: sea-water low resistivity!!!"
1639
1633
)
1640
1634
@@ -1679,9 +1673,7 @@ def add_topography_to_model(
1679
1673
# adjust level to topography min
1680
1674
if max_elev is not None :
1681
1675
self .grid_z -= max_elev
1682
- ztops = np .where (
1683
- self .surface_dict ["topography" ] > max_elev
1684
- )
1676
+ ztops = np .where (self .surface_dict ["topography" ] > max_elev )
1685
1677
self .surface_dict ["topography" ][ztops ] = max_elev
1686
1678
else :
1687
1679
self .grid_z -= topo_core .max ()
@@ -2770,7 +2762,7 @@ def from_ws3dinv(self, model_fn):
2770
2762
lagrange = float (info [8 ])
2771
2763
except IndexError :
2772
2764
self ._logger .warning ("Did not get Lagrange Multiplier" )
2773
- lagrange = 1.
2765
+ lagrange = 1.0
2774
2766
2775
2767
# get lengths of things
2776
2768
n_north , n_east , n_z , n_res = np .array (
@@ -2792,7 +2784,7 @@ def from_ws3dinv(self, model_fn):
2792
2784
self ._nodes_north [count_n ] = float (north_node )
2793
2785
count_n += 1
2794
2786
line_index += 1
2795
- self .grid_north = np .insert (np .cumsum (self .nodes_north ),0 , 0 )
2787
+ self .grid_north = np .insert (np .cumsum (self .nodes_north ), 0 , 0 )
2796
2788
2797
2789
count_e = 0 # number of east nodes found
2798
2790
while count_e < n_east :
@@ -2801,7 +2793,7 @@ def from_ws3dinv(self, model_fn):
2801
2793
self ._nodes_east [count_e ] = float (east_node )
2802
2794
count_e += 1
2803
2795
line_index += 1
2804
- self .grid_east = np .insert (np .cumsum (self .nodes_east ),0 , 0 )
2796
+ self .grid_east = np .insert (np .cumsum (self .nodes_east ), 0 , 0 )
2805
2797
2806
2798
count_z = 0 # number of vertical nodes
2807
2799
zdep = 0
0 commit comments