Skip to content

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

Development

Successfully merging this pull request may close these issues.

Defining landvalue when writing dfs2-file Read/modify dfs custom blocks Creating Dfs2 with projection should have a special custom block

2 participants