Skip to content

Commit

Permalink
Update smt.py
Browse files Browse the repository at this point in the history
Updating logic for reading kwargs
  • Loading branch information
sjbrandenberg authored Dec 12, 2024
1 parent 1001a83 commit c48d316
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/ngl_tools/smt.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,18 +646,17 @@ def smt_model(depth, qt, fs, amax, m, pa=101.325, **kwargs):
gammaw = kwargs.get('gammaw', 9.81)
if('dGWT' in kwargs):
dGWT = kwargs['dGWT']
u = gammaw * (depth - dGWT)
u[u<0.0] = 0.0
if('sigmav' in kwargs):
sigmav = kwargs['sigmav']
sigmavp = kwargs['sigmavp']
if('dGWT' not in kwargs):
dGWT = depth[sigmav == sigmavp][-1]
if('sigmav' not in kwargs):
gamma = kwargs['gamma']
sigmav = gamma * depth
u = gammaw * (depth - dGWT)
u[u<0.0] = 0.0
sigmavp = sigmav - u
if('sigmav' in kwargs):
sigmav = kwargs.get('sigmav')
sigmavp = kwargs.get('sigmavp')
if('dGWT' in kwargs):
dGWT = kwargs['dGWT']
else:
dGWT = depth[sigmav == sigmavp][-1]
if('Ksat' in kwargs):
Ksat = kwargs['Ksat']
else:
Expand Down Expand Up @@ -739,18 +738,17 @@ def smt_model_fragility(depth, qt, fs, amax, m, pa=101.325, **kwargs):
gammaw = kwargs.get('gammaw', 9.81)
if('dGWT' in kwargs):
dGWT = kwargs['dGWT']
u = gammaw * (depth - dGWT)
u[u<0.0] = 0.0
if('sigmav' in kwargs):
sigmav = kwargs['sigmav']
sigmavp = kwargs['sigmavp']
if('dGWT' not in kwargs):
dGWT = depth[sigmav == sigmavp][-1]
if('sigmav' not in kwargs):
gamma = kwargs['gamma']
sigmav = gamma * depth
u = gammaw * (depth - dGWT)
u[u<0.0] = 0.0
sigmavp = sigmav - u
if('sigmav' in kwargs):
sigmav = kwargs.get('sigmav')
sigmavp = kwargs.get('sigmavp')
if('dGWT' in kwargs):
dGWT = kwargs['dGWT']
else:
dGWT = depth[sigmav == sigmavp][-1]
if('Ksat' in kwargs):
Ksat = kwargs['Ksat']
else:
Expand Down

0 comments on commit c48d316

Please sign in to comment.