Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix for 01a when "use_all_zones = True" #9

Open
pjuckem opened this issue Aug 8, 2018 · 0 comments
Open

bug fix for 01a when "use_all_zones = True" #9

pjuckem opened this issue Aug 8, 2018 · 0 comments

Comments

@pjuckem
Copy link

pjuckem commented Aug 8, 2018

Currently, notebook 01a will throw an error if "use_all_zones" is set to True. The proposed edits below should allow it to work properly:

Code block 15 ("#create grid cell dimension arrays"):
....
for group in zone_df:
if group == 'all_zones:
sat_vol = sat_vol_cell.sum()
recharge = flow_sum[0].sum()
else:
sat_vol = sat_vol_cell.ravel()[zone_df[group]].sum()
recharge = flow_sum[0, zone_df[group]].sum()
....

Code block 16 (Generate random particle placement):
....
for group in zone_df:
if weight_scheme == 'flow':
if group == 'all_zones:
weight = flow_sum[0]
else:
weight = flow_sum[0, zone_df[group]]
weight_label = 'flux'
elif weight_scheme == 'volume':
if group == 'all_zones':
weight = sat_vol_cell.ravel()
else:
weight = sat_vol_cell.ravel()[zone_df[group]]
weight_label = 'volume'

f = number_of_particles_per_group / weight.sum()
parts_per_cell = np.rint( weight * f ).astype( np.int32 )

l, r, c = np.indices(( nlay, nrow, ncol ))
if group == 'all_zones':
    l= l.ravel()
    r= r.ravel()
    c= c.ravel()
    label = zones
else:
    l= l.ravel()[zone_df[group]]
    r= r.ravel()[zone_df[group]]
    c= c.ravel()[zone_df[group]]
    label = zones[zone_df[group]]

....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant