Skip to content

nlmod.layers.get_layer_of_z does not return the right value for cells above top #523

@rubencalje

Description

@rubencalje

Code to reproduce

ds = nlmod.get_ds([0, 1000, 0, 2000], top=0, botm=[-10, -20])
layer = nlmod.layers.get_layer_of_z(ds, 10)

This returns zeros (the first layer)

<xarray.DataArray (y: 5, x: 10)> Size: 400B
array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
Coordinates:
  * y            (y) float64 40B 450.0 350.0 250.0 150.0 50.0
  * x            (x) float64 80B 50.0 150.0 250.0 350.0 ... 750.0 850.0 950.0
    spatial_ref  int64 8B 0
Attributes:
    above_model:  -999
    below_model:  -999

while I expect this method to return above_model values (-999 in this case). I think this is caused by commit 1b07783.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions