compass.landice.mesh.set_cell_width

compass.landice.mesh.set_cell_width(self, section, thk, bed=None, vx=None, vy=None, dist_to_edge=None, dist_to_grounding_line=None, flood_fill_iStart=None, flood_fill_jStart=None)[source]

Set cell widths based on settings in config file to pass to mpas_tools.mesh.creation.build_mesh.build_planar_mesh(). Requires the following options to be set in the given config section: min_spac, max_spac, high_log_speed, low_log_speed, high_dist, low_dist,``cull_distance``, use_speed, use_dist_to_edge, and use_dist_to_grounding_line.

Parameters:
  • section (str) – Section of the config file from which to read parameters

  • thk (numpy.ndarray) – Ice thickness field from gridded dataset, usually after trimming to flood fill mask

  • bed (numpy.ndarray) – Bed topography from gridded dataset

  • vx (numpy.ndarray, optional) – x-component of ice velocity from gridded dataset, usually after trimming to flood fill mask. Can be set to None if use_speed == False in config file.

  • vy (numpy.ndarray, optional) – y-component of ice velocity from gridded dataset, usually after trimming to flood fill mask. Can be set to None if use_speed == False in config file.

  • dist_to_edge (numpy.ndarray, optional) – Distance from each cell to ice edge, calculated in separate function. Can be set to None if use_dist_to_edge == False in config file and you do not want to set large cell_width where cells will be culled anyway, but this is not recommended.

  • dist_to_grounding_line (numpy.ndarray, optional) – Distance from each cell to grounding line, calculated in separate function. Can be set to None if use_dist_to_grounding_line == False in config file.

  • flood_fill_iStart (int, optional) – x-index location to start flood-fill when using bed topography

  • flood_fill_jStart (int, optional) – y-index location to start flood-fill when using bed topography

Returns:

cell_width (numpy.ndarray) – Desired width of MPAS cells based on mesh desnity functions to pass to mpas_tools.mesh.creation.build_mesh.build_planar_mesh().