@@ -2623,7 +2623,7 @@ def to_ws3dinv_intial(self, initial_fn, res_list=None):
2623
2623
with open (initial_fn , "w" ) as fid :
2624
2624
fid .write ("" .join (lines ))
2625
2625
2626
- self .logger .info (f"Wrote WS3DINV intial model file to: { initial_fn } " )
2626
+ self ._logger .info (f"Wrote WS3DINV intial model file to: { initial_fn } " )
2627
2627
2628
2628
return initial_fn
2629
2629
@@ -2769,17 +2769,18 @@ def from_ws3dinv(self, model_fn):
2769
2769
try :
2770
2770
lagrange = float (info [8 ])
2771
2771
except IndexError :
2772
- self .logger .warning ("Did not get Lagrange Multiplier" )
2772
+ self ._logger .warning ("Did not get Lagrange Multiplier" )
2773
+ lagrange = 1.
2773
2774
2774
2775
# get lengths of things
2775
2776
n_north , n_east , n_z , n_res = np .array (
2776
2777
mlines [1 ].strip ().split (), dtype = int
2777
2778
)
2778
2779
2779
2780
# make empty arrays to put stuff into
2780
- self .nodes_north = np .zeros (n_north )
2781
- self .nodes_east = np .zeros (n_east )
2782
- self .nodes_z = np .zeros (n_z )
2781
+ self ._nodes_north = np .zeros (n_north )
2782
+ self ._nodes_east = np .zeros (n_east )
2783
+ self .grid_z = np .zeros (n_z + 1 )
2783
2784
self .res_model = np .zeros ((n_north , n_east , n_z ))
2784
2785
2785
2786
# get the grid line locations
@@ -2788,25 +2789,30 @@ def from_ws3dinv(self, model_fn):
2788
2789
while count_n < n_north :
2789
2790
mline = mlines [line_index ].strip ().split ()
2790
2791
for north_node in mline :
2791
- self .nodes_north [count_n ] = float (north_node )
2792
+ self ._nodes_north [count_n ] = float (north_node )
2792
2793
count_n += 1
2793
2794
line_index += 1
2795
+ self .grid_north = np .insert (np .cumsum (self .nodes_north ),0 ,0 )
2794
2796
2795
2797
count_e = 0 # number of east nodes found
2796
2798
while count_e < n_east :
2797
2799
mline = mlines [line_index ].strip ().split ()
2798
2800
for east_node in mline :
2799
- self .nodes_east [count_e ] = float (east_node )
2801
+ self ._nodes_east [count_e ] = float (east_node )
2800
2802
count_e += 1
2801
2803
line_index += 1
2804
+ self .grid_east = np .insert (np .cumsum (self .nodes_east ),0 ,0 )
2802
2805
2803
2806
count_z = 0 # number of vertical nodes
2807
+ zdep = 0
2804
2808
while count_z < n_z :
2805
2809
mline = mlines [line_index ].strip ().split ()
2806
2810
for z_node in mline :
2807
- self .nodes_z [count_z ] = float ( z_node )
2811
+ self .grid_z [count_z ] = zdep
2808
2812
count_z += 1
2813
+ zdep += float (z_node )
2809
2814
line_index += 1
2815
+ self .grid_z [count_z ] = zdep
2810
2816
2811
2817
# --> get resistivity values
2812
2818
# need to read in the north backwards so that the first index is
0 commit comments