Utils

This file contains a series of utility functions

fatbox.utils.get_times(filename)

Get times from statistics file

Parameters
  • filename (str) – Path to statistics file (from ASPECT)

  • fx (float) –

  • fy (float) –

Returns

array – Times

Return type

array

fatbox.utils.get_colors()

Get times from statistics file

Parameters
  • filename (str) – Path to statistics file (from ASPECT)

  • fx (float) –

  • fy (float) –

Returns

array – Times

Return type

array

fatbox.utils.get_labels(G, attribute)

Get labels for plotting node attributes

Parameters
  • G (nx.graph) – Graph

  • attribute (str) – Node attribute

Returns

array – Colors

Return type

array

fatbox.utils.get_edge_labels(G, attribute)

Get labels for plotting edge attributes

Parameters
  • G (nx.graph) – Graph

  • attribute (str) – Edge attribute

Returns

array – Colors

Return type

np.array

fatbox.utils.topo_line(data)

Get topography from 2-D ASPECT model

Parameters

array (np.array) – Model outpout

Returns

line – Model outpout

Return type

np.array

fatbox.utils.bottom_line(data, threshold)

Get bottom line from 2-D ASPECT model

Parameters

array (np.array) – Model outpout

Returns

line – Model outpout

Return type

np.array

fatbox.utils.save_network_for_paraview(G, attributes, nodeLabel=[], fileout='test')

Save a network in a format readable by ParaView (i.e. vtp - vtkPolyData)

Parameters
  • G (nx.graph) – Graph

  • attributes (list) – List attributes to write in vtp file

  • nodeLabel (list) – List of node labels

  • fileout (str) – Name of output file