read_2d_mesh_to_unstruct

subsurface.reader.mesh.surfaces_api.read_2d_mesh_to_unstruct(reader_args: subsurface.reader.readers_data.ReaderUnstructuredHelper, raw_data_options: Optional[subsurface.reader.readers_data.RawDataOptions] = None, delaunay: bool = True)subsurface.structs.base_structures.unstructured_data.UnstructuredData[source]

Reads in csv files with n table columns and returns UnstructuredData object. m cells have to be in m columns named with the order of the points. If no cells are present default ones are generated.

Vertex will be read from columns named x, y, z and cells from e1, e2, e3. You can use columns_map to map the required column names to any other name.

Parameters
  • path_to_file (str) – Filepath.

  • columns_map (dict) – Dictionary with format: {‘csv_columns_name1’: ‘x’, ‘csv_columns_name2’: ‘y’, …}

  • attribute_cols (dict ()) – t-element dict with the column names as keys and the column indices as the values

  • delaunay (bool) – If True compute cells using vtk Dalauny algorithm.

  • swap_yz (bool) – If True swap yz axis (left hand to right hand coord system).

  • reader_kwargspandas.read_csv kwargs

Returns

(UnstructuredData) csv with n columns stored in pandas.DataFrame of vertices with 3 columns (3d vertices), cells of m columns forming an m-sided polygon and pandas.DataFrame of attributes with n-(m+3) columns.