I am having issues with flopy.modflow.ModflowDis() when adding grid spatial refernece. When I add xul, yul and rotation, the results spatial reference data is not consistent with what I added. The following code demonstrates the issue.
import flopy
import numpy as np
delr = 640
delc = 640
nrow = np.ceil(59040./delc).astype(int)
ncol = np.ceil(33128./delr).astype(int)
nlay = 3
bg = flopy.modflow.Modflow(modelname='base')
dis = flopy.modflow.ModflowDis(bg, nlay=nlay, nrow=nrow, ncol=ncol, delr=delr, delc=delc,
lenuni=1, rotation=-39, xul=2746975.089, yul=1171446.45, proj4_str='epsg:2243')
print(f'dis.sr: {dis.sr}')
print(f'dis.sr.xll: {dis.sr.xll}')
print(f'dis.sr.yll: {dis.sr.yll}')
The output I get is:
dis.sr: xul:2784432.239; yul:1158182.178; rotation:-39; proj4_str:+init=epsg:2243; units:feet; lenuni:1; length_multiplier:1.0
dis.sr.xll: 2746975.089
dis.sr.yll: 1111926.45
As you can see the xul and yul contained in dis.sr is not the same as the xul and yul that I supplied as an argument. I am using this code to create a base grid for gridgen, then converting to an unstructured quadtree grid with refinement around some of the features. I was in the process of trying to intersect this grid with an elevation dem so I could assign model top elevations when I encountered this issue. The grid does not intersect the dem. It is shifted to the right and down.
Any thoughts?
I updated flopy yesterday to 3.2.13 and I am aware that .sr is being deprecated.
Thanks!
I am having issues with flopy.modflow.ModflowDis() when adding grid spatial refernece. When I add xul, yul and rotation, the results spatial reference data is not consistent with what I added. The following code demonstrates the issue.
The output I get is:
dis.sr: xul:2784432.239; yul:1158182.178; rotation:-39; proj4_str:+init=epsg:2243; units:feet; lenuni:1; length_multiplier:1.0
dis.sr.xll: 2746975.089
dis.sr.yll: 1111926.45
As you can see the xul and yul contained in dis.sr is not the same as the xul and yul that I supplied as an argument. I am using this code to create a base grid for gridgen, then converting to an unstructured quadtree grid with refinement around some of the features. I was in the process of trying to intersect this grid with an elevation dem so I could assign model top elevations when I encountered this issue. The grid does not intersect the dem. It is shifted to the right and down.
Any thoughts?
I updated flopy yesterday to 3.2.13 and I am aware that .sr is being deprecated.
Thanks!