ECOdyagnostics/diagnostics/energetics.py
def center_of_gravity_h(self, T, S, z, eos, Z_r=0, T_ref=10, S_ref=35, output_position='T', **maskargs):
        """
        Computes the position of the center of mass.
        Returns the location for each axis. Operates on a 3D grid.
        """
        try:
            pos = self.ops._get_position(T)
        except:
            pos = 'T'

        g = self.properties.constants['g']
        if self.ops._matching_pos(z,'T'):
            pass
        else:
            Exception('depth has the wrong position {}. Please provide a depth on T position.'.format(self.ops._get_position(z)))

        h = self.dynamic_enthalpy(T, S, z, eos, Z_r=Z_r, T_ref=T_ref, S_ref=S_ref, output_position=output_position, **maskargs)
        zg =self.ops.average(h, ['X','Y','Z'],**maskargs) / g

        return zg

        Computes the position of the center of mass.
        Returns the location for each axis. Operates on a 3D grid.
        
Computes the position of the center of mass.
Returns the location for each axis. Operates on a 3D grid.
Computes the position of the center of mass . Returns the location for each axis . Operates on a 3D grid .
def center_of_gravity_h(self, T, S, z, eos, Z_r=0, T_ref=10, S_ref=35, output_position='T', **maskargs):
        try:
            pos = self.ops._get_position(T)
        except:
            pos = 'T'
        g = self.properties.constants['g']
        if self.ops._matching_pos(z,'T'):
            pass
        else:
            Exception('depth has the wrong position {}. Please provide a depth on T position.'.format(self.ops._get_position(z)))
        h = self.dynamic_enthalpy(T, S, z, eos, Z_r=Z_r, T_ref=T_ref, S_ref=S_ref, output_position=output_position, **maskargs)
        zg =self.ops.average(h, ['X','Y','Z'],**maskargs) / g
        return zg
def center_of_gravity_h ( self , T , S , z , eos , Z_r = 0 , T_ref = 10 , S_ref = 35 , output_position = 'T' , ** maskargs ) : try : pos = self . ops . _get_position ( T ) except : pos = 'T' g = self . properties . constants [ 'g' ] if self . ops . _matching_pos ( z , 'T' ) : pass else : Exception ( 'depth has the wrong position {}. Please provide a depth on T position.' . format ( self . ops . _get_position ( z ) ) ) h = self . dynamic_enthalpy ( T , S , z , eos , Z_r = Z_r , T_ref = T_ref , S_ref = S_ref , output_position = output_position , ** maskargs ) zg = self . ops . average ( h , [ 'X' , 'Y' , 'Z' ] , ** maskargs ) / g return zg
Computes the position of the center of mass.
Computes the position of the center of mass .
"""
        Computes the position of the center of mass.
        Returns the location for each axis. Operates on a 3D grid.
        """
self
T
S
z
eos
Z_r
T_ref
S_ref
output_position