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

nlmod.to_model_ds() to accept vertex layer_models #298

Open
bdestombe opened this issue Nov 24, 2023 · 2 comments
Open

nlmod.to_model_ds() to accept vertex layer_models #298

bdestombe opened this issue Nov 24, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@bdestombe
Copy link
Collaborator

bdestombe commented Nov 24, 2023

Currently nlmod.to_model_ds() silently only accept structured layer_models. Supporting vertex grids is desired for when the constructed layer_model is not from REGIS but self constructed, i.e. interpreted triwaco layers with refined grids.

The current way of doing it, following example nb 3 would be to

  • construct a structured layer_model from REGIS
  • construct a ds
  • construct ds_vertex while refining the grid -> moving to vertex grid
  • use refined grid to interpret triwaco layers and update ds_vertex
  • configure other packages

I would propose the following:

  • create your layer_model however you like; structured or vertex
  • construct a ds
  • configure other packages

Does this make sense? Which changes would this imply?

Furthermore, the ds_vertex has properties delr and delc that not make sense as it is a vertex grid now. There are some functions that use the delr and delc attributes, such as some reprojecting functions. These functions mostly also work with vertex grid. But shouldn't they produce an error because the delr and delc are invalid.

edit: renamed ds2 to ds_vertex

@bdestombe bdestombe added the enhancement New feature or request label Nov 24, 2023
@rubencalje
Copy link
Collaborator

rubencalje commented Nov 27, 2023

Can't you just add the information from your layers to a model-dataset without creating a layer model first:

# set layer to the amount of layers you need
ds = nlmod.get_ds([100_000, 110_000, 400_000, 405_000], delr=50, delc=50, layer=1)
ds = ds.refine(xxx)

After which you change top, botm, kh and kv based on your (triwaco) data.

The delr and delc attributes represent the properties of the base grid, before refining took place. I think they are ignored by all methods however, so it should be better to remove them.

@bdestombe
Copy link
Collaborator Author

Can't you just add the information from your layers to a model-dataset without creating a layer model first:

# set layer to the amount of layers you need
ds = nlmod.get_ds([100_000, 110_000, 400_000, 405_000], delr=50, delc=50, layer=1)
ds = ds.refine(xxx)

After which you change top, botm, kh and kv based on your (triwaco) data.

The delr and delc attributes represent the properties of the base grid, before refining took place. I think they are ignored by all methods however, so it should be better to remove them.

Hi Ruben, thanks for your response.

Yes, that work-around is similar to the first approach I am describing. But is having a more flexible ds construction routine, which accepts both structured and vertex grids seems preferable to me.

If not, the documentation, and maybe even the function name, should reflect that is only supports structured grids.

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

No branches or pull requests

2 participants