src/core/hydrodynamics/transect.py
def update(self, coral, stormcat=0):
        """
        Update the model, which is just knowing the waves

        Args:
            coral (Coral): Coral morphology to use.
            stormcat (int, optional): Storm category. Defaults to 0.

        Raises:
            ValueError: When stormcat not in [0,3] range.

        Returns:
            Tuple: Tuple containing calculated current velocity, wave velocity and wave period.
        """
        mean_current_vel = 0
        if stormcat in [0, 1, 2, 3]:
            Hs = self.wave_height[stormcat]
            T = self.wave_period[stormcat]
            max_current_vel = self.max_curr_vel[stormcat]
            h = self.water_depth
            wave_vel = (
                Hs
                / 4
                * np.sqrt(9.81 / h)
                * np.exp(-np.power((3.65 / T * np.sqrt(h / 9.81)), 2.1))
            )
        else:
            raise ValueError(f"stormcat = {stormcat}, must be either 0,1,2,3")
        if stormcat == 0:
            return mean_current_vel, wave_vel, T
        else:
            return max_current_vel, wave_vel, T

        Update the model, which is just knowing the waves

        Args:
            coral (Coral): Coral morphology to use.
            stormcat (int, optional): Storm category. Defaults to 0.

        Raises:
            ValueError: When stormcat not in [0,3] range.

        Returns:
            Tuple: Tuple containing calculated current velocity, wave velocity and wave period.
        
Update the model, which is just knowing the waves
Update the model which is just knowing the waves
def update(self, coral, stormcat=0):
        mean_current_vel = 0
        if stormcat in [0, 1, 2, 3]:
            Hs = self.wave_height[stormcat]
            T = self.wave_period[stormcat]
            max_current_vel = self.max_curr_vel[stormcat]
            h = self.water_depth
            wave_vel = (
                Hs
                / 4
                * np.sqrt(9.81 / h)
                * np.exp(-np.power((3.65 / T * np.sqrt(h / 9.81)), 2.1))
            )
        else:
            raise ValueError(f"stormcat = {stormcat}, must be either 0,1,2,3")
        if stormcat == 0:
            return mean_current_vel, wave_vel, T
        else:
            return max_current_vel, wave_vel, T
def update ( self , coral , stormcat = 0 ) : mean_current_vel = 0 if stormcat in [ 0 , 1 , 2 , 3 ] : Hs = self . wave_height [ stormcat ] T = self . wave_period [ stormcat ] max_current_vel = self . max_curr_vel [ stormcat ] h = self . water_depth wave_vel = ( Hs / 4 * np . sqrt ( 9.81 / h ) * np . exp ( - np . power ( ( 3.65 / T * np . sqrt ( h / 9.81 ) ) , 2.1 ) ) ) else : raise ValueError ( f"stormcat = {stormcat}, must be either 0,1,2,3" ) if stormcat == 0 : return mean_current_vel , wave_vel , T else : return max_current_vel , wave_vel , T
Update the model, which is just knowing the waves
Update the model which is just knowing the waves
"""
        Update the model, which is just knowing the waves

        Args:
            coral (Coral): Coral morphology to use.
            stormcat (int, optional): Storm category. Defaults to 0.

        Raises:
            ValueError: When stormcat not in [0,3] range.

        Returns:
            Tuple: Tuple containing calculated current velocity, wave velocity and wave period.
        """
Tuple containing calculated current velocity, wave velocity and wave period.
Tuple containing calculated current velocity wave velocity and wave period .
Tuple
When stormcat not in [0,3] range.
When stormcat not in [ 0 3 ] range .
ValueError
self
coral
Coral morphology to use.
Coral morphology to use .
stormcat
Storm category. Defaults to 0.
Storm category . Defaults to 0 .
0