{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# PFS \n", "\n", "The support for PFS files have been extended with MIKE IO release 1.2. It was previously only possible to *read* PFS files. It is now also possible to *modify* and *create* new PFS files. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import mikeio" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Read" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\n", "FemEngineSW: DOMAIN: Touched: 1 discretization: 2 numbe..." ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs = mikeio.read_pfs(\"../tests/testdata/pfs/lake.sw\")\n", "pfs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The \"target\" (root section) is in this case called FemEngineSW. `pfs.FemEngineSW` is a PfsSection object that contains other PfsSection objects. Let's print the names of it's subsections:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['DOMAIN', 'TIME', 'MODULE_SELECTION', 'SPECTRAL_WAVE_MODULE'])" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.FemEngineSW.keys()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is possible to navigate to each section and keyword in the pfs file:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'|.\\\\Lake_Mesh.mesh|'" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.FemEngineSW.DOMAIN.file_name" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Touched: 0\n", "mode_of_hydrodynamic_module: 0\n", "hydrodynamic_features: 1\n", "fluid_property: 1\n", "mode_of_spectral_wave_module: 2\n", "mode_of_transport_module: 0\n", "mode_of_mud_transport_module: 0\n", "mode_of_eco_lab_module: 0\n", "mode_of_sand_transport_module: 0\n", "mode_of_particle_tracking_module: 0\n", "mode_of_oil_spill_module: 0\n", "mode_of_shoreline_module: 0" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.FemEngineSW.MODULE_SELECTION" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.FemEngineSW.MODULE_SELECTION.mode_of_spectral_wave_module" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "MIKE FM PFS files has a specific structure and active FM modules can be accessed by an alias on the Pfs object. In this case, `pfs.SW` can be used as a short-hand for `pfs.FemEngineSW.SPECTRAL_WAVE_MODULE`." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "16" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.SW.SPECTRAL.number_of_directions" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.5959088268863615" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.SW.SPECTRAL.maximum_threshold_frequency" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Enumerated sections (e.g. [OUTPUT_1], [OUTPUT_2], ...) can be outputted in tabular form (dataframe)." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Touchedincludetitlefile_nametypeformatflood_and_drycoordinate_typezoneinput_file_name...last_time_steptime_step_frequencynumber_of_pointsPOINT_1LINEAREAINTEGRAL_WAVE_PARAMETERSINPUT_PARAMETERSMODEL_PARAMETERSSPECTRAL_PARAMETERS
111Wave parameters in domainWave_parameters.dfsu122UTM-320||...450101{'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0}{'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,...{'number_of_points': 4, 'POINT_1': {'x': -400....{'Touched': 1, 'type_of_spectrum': 1, 'minimum...{'Touched': 1, 'Surface_elevation': 0, 'Water_...{'Touched': 1, 'Wind_friction_speed': 0, 'Roug...{'Touched': 1, 'separation_of_wind_sea_and_swe...
210Wave parameters along lineWave_line.dfs1112UTM-320||...450101{'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0}{'npoints': 41, 'x_first': 0.0, 'y_first': 200...{'number_of_points': 4, 'POINT_1': {'x': -400....{'Touched': 1, 'type_of_spectrum': 1, 'minimum...{'Touched': 1, 'Surface_elevation': 0, 'Water_...{'Touched': 1, 'Wind_friction_speed': 0, 'Roug...{'Touched': 1, 'separation_of_wind_sea_and_swe...
311Wave parameters in a pointWaves_x20km_y20km.dfs0102UTM-320||...45011{'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0}{'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,...{'number_of_points': 4, 'POINT_1': {'x': -400....{'Touched': 1, 'type_of_spectrum': 1, 'minimum...{'Touched': 1, 'Surface_elevation': 0, 'Water_...{'Touched': 1, 'Wind_friction_speed': 0, 'Roug...{'Touched': 1, 'separation_of_wind_sea_and_swe...
411Spectrum in a pointspectrum_x20km_y20km.dfsu402UTM-320||...450101{'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0}{'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,...{'number_of_points': 4, 'POINT_1': {'x': -400....{'Touched': 1, 'type_of_spectrum': 1, 'minimum...{'Touched': 1, 'Surface_elevation': 0, 'Water_...{'Touched': 1, 'Wind_friction_speed': 0, 'Roug...{'Touched': 1, 'separation_of_wind_sea_and_swe...
\n", "

4 rows × 24 columns

\n", "
" ], "text/plain": [ " Touched include title file_name \\\n", "1 1 1 Wave parameters in domain Wave_parameters.dfsu \n", "2 1 0 Wave parameters along line Wave_line.dfs1 \n", "3 1 1 Wave parameters in a point Waves_x20km_y20km.dfs0 \n", "4 1 1 Spectrum in a point spectrum_x20km_y20km.dfsu \n", "\n", " type format flood_and_dry coordinate_type zone input_file_name ... \\\n", "1 1 2 2 UTM-32 0 || ... \n", "2 1 1 2 UTM-32 0 || ... \n", "3 1 0 2 UTM-32 0 || ... \n", "4 4 0 2 UTM-32 0 || ... \n", "\n", " last_time_step time_step_frequency number_of_points \\\n", "1 450 10 1 \n", "2 450 10 1 \n", "3 450 1 1 \n", "4 450 10 1 \n", "\n", " POINT_1 \\\n", "1 {'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0} \n", "2 {'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0} \n", "3 {'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0} \n", "4 {'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0} \n", "\n", " LINE \\\n", "1 {'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,... \n", "2 {'npoints': 41, 'x_first': 0.0, 'y_first': 200... \n", "3 {'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,... \n", "4 {'npoints': 3, 'x_first': 0.0, 'y_first': 0.0,... \n", "\n", " AREA \\\n", "1 {'number_of_points': 4, 'POINT_1': {'x': -400.... \n", "2 {'number_of_points': 4, 'POINT_1': {'x': -400.... \n", "3 {'number_of_points': 4, 'POINT_1': {'x': -400.... \n", "4 {'number_of_points': 4, 'POINT_1': {'x': -400.... \n", "\n", " INTEGRAL_WAVE_PARAMETERS \\\n", "1 {'Touched': 1, 'type_of_spectrum': 1, 'minimum... \n", "2 {'Touched': 1, 'type_of_spectrum': 1, 'minimum... \n", "3 {'Touched': 1, 'type_of_spectrum': 1, 'minimum... \n", "4 {'Touched': 1, 'type_of_spectrum': 1, 'minimum... \n", "\n", " INPUT_PARAMETERS \\\n", "1 {'Touched': 1, 'Surface_elevation': 0, 'Water_... \n", "2 {'Touched': 1, 'Surface_elevation': 0, 'Water_... \n", "3 {'Touched': 1, 'Surface_elevation': 0, 'Water_... \n", "4 {'Touched': 1, 'Surface_elevation': 0, 'Water_... \n", "\n", " MODEL_PARAMETERS \\\n", "1 {'Touched': 1, 'Wind_friction_speed': 0, 'Roug... \n", "2 {'Touched': 1, 'Wind_friction_speed': 0, 'Roug... \n", "3 {'Touched': 1, 'Wind_friction_speed': 0, 'Roug... \n", "4 {'Touched': 1, 'Wind_friction_speed': 0, 'Roug... \n", "\n", " SPECTRAL_PARAMETERS \n", "1 {'Touched': 1, 'separation_of_wind_sea_and_swe... \n", "2 {'Touched': 1, 'separation_of_wind_sea_and_swe... \n", "3 {'Touched': 1, 'separation_of_wind_sea_and_swe... \n", "4 {'Touched': 1, 'separation_of_wind_sea_and_swe... \n", "\n", "[4 rows x 24 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pfs.SW.OUTPUTS.to_dataframe()\n", "df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Modify\n", "\n", "The PfsSection object can be modified. Existing values can be changes, new key-value pairs can be added, subsections can added or removed. " ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "pfs.SW.SPECTRAL.number_of_directions = 32" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Touched: 1\n", "type_of_frequency_discretization: 2\n", "number_of_frequencies: 25\n", "minimum_frequency: 0.055\n", "frequency_interval: 0.02\n", "frequency_factor: 1.1\n", "type_of_directional_discretization: 1\n", "number_of_directions: 32\n", "minimum_direction: 0.0\n", "maximum_direction: 0.0\n", "separation_of_wind_sea_and_swell: 0\n", "threshold_frequency: 0.125\n", "maximum_threshold_frequency: 0.5959088268863615" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.SW.SPECTRAL" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Add a new keyword" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "pfs.SW.SPECTRAL[\"new_keyword\"] = \"new_value\"" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Touched: 1\n", "type_of_frequency_discretization: 2\n", "number_of_frequencies: 25\n", "minimum_frequency: 0.055\n", "frequency_interval: 0.02\n", "frequency_factor: 1.1\n", "type_of_directional_discretization: 1\n", "number_of_directions: 32\n", "minimum_direction: 0.0\n", "maximum_direction: 0.0\n", "separation_of_wind_sea_and_swell: 0\n", "threshold_frequency: 0.125\n", "maximum_threshold_frequency: 0.5959088268863615\n", "new_keyword: new_value" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.SW.SPECTRAL" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Add a section\n", "\n", "Let's create an additional output, by copying OUTPUT_4 and modifying some parameters." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "pfs.SW.OUTPUTS.number_of_outputs += 1" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "new_output = pfs.SW.OUTPUTS.OUTPUT_4.copy()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "new_output.file_name = 'spectrum_x10km_y40km.dfsu'\n", "new_output.POINT_1.x = 10000\n", "new_output.POINT_1.y = 40000" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "pfs.SW.OUTPUTS[\"OUTPUT_5\"] = new_output" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['Touched', 'MzSEPfsListItemCount', 'number_of_outputs', 'OUTPUT_1', 'OUTPUT_2', 'OUTPUT_3', 'OUTPUT_4', 'OUTPUT_5'])" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.SW.OUTPUTS.keys()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Output\n", "\n", "The Pfs object can be written to pfs file, but can also be exported to a dictionary (which in turn can be written to a yaml or json file)." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "pfs.write(\"lake_modified.pfs\")" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'FemEngineSW': {'DOMAIN': {'Touched': 1,\n", " 'discretization': 2,\n", " 'number_of_dimensions': 2,\n", " 'number_of_meshes': 1,\n", " 'file_name': '|.\\\\Lake_Mesh.mesh|',\n", " 'type_of_reordering': 1,\n", " 'number_of_domains': 16,\n", " 'coordinate_type': 'UTM-32',\n", " 'minimum_depth': 0.0,\n", " 'datum_depth': 0.0,\n", " 'vertical_mesh_type_overall': 1,\n", " 'number_of_layers': 11,\n", " 'z_sigma': 0.0,\n", " 'vertical_mesh_type': 1,\n", " 'layer_thickness': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0],\n", " 'sigma_c': 0.0,\n", " 'theta': 2.0,\n", " 'b': 0.0,\n", " 'number_of_layers_zlevel': 10,\n", " 'vertical_mesh_type_zlevel': 1,\n", " 'constant_layer_thickness_zlevel': 0.0,\n", " 'variable_layer_thickness_zlevel': [0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0],\n", " 'type_of_bathymetry_adjustment': 1,\n", " 'minimum_layer_thickness_zlevel': 0.0,\n", " 'type_of_mesh': 0,\n", " 'type_of_gauss': 3,\n", " 'BOUNDARY_NAMES': {'Touched': 0, 'MzSEPfsListItemCount': 0}},\n", " 'TIME': {'Touched': 1,\n", " 'start_time': datetime.datetime(2002, 1, 1, 0, 0),\n", " 'time_step_interval': 120.0,\n", " 'number_of_time_steps': 450},\n", " 'MODULE_SELECTION': {'Touched': 0,\n", " 'mode_of_hydrodynamic_module': 0,\n", " 'hydrodynamic_features': 1,\n", " 'fluid_property': 1,\n", " 'mode_of_spectral_wave_module': 2,\n", " 'mode_of_transport_module': 0,\n", " 'mode_of_mud_transport_module': 0,\n", " 'mode_of_eco_lab_module': 0,\n", " 'mode_of_sand_transport_module': 0,\n", " 'mode_of_particle_tracking_module': 0,\n", " 'mode_of_oil_spill_module': 0,\n", " 'mode_of_shoreline_module': 0},\n", " 'SPECTRAL_WAVE_MODULE': {'mode': 2,\n", " 'SPACE': {'number_of_mesh_geometry': 1},\n", " 'EQUATION': {'Touched': 1,\n", " 'formulation': 2,\n", " 'time_formulation': 2,\n", " 'JONSWAP_factor_1': 0.92,\n", " 'JONSWAP_factor_2': 0.83},\n", " 'TIME': {'Touched': 0,\n", " 'start_time_step': 0,\n", " 'time_step_factor': 1,\n", " 'time_step_factor_AD': 1},\n", " 'SPECTRAL': {'Touched': 1,\n", " 'type_of_frequency_discretization': 2,\n", " 'number_of_frequencies': 25,\n", " 'minimum_frequency': 0.055,\n", " 'frequency_interval': 0.02,\n", " 'frequency_factor': 1.1,\n", " 'type_of_directional_discretization': 1,\n", " 'number_of_directions': 32,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 0.0,\n", " 'separation_of_wind_sea_and_swell': 0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.5959088268863615,\n", " 'new_keyword': 'new_value'},\n", " 'SOLUTION_TECHNIQUE': {'Touched': 1,\n", " 'error_level': 0,\n", " 'maximum_number_of_errors': 200,\n", " 'minimum_period': 0.1,\n", " 'maximum_period': 25.0,\n", " 'initial_period': 8.0,\n", " 'scheme_of_space_discretization_geographical': 1,\n", " 'scheme_of_space_discretization_direction': 1,\n", " 'scheme_of_space_discretization_frequency': 1,\n", " 'method': 2,\n", " 'number_of_iterations': 10,\n", " 'tolerance1': 0.0001,\n", " 'tolerance2': 0.001,\n", " 'relaxation_factor': 0.1,\n", " 'number_of_levels_in_transport_calc': 32,\n", " 'number_of_steps_in_source_calc': 1,\n", " 'maximum_CFL_number': 1.0,\n", " 'dt_min': 0.01,\n", " 'dt_max': 120.0,\n", " 'type_overall': 0,\n", " 'file_name_overall': '|.\\\\convergence_overall.dfs0|',\n", " 'input_format': 1,\n", " 'coordinate_type': '',\n", " 'input_file_name': '||',\n", " 'number_of_points': 0,\n", " 'type_domain': 0,\n", " 'file_name_domain': '|.\\\\convergence_domain.dfsu|',\n", " 'output_frequency': 5},\n", " 'DEPTH': {'Touched': 1,\n", " 'type': 0,\n", " 'minimum_depth': 0.01,\n", " 'format': 0,\n", " 'soft_time_interval': 0.0,\n", " 'constant_level': 0.0,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': ''},\n", " 'CURRENT': {'Touched': 1,\n", " 'type': 0,\n", " 'type_blocking': 1,\n", " 'factor_blocking': 0.1,\n", " 'format': 0,\n", " 'soft_time_interval': 0.0,\n", " 'constant_x_velocity': 0.0,\n", " 'constant_y_velocity': 0.0,\n", " 'file_name': '||',\n", " 'item_number_for_x_velocity': 0,\n", " 'item_number_for_y_velocity': 0,\n", " 'item_name_for_x_velocity': '',\n", " 'item_name_for_y_velocity': ''},\n", " 'WIND': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 1,\n", " 'constant_speed': 15.0,\n", " 'constant_direction': 270.0,\n", " 'file_name': '|.\\\\Wind.dfs0|',\n", " 'item_number_for_speed': 1,\n", " 'item_number_for_direction': 2,\n", " 'item_name_for_speed': 'Speed',\n", " 'item_name_for_direction': 'Direction',\n", " 'soft_time_interval': 0.0,\n", " 'formula': 1,\n", " 'type_of_drag': 1,\n", " 'linear_growth_coefficient': 0.0015,\n", " 'type_of_air_sea_interaction': 1,\n", " 'background_Charnock_parameter': 0.01,\n", " 'Charnock_parameter': 0.01,\n", " 'alpha_drag': 0.00063,\n", " 'beta_drag': 6.6e-05},\n", " 'ICE': {'Touched': 1,\n", " 'type': 0,\n", " 'format': 3,\n", " 'c_cut_off': 0.33,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': ''},\n", " 'DIFFRACTION': {'Touched': 1,\n", " 'type': 0,\n", " 'minimum_delta': -0.75,\n", " 'maximum_delta': 3.0,\n", " 'type_of_smoothing': 1,\n", " 'smoothing_factor': 1.0,\n", " 'number_of_smoothing_steps': 1},\n", " 'TRANSFER': {'Touched': 1, 'type': 1, 'type_triad': 0, 'alpha_EB': 0.25},\n", " 'WAVE_BREAKING': {'Touched': 1,\n", " 'type': 0,\n", " 'type_of_gamma': 1,\n", " 'alpha': 1.0,\n", " 'gamma_steepness': 1.0,\n", " 'type_of_effect_on_frequency': 1,\n", " 'type_of_roller': 0,\n", " 'roller_propagation_factor': 1.0,\n", " 'roller_dissipation_factor': 0.15,\n", " 'roller_density': 1000.0,\n", " 'GAMMA': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.55,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1}},\n", " 'BOTTOM_FRICTION': {'Touched': 1,\n", " 'type': 0,\n", " 'constant_fc': 0.0,\n", " 'type_of_effect_on_frequency': 0,\n", " 'FRICTION_COEFFICIENT': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.0775,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1},\n", " 'FRICTION_FACTOR': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.0212,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1},\n", " 'NIKURADSE_ROUGHNESS': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.04,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1},\n", " 'SAND_GRAIN_SIZE': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.00025,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1}},\n", " 'WHITECAPPING': {'Touched': 1,\n", " 'type': 1,\n", " 'type_of_spectrum': 3,\n", " 'mean_frequency_power': -1,\n", " 'mean_wave_number_power': -1,\n", " 'dissipation_cdiss': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 4.5,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1},\n", " 'dissipation_delta': {'Touched': 1,\n", " 'type': 1,\n", " 'format': 0,\n", " 'constant_value': 0.5,\n", " 'file_name': '||',\n", " 'item_number': 1,\n", " 'item_name': '',\n", " 'type_of_soft_start': 2,\n", " 'soft_time_interval': 0.0,\n", " 'reference_value': 0.0,\n", " 'type_of_time_interpolation': 1}},\n", " 'STRUCTURES': {'type': 0,\n", " 'input_format': 1,\n", " 'coordinate_type': '',\n", " 'number_of_structures': 0,\n", " 'input_file_name': '||',\n", " 'LINE_STRUCTURES': {'Touched': 1,\n", " 'MzSEPfsListItemCount': 0,\n", " 'output_of_link_data': 0,\n", " 'file_name_section': 'line_section.xyz',\n", " 'number_of_structures': 0}},\n", " 'INITIAL_CONDITIONS': {'Touched': 1,\n", " 'type': 0,\n", " 'type_additional': 1,\n", " 'type_of_spectra': 1,\n", " 'fetch': 40000.0,\n", " 'max_peak_frequency': 0.4,\n", " 'max_Phillips_constant': 0.0081,\n", " 'shape_parameter_sigma_a': 0.07,\n", " 'shape_parameter_sigma_b': 0.09,\n", " 'peakednes_parameter_gamma': 3.3,\n", " 'file_name_m': '||',\n", " 'item_number_m0': 1,\n", " 'item_number_m1': 1,\n", " 'item_name_m0': '',\n", " 'item_name_m1': '',\n", " 'file_name_A': '||',\n", " 'item_number_A': 1,\n", " 'item_name_A': ''},\n", " 'BOUNDARY_CONDITIONS': {'Touched': 0,\n", " 'MzSEPfsListItemCount': 0,\n", " 'CODE_1': None},\n", " 'OUTPUTS': {'Touched': 1,\n", " 'MzSEPfsListItemCount': 4,\n", " 'number_of_outputs': 5,\n", " 'OUTPUT_1': {'Touched': 1,\n", " 'include': 1,\n", " 'title': 'Wave parameters in domain',\n", " 'file_name': 'Wave_parameters.dfsu',\n", " 'type': 1,\n", " 'format': 2,\n", " 'flood_and_dry': 2,\n", " 'coordinate_type': 'UTM-32',\n", " 'zone': 0,\n", " 'input_file_name': '||',\n", " 'input_format': 1,\n", " 'interpolation_type': 1,\n", " 'use_end_time': 1,\n", " 'first_time_step': 0,\n", " 'last_time_step': 450,\n", " 'time_step_frequency': 10,\n", " 'number_of_points': 1,\n", " 'POINT_1': {'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0},\n", " 'LINE': {'npoints': 3,\n", " 'x_first': 0.0,\n", " 'y_first': 0.0,\n", " 'x_last': 40000.0,\n", " 'y_last': 40000.0},\n", " 'AREA': {'number_of_points': 4,\n", " 'POINT_1': {'x': -400.0, 'y': -400.0},\n", " 'POINT_2': {'x': -400.0, 'y': 40400.0},\n", " 'POINT_3': {'x': 40400.0, 'y': 40400.0},\n", " 'POINT_4': {'x': 40400.0, 'y': -400.0},\n", " 'orientation': 0.0,\n", " 'x_origo': 0.0,\n", " 'x_ds': 2105.263157894737,\n", " 'x_npoints': 20,\n", " 'y_origo': 0.0,\n", " 'y_ds': 2105.263157894737,\n", " 'y_npoints': 20,\n", " 'z_origo': -15.00000000000001,\n", " 'z_ds': 2.000000000000001,\n", " 'z_npoints': 10},\n", " 'INTEGRAL_WAVE_PARAMETERS': {'Touched': 1,\n", " 'type_of_spectrum': 1,\n", " 'minimum_frequency': 0.055,\n", " 'maximum_frequency': 0.5959088268863617,\n", " 'separation_of_wind_sea_and_swell': 3,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'hm0_minimum': 0.01,\n", " 'type_of_h_max': 3,\n", " 'duration': 10800.0,\n", " 'distance_above_bed_for_particle_velocity': 0.0,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 360.0,\n", " 'Total_wave_parameters': {'Significant_wave_height': 1,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 1,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 1,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 1,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 1,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Wind_sea_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Swell_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0}},\n", " 'INPUT_PARAMETERS': {'Touched': 1,\n", " 'Surface_elevation': 0,\n", " 'Water_depth': 0,\n", " 'Current_velocity_components': 0,\n", " 'Wind_speed': 0,\n", " 'Wind_direction': 0,\n", " 'Ice_concentration': 0},\n", " 'MODEL_PARAMETERS': {'Touched': 1,\n", " 'Wind_friction_speed': 0,\n", " 'Roughness_length': 0,\n", " 'Drag_coefficient': 0,\n", " 'Charnock_constant': 0,\n", " 'Friction_coefficient': 0,\n", " 'Breaking_parameter_gamma': 0,\n", " 'Courant_number': 1,\n", " 'Time_step_factor': 1,\n", " 'Convergence_angle': 0,\n", " 'Length': 0,\n", " 'Area': 0,\n", " 'Threshold_period': 0,\n", " 'Roller_area': 0,\n", " 'Roller_dissipation': 0,\n", " 'Breaking_index': 0},\n", " 'SPECTRAL_PARAMETERS': {'Touched': 1,\n", " 'separation_of_wind_sea_and_swell': 3.0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'wave_energy': 1,\n", " 'wave_action': 0,\n", " 'zeroth_moment_of_wave_action': 0,\n", " 'first_moment_of_wave_action': 0,\n", " 'wave_energy_wind_sea': 0,\n", " 'wave_energy_swell': 0}},\n", " 'OUTPUT_2': {'Touched': 1,\n", " 'include': 0,\n", " 'title': 'Wave parameters along line',\n", " 'file_name': 'Wave_line.dfs1',\n", " 'type': 1,\n", " 'format': 1,\n", " 'flood_and_dry': 2,\n", " 'coordinate_type': 'UTM-32',\n", " 'zone': 0,\n", " 'input_file_name': '||',\n", " 'input_format': 1,\n", " 'interpolation_type': 2,\n", " 'use_end_time': 1,\n", " 'first_time_step': 0,\n", " 'last_time_step': 450,\n", " 'time_step_frequency': 10,\n", " 'number_of_points': 1,\n", " 'POINT_1': {'name': 'POINT_1', 'x': 20000.0, 'y': 20000.0},\n", " 'LINE': {'npoints': 41,\n", " 'x_first': 0.0,\n", " 'y_first': 20000.0,\n", " 'x_last': 40000.0,\n", " 'y_last': 20000.0},\n", " 'AREA': {'number_of_points': 4,\n", " 'POINT_1': {'x': -400.0, 'y': -400.0},\n", " 'POINT_2': {'x': -400.0, 'y': 40400.0},\n", " 'POINT_3': {'x': 40400.0, 'y': 40400.0},\n", " 'POINT_4': {'x': 40400.0, 'y': -400.0},\n", " 'orientation': 0.0,\n", " 'x_origo': 0.0,\n", " 'x_ds': 2105.263157894737,\n", " 'x_npoints': 20,\n", " 'y_origo': 0.0,\n", " 'y_ds': 2105.263157894737,\n", " 'y_npoints': 20,\n", " 'z_origo': -15.00000000000001,\n", " 'z_ds': 2.000000000000001,\n", " 'z_npoints': 10},\n", " 'INTEGRAL_WAVE_PARAMETERS': {'Touched': 1,\n", " 'type_of_spectrum': 1,\n", " 'minimum_frequency': 0.055,\n", " 'maximum_frequency': 0.5959088268863617,\n", " 'separation_of_wind_sea_and_swell': 3,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'hm0_minimum': 0.01,\n", " 'type_of_h_max': 3,\n", " 'duration': 10800.0,\n", " 'distance_above_bed_for_particle_velocity': 0.0,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 360.0,\n", " 'Total_wave_parameters': {'Significant_wave_height': 1,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 1,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 1,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 1,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Wind_sea_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Swell_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0}},\n", " 'INPUT_PARAMETERS': {'Touched': 1,\n", " 'Surface_elevation': 0,\n", " 'Water_depth': 0,\n", " 'Current_velocity_components': 0,\n", " 'Wind_speed': 0,\n", " 'Wind_direction': 0,\n", " 'Ice_concentration': 0},\n", " 'MODEL_PARAMETERS': {'Touched': 1,\n", " 'Wind_friction_speed': 0,\n", " 'Roughness_length': 0,\n", " 'Drag_coefficient': 0,\n", " 'Charnock_constant': 0,\n", " 'Friction_coefficient': 0,\n", " 'Breaking_parameter_gamma': 0,\n", " 'Courant_number': 0,\n", " 'Time_step_factor': 0,\n", " 'Convergence_angle': 0,\n", " 'Length': 0,\n", " 'Area': 0,\n", " 'Threshold_period': 0,\n", " 'Roller_area': 0,\n", " 'Roller_dissipation': 0,\n", " 'Breaking_index': 0},\n", " 'SPECTRAL_PARAMETERS': {'Touched': 1,\n", " 'separation_of_wind_sea_and_swell': 3.0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'wave_energy': 1,\n", " 'wave_action': 0,\n", " 'zeroth_moment_of_wave_action': 0,\n", " 'first_moment_of_wave_action': 0,\n", " 'wave_energy_wind_sea': 0,\n", " 'wave_energy_swell': 0}},\n", " 'OUTPUT_3': {'Touched': 1,\n", " 'include': 1,\n", " 'title': 'Wave parameters in a point',\n", " 'file_name': 'Waves_x20km_y20km.dfs0',\n", " 'type': 1,\n", " 'format': 0,\n", " 'flood_and_dry': 2,\n", " 'coordinate_type': 'UTM-32',\n", " 'zone': 0,\n", " 'input_file_name': '||',\n", " 'input_format': 1,\n", " 'interpolation_type': 2,\n", " 'use_end_time': 1,\n", " 'first_time_step': 0,\n", " 'last_time_step': 450,\n", " 'time_step_frequency': 1,\n", " 'number_of_points': 1,\n", " 'POINT_1': {'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0},\n", " 'LINE': {'npoints': 3,\n", " 'x_first': 0.0,\n", " 'y_first': 0.0,\n", " 'x_last': 40000.0,\n", " 'y_last': 40000.0},\n", " 'AREA': {'number_of_points': 4,\n", " 'POINT_1': {'x': -400.0, 'y': -400.0},\n", " 'POINT_2': {'x': -400.0, 'y': 40400.0},\n", " 'POINT_3': {'x': 40400.0, 'y': 40400.0},\n", " 'POINT_4': {'x': 40400.0, 'y': -400.0},\n", " 'orientation': 0.0,\n", " 'x_origo': 0.0,\n", " 'x_ds': 2105.263157894737,\n", " 'x_npoints': 20,\n", " 'y_origo': 0.0,\n", " 'y_ds': 2105.263157894737,\n", " 'y_npoints': 20,\n", " 'z_origo': -15.00000000000001,\n", " 'z_ds': 2.000000000000001,\n", " 'z_npoints': 10},\n", " 'INTEGRAL_WAVE_PARAMETERS': {'Touched': 1,\n", " 'type_of_spectrum': 1,\n", " 'minimum_frequency': 0.055,\n", " 'maximum_frequency': 0.5959088268863617,\n", " 'separation_of_wind_sea_and_swell': 3,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'hm0_minimum': 0.01,\n", " 'type_of_h_max': 3,\n", " 'duration': 10800.0,\n", " 'distance_above_bed_for_particle_velocity': 0.0,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 360.0,\n", " 'Total_wave_parameters': {'Significant_wave_height': 1,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 1,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 1,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 1,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Wind_sea_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Swell_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0}},\n", " 'INPUT_PARAMETERS': {'Touched': 1,\n", " 'Surface_elevation': 0,\n", " 'Water_depth': 0,\n", " 'Current_velocity_components': 0,\n", " 'Wind_speed': 0,\n", " 'Wind_direction': 0,\n", " 'Ice_concentration': 0},\n", " 'MODEL_PARAMETERS': {'Touched': 1,\n", " 'Wind_friction_speed': 0,\n", " 'Roughness_length': 0,\n", " 'Drag_coefficient': 0,\n", " 'Charnock_constant': 0,\n", " 'Friction_coefficient': 0,\n", " 'Breaking_parameter_gamma': 0,\n", " 'Courant_number': 0,\n", " 'Time_step_factor': 0,\n", " 'Convergence_angle': 0,\n", " 'Length': 0,\n", " 'Area': 0,\n", " 'Threshold_period': 0,\n", " 'Roller_area': 0,\n", " 'Roller_dissipation': 0,\n", " 'Breaking_index': 0},\n", " 'SPECTRAL_PARAMETERS': {'Touched': 1,\n", " 'separation_of_wind_sea_and_swell': 3.0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'wave_energy': 1,\n", " 'wave_action': 0,\n", " 'zeroth_moment_of_wave_action': 0,\n", " 'first_moment_of_wave_action': 0,\n", " 'wave_energy_wind_sea': 0,\n", " 'wave_energy_swell': 0}},\n", " 'OUTPUT_4': {'Touched': 1,\n", " 'include': 1,\n", " 'title': 'Spectrum in a point',\n", " 'file_name': 'spectrum_x20km_y20km.dfsu',\n", " 'type': 4,\n", " 'format': 0,\n", " 'flood_and_dry': 2,\n", " 'coordinate_type': 'UTM-32',\n", " 'zone': 0,\n", " 'input_file_name': '||',\n", " 'input_format': 1,\n", " 'interpolation_type': 2,\n", " 'use_end_time': 1,\n", " 'first_time_step': 0,\n", " 'last_time_step': 450,\n", " 'time_step_frequency': 10,\n", " 'number_of_points': 1,\n", " 'POINT_1': {'name': 'POINT_1', 'x': 38000.0, 'y': 20000.0},\n", " 'LINE': {'npoints': 3,\n", " 'x_first': 0.0,\n", " 'y_first': 0.0,\n", " 'x_last': 40000.0,\n", " 'y_last': 40000.0},\n", " 'AREA': {'number_of_points': 4,\n", " 'POINT_1': {'x': -400.0, 'y': -400.0},\n", " 'POINT_2': {'x': -400.0, 'y': 40400.0},\n", " 'POINT_3': {'x': 40400.0, 'y': 40400.0},\n", " 'POINT_4': {'x': 40400.0, 'y': -400.0},\n", " 'orientation': 0.0,\n", " 'x_origo': 0.0,\n", " 'x_ds': 2105.263157894737,\n", " 'x_npoints': 20,\n", " 'y_origo': 0.0,\n", " 'y_ds': 2105.263157894737,\n", " 'y_npoints': 20,\n", " 'z_origo': -15.00000000000001,\n", " 'z_ds': 2.000000000000001,\n", " 'z_npoints': 10},\n", " 'INTEGRAL_WAVE_PARAMETERS': {'Touched': 1,\n", " 'type_of_spectrum': 1,\n", " 'minimum_frequency': 0.054321,\n", " 'maximum_frequency': 0.0987654321,\n", " 'separation_of_wind_sea_and_swell': 3,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'hm0_minimum': 0.01,\n", " 'type_of_h_max': 3,\n", " 'duration': 10800.0,\n", " 'distance_above_bed_for_particle_velocity': 0.0,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 360.0,\n", " 'Total_wave_parameters': {'Significant_wave_height': 1,\n", " 'Maximum_wave_height': 1,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 1,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 1,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 1,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Wind_sea_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Swell_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0}},\n", " 'INPUT_PARAMETERS': {'Touched': 1,\n", " 'Surface_elevation': 0,\n", " 'Water_depth': 0,\n", " 'Current_velocity_components': 0,\n", " 'Wind_speed': 0,\n", " 'Wind_direction': 0,\n", " 'Ice_concentration': 0},\n", " 'MODEL_PARAMETERS': {'Touched': 1,\n", " 'Wind_friction_speed': 0,\n", " 'Roughness_length': 0,\n", " 'Drag_coefficient': 0,\n", " 'Charnock_constant': 0,\n", " 'Friction_coefficient': 0,\n", " 'Breaking_parameter_gamma': 0,\n", " 'Courant_number': 0,\n", " 'Time_step_factor': 0,\n", " 'Convergence_angle': 0,\n", " 'Length': 0,\n", " 'Area': 0,\n", " 'Threshold_period': 0,\n", " 'Roller_area': 0,\n", " 'Roller_dissipation': 0,\n", " 'Breaking_index': 0},\n", " 'SPECTRAL_PARAMETERS': {'Touched': 1,\n", " 'separation_of_wind_sea_and_swell': 3.0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'wave_energy': 1,\n", " 'wave_action': 0,\n", " 'zeroth_moment_of_wave_action': 0,\n", " 'first_moment_of_wave_action': 0,\n", " 'wave_energy_wind_sea': 0,\n", " 'wave_energy_swell': 0}},\n", " 'OUTPUT_5': {'Touched': 1,\n", " 'include': 1,\n", " 'title': 'Spectrum in a point',\n", " 'file_name': 'spectrum_x10km_y40km.dfsu',\n", " 'type': 4,\n", " 'format': 0,\n", " 'flood_and_dry': 2,\n", " 'coordinate_type': 'UTM-32',\n", " 'zone': 0,\n", " 'input_file_name': '||',\n", " 'input_format': 1,\n", " 'interpolation_type': 2,\n", " 'use_end_time': 1,\n", " 'first_time_step': 0,\n", " 'last_time_step': 450,\n", " 'time_step_frequency': 10,\n", " 'number_of_points': 1,\n", " 'POINT_1': {'name': 'POINT_1', 'x': 10000, 'y': 40000},\n", " 'LINE': {'npoints': 3,\n", " 'x_first': 0.0,\n", " 'y_first': 0.0,\n", " 'x_last': 40000.0,\n", " 'y_last': 40000.0},\n", " 'AREA': {'number_of_points': 4,\n", " 'POINT_1': {'x': -400.0, 'y': -400.0},\n", " 'POINT_2': {'x': -400.0, 'y': 40400.0},\n", " 'POINT_3': {'x': 40400.0, 'y': 40400.0},\n", " 'POINT_4': {'x': 40400.0, 'y': -400.0},\n", " 'orientation': 0.0,\n", " 'x_origo': 0.0,\n", " 'x_ds': 2105.263157894737,\n", " 'x_npoints': 20,\n", " 'y_origo': 0.0,\n", " 'y_ds': 2105.263157894737,\n", " 'y_npoints': 20,\n", " 'z_origo': -15.00000000000001,\n", " 'z_ds': 2.000000000000001,\n", " 'z_npoints': 10},\n", " 'INTEGRAL_WAVE_PARAMETERS': {'Touched': 1,\n", " 'type_of_spectrum': 1,\n", " 'minimum_frequency': 0.054321,\n", " 'maximum_frequency': 0.0987654321,\n", " 'separation_of_wind_sea_and_swell': 3,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'hm0_minimum': 0.01,\n", " 'type_of_h_max': 3,\n", " 'duration': 10800.0,\n", " 'distance_above_bed_for_particle_velocity': 0.0,\n", " 'minimum_direction': 0.0,\n", " 'maximum_direction': 360.0,\n", " 'Total_wave_parameters': {'Significant_wave_height': 1,\n", " 'Maximum_wave_height': 1,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 1,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 1,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 1,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Wind_sea_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0},\n", " 'Swell_parameters': {'Significant_wave_height': 0,\n", " 'Maximum_wave_height': 0,\n", " 'Peak_wave_period': 0,\n", " 'Wave_period_t01': 0,\n", " 'Wave_period_t02': 0,\n", " 'Wave_period_tm10': 0,\n", " 'Peak_wave_direction': 0,\n", " 'Mean_wave_direction': 0,\n", " 'Directional_standard_deviation': 0,\n", " 'Wave_velocity_components': 0,\n", " 'Radiation_stresses': 0,\n", " 'Particle_velocities': 0,\n", " 'Wave_power': 0}},\n", " 'INPUT_PARAMETERS': {'Touched': 1,\n", " 'Surface_elevation': 0,\n", " 'Water_depth': 0,\n", " 'Current_velocity_components': 0,\n", " 'Wind_speed': 0,\n", " 'Wind_direction': 0,\n", " 'Ice_concentration': 0},\n", " 'MODEL_PARAMETERS': {'Touched': 1,\n", " 'Wind_friction_speed': 0,\n", " 'Roughness_length': 0,\n", " 'Drag_coefficient': 0,\n", " 'Charnock_constant': 0,\n", " 'Friction_coefficient': 0,\n", " 'Breaking_parameter_gamma': 0,\n", " 'Courant_number': 0,\n", " 'Time_step_factor': 0,\n", " 'Convergence_angle': 0,\n", " 'Length': 0,\n", " 'Area': 0,\n", " 'Threshold_period': 0,\n", " 'Roller_area': 0,\n", " 'Roller_dissipation': 0,\n", " 'Breaking_index': 0},\n", " 'SPECTRAL_PARAMETERS': {'Touched': 1,\n", " 'separation_of_wind_sea_and_swell': 3.0,\n", " 'threshold_frequency': 0.125,\n", " 'maximum_threshold_frequency': 0.125,\n", " 'wave_energy': 1,\n", " 'wave_action': 0,\n", " 'zeroth_moment_of_wave_action': 0,\n", " 'first_moment_of_wave_action': 0,\n", " 'wave_energy_wind_sea': 0,\n", " 'wave_energy_swell': 0}}}}}}" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs.to_dict()" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "# write to yaml file\n", "import yaml\n", "yaml.dump(pfs.to_dict(), open('lake_modified.yaml', 'w+'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create\n", "\n", "A PFS file can also be created from a dictionary, like this:" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'CLSID': 't1_t0.dll',\n", " 'TypeName': 't1_t0',\n", " 'Setup': {'Name': 'Extract that',\n", " 'InputFileName': '|random.dfs1|',\n", " 'FirstTimeStep': 0,\n", " 'LastTimeStep': 99,\n", " 'X': 2,\n", " 'OutputFileName': '|.\\\\out2.dfs0|'}}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "setup = {\n", " \"Name\": \"Extract that\",\n", " \"InputFileName\": \"|random.dfs1|\",\n", " \"FirstTimeStep\": 0,\n", " \"LastTimeStep\": 99,\n", " \"X\": 2,\n", " \"OutputFileName\": \"|.\\\\out2.dfs0|\",\n", "}\n", "t1_t0 = {\"CLSID\": \"t1_t0.dll\", \"TypeName\": \"t1_t0\", \"Setup\": setup}\n", "t1_t0" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "CLSID: t1_t0.dll\n", "TypeName: t1_t0\n", "Setup:\n", " Name: Extract that\n", " InputFileName: '|random.dfs1|'\n", " FirstTimeStep: 0\n", " LastTimeStep: 99\n", " X: 2\n", " OutputFileName: '|.\\out2.dfs0|'" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "section = mikeio.PfsSection(t1_t0)\n", "section" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\n", "t1_t0: CLSID: t1_t0.dllTypeName: t1_t0Setup: Name: ..." ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pfs = section.to_Pfs(name=\"t1_t0\")\n", "pfs" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "pfs.write(\"extract_point.mzt\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Clean up" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "import os\n", "os.remove(\"lake_modified.pfs\")\n", "os.remove('lake_modified.yaml')\n", "os.remove(\"extract_point.mzt\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.5 ('base')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.5" }, "vscode": { "interpreter": { "hash": "7aec4f91c09090e98e6ae8203c38529831bb4a3ce54cd1b69639b53cb01a6aa9" } } }, "nbformat": 4, "nbformat_minor": 4 }