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

Support for adding custom blocks on write #675

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

ecomodeller
Copy link
Member

@ecomodeller ecomodeller commented Mar 17, 2024

Custom blocks are a form of metadata used in particular situations to add additional information to a dfs file.

Example of how custom blocks are added to an existing dfs2 file without custom blocks.

import mikeio
import numpy as np
ds = mikeio.read("tests/testdata/gebco_sound.dfs2")
ds.to_dfs("new_file.dfs2",
        custom_blocks={"M21_Misc": np.array([327, 0.2, -900, 10, 0, 0, 0], np.float32)},
   )

This PR adds support for adding custom blocks in the moment a dataset is written to a file.

@ecomodeller ecomodeller changed the title Support for custom blocks Support for adding custom blocks on write Mar 17, 2024
@ecomodeller ecomodeller linked an issue Apr 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant