Exercise F: Dfs0

Exercise F: Dfs0#

2021-8-24

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" by setting the .name property of the data array (da) da.name = "New name"
# 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