Skip to content

Is creating model grid from elevation data possible? #1453

Answered by jlarsen-usgs
AH-CSM asked this question in Q&A
Discussion options

You must be logged in to vote

@AH-CSM

We have support to create model grid elevations and even idomain/ibound arrays from raster data. Take a look at The raster intersection notebook.

One requirement for this, is that you will need to create a minimal modelgrid prior to doing the intersections. Your modelgrid cells in at least 2d must be represented in geospatial coordinates prior to intersecting with raster and shapefile data.

Example code.

from flopy.discretization import StructuredGrid
from flopy.utils import Raster

delr = np.ones((10,)) * 250
delc = np.ones((10,)) * 250 
xll = 10
yll = 100
modelgrid = StructuredGrid(delc=delc, delr=delr, xoff=xll, yoff=yll)

rstr = Raster.load("my raster")
resampled = rstr.resamp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AH-CSM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants