@@ -23,7 +23,6 @@ def _pcolormesh(grid, da, ax):
2323
2424 collection = PolyCollection (vertices )
2525 collection .set_array (da .to_numpy ().ravel ())
26- # collection._scale_norm(norm, vmin, vmax)
2726 p = ax .add_collection (collection , autolim = False )
2827
2928 xmin , xmax , ymin , ymax = grid .extent
@@ -35,23 +34,24 @@ def _pcolormesh(grid, da, ax):
3534 return p
3635
3736
38- # open budget file
37+ # create budget reader
3938bpth = os .path .join (ws , f"{ modelname } .bud" )
4039bobj = flopy .utils .CellBudgetFile (bpth , precision = "double" )
4140
4241# set specific discharge
4342spdis = bobj .get_data (text = "DATA-SPDIS" )[0 ]
4443
45- # open head file
44+ # create head reader
4645hpth = os .path .join (ws , f"{ modelname } .hds" )
4746hobj = flopy .utils .HeadFile (hpth , precision = "double" )
4847
4948# set heads
5049heads = hobj .get_alldata ()
5150
52- # open grb file
51+ # create grb reader
5352grbpth = os .path .join (ws , f"{ modelname } .dis.grb" )
5453grbobj = flopy .mf6 .utils .MfGrdFile (grbpth )
54+ grid = None
5555
5656# flow vector component arrays
5757uflow = None
@@ -94,7 +94,7 @@ def _pcolormesh(grid, da, ax):
9494cbar = plt .colorbar (label = da .name )
9595plt .contour (xcrs , ycrs , qz , 4 , cmap = "viridis" )
9696# plt.contourf(xcrs, ycrs, qz, 5, cmap='viridis', alpha=0.4)
97- qs_pth = os .path .join (QS_ROOT , "qs.png" )
97+ qs_pth = os .path .join (QS_ROOT , "image" , " qs.png" )
9898fig .savefig (qs_pth )
9999
100100# projection example with cartopy
@@ -103,7 +103,9 @@ def _pcolormesh(grid, da, ax):
103103ax .coastlines ()
104104ax .stock_img ()
105105ax .set_extent ([- 5 , 15 , - 4 , 14 ], crs = ccrs .PlateCarree ())
106- ax .gridlines (draw_labels = True )
106+ glines = ax .gridlines (draw_labels = True )
107+ glines .top_labels = False
108+ glines .right_labels = False
107109ax .set_title ("Head" )
108- qsprj_pth = os .path .join (QS_ROOT , "qsprj.png" )
110+ qsprj_pth = os .path .join (QS_ROOT , "image" , " qsprj.png" )
109111fig .savefig (qsprj_pth )
0 commit comments