7.1.2. tobac.analysis.centerofgravity

Identify center of gravity and mass for analysis.

Functions

calculate_cog(tracks, mass, mask) Caluclate center of gravity and mass forech tracked cell.
calculate_cog_domain(mass) Caluclate center of gravity and mass for entire domain.
calculate_cog_untracked(mass, mask) Caluclate center of gravity and mass for untracked domain parts.
center_of_gravity(cube_in) Caluclate center of gravity and sum of quantity.
cog_cell(cell[, Tracks, M_total, M_liquid, …])
Parameters:
  • cell (int) – Integer id of cell to create masked cube for output.
tobac.analysis.centerofgravity.calculate_cog(tracks, mass, mask)

Caluclate center of gravity and mass forech tracked cell.

Parameters:
  • tracks (pandas.DataFrame) – DataFrame containing trajectories of cell centers.
  • mass (iris.cube.Cube) – Cube of quantity (need coordinates ‘time’, ‘geopotential_height’,’projection_x_coordinate’ and ‘projection_y_coordinate’).
  • mask (iris.cube.Cube) – Cube containing mask (int > where belonging to cloud volume, 0 everywhere else).
Returns:

tracks_out – Dataframe containing t, x, y, z positions of center of gravity and total cloud mass each tracked cells at each timestep.

Return type:

pandas.DataFrame

tobac.analysis.centerofgravity.calculate_cog_domain(mass)

Caluclate center of gravity and mass for entire domain.

Parameters:mass (iris.cube.Cube) – Cube of quantity (need coordinates ‘time’, ‘geopotential_height’,’projection_x_coordinate’ and ‘projection_y_coordinate’).
Returns:tracks_out – Dataframe containing t, x, y, z positions of center of gravity and total cloud mass.
Return type:pandas.DataFrame
tobac.analysis.centerofgravity.calculate_cog_untracked(mass, mask)

Caluclate center of gravity and mass for untracked domain parts.

Parameters:
  • mass (iris.cube.Cube) – Cube of quantity (need coordinates ‘time’, ‘geopotential_height’,’projection_x_coordinate’ and ‘projection_y_coordinate’).
  • mask (iris.cube.Cube) – Cube containing mask (int > where belonging to cloud volume, 0 everywhere else).
Returns:

tracks_out – Dataframe containing t, x, y, z positions of center of gravity and total cloud mass for untracked part of domain.

Return type:

pandas.DataFrame

tobac.analysis.centerofgravity.center_of_gravity(cube_in)

Caluclate center of gravity and sum of quantity.

Parameters:cube_in (iris.cube.Cube) – Cube (potentially masked) of quantity (need coordinates ‘geopotential_height’,’projection_x_coordinate’ and ‘projection_y_coordinate’).
Returns:
  • x (float) – X position of center of gravity.
  • y (float) – Y position of center of gravity.
  • z (float) – Z position of center of gravity.
  • variable_sum (float) – Sum of quantity of over unmasked part of the cube.
tobac.analysis.centerofgravity.cog_cell(cell, Tracks=None, M_total=None, M_liquid=None, M_frozen=None, Mask=None, savedir=None)
Parameters:
  • cell (int) – Integer id of cell to create masked cube for output.
  • Tracks (optional) – Default is None.
  • M_total (subset of cube, optional) – Default is None.
  • M_liquid (subset of cube, optional) – Default is None.
  • M_frozen (subset of cube, optional) – Default is None.
  • savedir (str) – Default is None.
Returns:

Return type:

None

Notes

unsure about anything needs a short summary