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

Generalize finding of z layer variables #766

Open
veenstrajelmer opened this issue Feb 2, 2024 · 0 comments
Open

Generalize finding of z layer variables #766

veenstrajelmer opened this issue Feb 2, 2024 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Feb 2, 2024

Currently hardcoded in dfmt.reconstruct_zw_zcc():

elif f'{gridname}_layer_z' in uds.variables:
print('z-layer model, computing zw/zcc (fullgrid) values and treat as fullgrid model from here')
uds = reconstruct_zw_zcc_fromz(uds)

Can be generalized via standard_name="altitude", but this might be too generic (e.g. could also include bedlevel variable or something similar. Also, it is not following clear cf-conventions.)

code:

file_nc = dfmt.data.fm_grevelingen_map(return_filepath=True) # zlayer
file_nc = r'p:\archivedprojects\11203379-005-mwra-updated-bem\03_model\02_final\A72_ntsu0_kzlb2\DFM_OUTPUT_MB_02\MB_02_0000_map.nc'
uds = dfmt.open_partitioned_dataset(file_nc)
uds = reconstruct_zw_zcc(uds)

Replace in reconstruct_zw_zcc:

# elif f'{gridname}_layer_z' in uds.variables:
elif len(uds.filter_by_attrs(standard_name='altitude')) != 0:

If implemented, test with vertical slicing and depth slicing.

This was referenced Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant