Exercise F: Dfs0

Exercise F: Dfs0#

2024-8-12

import mikeio

F.1 Read dfs0#

# Read the file Oresund_ts.dfs0 mikeio.read - call the object ds
# print the number of items
# get the data from the first item to a variable da
# print da
# Change the name to "Viken: Surface elevation" by using the `Dataset.rename` method
# plot the datarray to check that the new name is indeed "Viken"
# convert the dataset (ds) to a dataframe called df
# plot df

F.2 Write modified dfs0#

#print(ds)
#da.mean()     # mean before correction
#da.plot()
# add 0.5m to the data
#da.mean()     # mean after correction
# write the ds to a new file called "Viken_ts_corrected.dfs0" with da.to_dfs