result_network.ResultReach

result_network.ResultReach(self, reaches, res1d)

Class for wrapping a list of ResultData reaches having the same reach name.

Parameters

Name Type Description Default
reaches A list of MIKE 1D IRes1DReach objects having the same reach name. required
res1d Res1D Res1D object the reach belongs to. required

Attributes

Name Type Description
chainage_label str A label, which is appended to all chainage attributes The value used is chainage_label = ‘m_’
data_items list of IDataItems objects. A list of MIKE 1D IDataItems objects corresponding to a given reach name.
result_gridpoints list of lists of ResultGridPoint objects. A list containing lists of ResultGridPoint objects. Every list of ResultGridPoint objects correspond to a unique IRes1DReach.
current_reach_result_gridpoints list of ResultGridPoint objects. List of ResultGridPoint objects of currently processed IRes1DReach object. It is updated in set_gridpoints method.

Methods

Name Description
add_derived_quantity Add a derived quantity to the result location.
add_query Add a query to ResultNetwork.queries list.
add_res1d_reach Add a IRes1DReach to ResultReach.
add_to_network_result_quantity_map Add a ResultQuantity to map of all possible ResultQuantities.
add_to_result_quantity_map Add to a given result quantity map.
add_to_result_quantity_maps Add a quantity to the result quantity maps.
create_reach_span_tag Create reach span tag to be set on ResultGridPoint.
get_m1d_dataset Get IRes1DDataSet object associated with ResultReach.
get_query Get a query for a data item.
interpolate_reach_critical_level Interpolate the critical level at a given chainage by linear interpolation from the bounding node critical levels.
interpolate_reach_ground_level Interpolate the ground level at a given chainage by linear interpolation from the bounding node ground levels.
read Read the time series data for all quantities at this location into a DataFrame.
remove_derived_quantity Remove a derived quantity from the result location.
set_gridpoint Assign chainage attribute to a current ResultReach object from a data provided by IRes1DReach and IRes1DGridPoint.
set_gridpoint_data_items Assign data items to ResultGridPoint object belonging to current ResultReach from IRes1DReach data items.
set_gridpoints Assign chainage attributes to a current ResultReach object from a data provided by IRes1DReach.
set_quantities Set all quantity attributes.
set_quantity Set a single quantity attribute on the obj.
set_quantity_derived Set a single derived quantity attribute on the obj.
set_static_attribute Add static attribute. This shows up in the html repr.
set_static_attributes Set static attributes. These show up in the html repr.

add_derived_quantity

result_network.ResultReach.add_derived_quantity(derived_quantity)

Add a derived quantity to the result location.

add_query

result_network.ResultReach.add_query(data_item)

Add a query to ResultNetwork.queries list.

add_res1d_reach

result_network.ResultReach.add_res1d_reach(reach)

Add a IRes1DReach to ResultReach.

Parameters

Name Type Description Default
reach A MIKE 1D IRes1DReach object. required

add_to_network_result_quantity_map

result_network.ResultReach.add_to_network_result_quantity_map(result_quantity)

Add a ResultQuantity to map of all possible ResultQuantities.

Parameters

Name Type Description Default
result_quantity ResultQuantity ResultQuantity object to be added to the result_quantity_map. required

Returns

Type Description
TimeSeriesId The TimeSeriesId key of the added ResultQuantity

add_to_result_quantity_map

result_network.ResultReach.add_to_result_quantity_map(quantity_id, result_quantity, result_quantity_map)

Add to a given result quantity map.

Parameters

Name Type Description Default
quantity_id str Quantity id. required
result_quantity ResultQuantity One of the possible ResultQuantity objects corresponding to a quantity id. required
result_quantity_map dict Dictionary from quantity id to a list of ResultQuantity objects. required

add_to_result_quantity_maps

result_network.ResultReach.add_to_result_quantity_maps(quantity_id, result_quantity)

Add a quantity to the result quantity maps.

create_reach_span_tag

result_network.ResultReach.create_reach_span_tag(gridpoints)

Create reach span tag to be set on ResultGridPoint.

get_m1d_dataset

result_network.ResultReach.get_m1d_dataset(m1d_dataitem=None)

Get IRes1DDataSet object associated with ResultReach.

A ResultReach may consist of several IRes1DDataSet objects. Therefore, a IRes1DDataItem must be provided to identify the correct IRes1DDataSet.

Parameters

Name Type Description Default
m1d_dataitem The IRes1DDataItem associated with the returned IRes1DDataSet. None

Returns

Type Description
IRes1DDataSet IRes1DDataSet object associated with ResultReach.

get_query

result_network.ResultReach.get_query(data_item)

Get a query for a data item.

interpolate_reach_critical_level

result_network.ResultReach.interpolate_reach_critical_level(chainage)

Interpolate the critical level at a given chainage by linear interpolation from the bounding node critical levels.

Parameters

Name Type Description Default
chainage float Chainage for which to interpolate the critical level. required

Returns

Type Description
float Interpolated critical level.

interpolate_reach_ground_level

result_network.ResultReach.interpolate_reach_ground_level(chainage)

Interpolate the ground level at a given chainage by linear interpolation from the bounding node ground levels.

Parameters

Name Type Description Default
chainage float Chainage for which to interpolate the ground level. required

Returns

Type Description
float Interpolated ground level.

read

result_network.ResultReach.read(column_mode=None)

Read the time series data for all quantities at this location into a DataFrame.

Parameters

Name Type Description Default
column_mode str | ColumnMode(optional) Specifies the type of column index of returned DataFrame. ‘all’ - column MultiIndex with levels matching TimeSeriesId objects. ‘compact’ - same as ‘all’, but removes levels with default values. ‘timeseries’ - column index of TimeSeriesId objects None

remove_derived_quantity

result_network.ResultReach.remove_derived_quantity(derived_quantity)

Remove a derived quantity from the result location.

set_gridpoint

result_network.ResultReach.set_gridpoint(reach, gridpoint, tag='')

Assign chainage attribute to a current ResultReach object from a data provided by IRes1DReach and IRes1DGridPoint.

Parameters

Name Type Description Default
reach A MIKE 1D IRes1DReach object. required
gridpoint A MIKE 1D IRes1DGridPoint object. required

set_gridpoint_data_items

result_network.ResultReach.set_gridpoint_data_items(reach)

Assign data items to ResultGridPoint object belonging to current ResultReach from IRes1DReach data items.

Parameters

Name Type Description Default
reach A MIKE 1D IRes1DReach object. required

set_gridpoints

result_network.ResultReach.set_gridpoints(reach)

Assign chainage attributes to a current ResultReach object from a data provided by IRes1DReach.

Parameters

Name Type Description Default
reach A MIKE 1D IRes1DReach object. required

set_quantities

result_network.ResultReach.set_quantities()

Set all quantity attributes.

set_quantity

result_network.ResultReach.set_quantity(obj, data_item, element_index=0)

Set a single quantity attribute on the obj.

set_quantity_derived

result_network.ResultReach.set_quantity_derived(derived_quantity)

Set a single derived quantity attribute on the obj.

set_static_attribute

result_network.ResultReach.set_static_attribute(name)

Add static attribute. This shows up in the html repr.

set_static_attributes

result_network.ResultReach.set_static_attributes()

Set static attributes. These show up in the html repr.