matcal.full_field.data_importer

The classes and functions in this module are intended to import data into MatCal from external sources for use in MatCal studies.

Functions

FieldSeriesData(global_filename[, ...])

A function used to import a MatCal Data object from series field data.

mesh_file_to_skeleton(mesh_filename[, ...])

This will load a mesh file and return a data structure containing the mesh cloud points, connectivity and side set information.

Classes

CSVFieldDataSeriesParser(global_data_file, ...)

Class used to import a series of field data from file sources.

ImportedTwoDimensionalMesh(mesh_filename)

MeshFileScraperSelector([default])

matcal.full_field.data_importer.FieldSeriesData(global_filename, series_directory='./', position_names=['X', 'Y'], state=<matcal.core.state.SolitaryState object>, file_type=None, n_cores=1)[source]

A function used to import a MatCal Data object from series field data. The user needs to use this function to load experimental data from a file or series of files into MatCal

Parameters:
  • global_filename – the name of the file or primary file to be loaded.

  • series_directory (str) – the name of the directory where all files are located. Defaults to current working directory.

  • position_names (list(str)) – optional names of the fields that store point/nodal coordinates. Defaults to [‘X’, ‘Y’].

  • state (State) – optional state to be assigned to the data being imported

  • file_type (str) – optional file type passed by the user. MatCal will attempt to guess the file type based on the file prefix. MatCal recognizes “csv”, “e” file types.

  • n_cores – the number of cores to be used to load the data. This is only active when reading file data from separate files such as DIC data saved as CSV files.

Returns:

a populated FieldData object.

class matcal.full_field.data_importer.FieldDataParserBase(data_file, series_directory, n_cores=1)[source]
set_state(state)[source]

Sets the optional state value for the data.

Parameters:

state (State) – The state for this particular data set.

abstractmethod get_frame(frame_index)[source]

returns a Data instance

abstractmethod get_global_data()[source]

returns a Data instance

abstractmethod get_surfaces() dict[source]

Returns a dict of the surfaces names to their corresponding nodes, 0 indexed

class matcal.full_field.data_importer.CSVFieldDataSeriesParser(global_data_file, series_directory, n_cores=1, file_type=None)[source]

Class used to import a series of field data from file sources. The file must contain a field called “file”, which lists the filenames for the field data files.

Parameters:
  • global_data_filename – path to a csv file containing the series filenames_list, and respective global variables.

  • series_directory – path to directory containing the field data snapshots described in the global data file.

property number_of_frames

Get the number of frames present in the data series. Frames align with the different time steps, if applicable.

property global_field_names

get a list of the imported global field names

Returns:

the field names

Return type:

list

property state
Returns:

The physical state of the data corresponding to the experimental conditions.

Return type:

State

property node_field_names

get a list of the imported node field names

Returns:

the field names

Return type:

list

get_frame(frame_index)[source]

Return an instance of the appropriate field data object.

Parameters:

frame_index (int) – index of frame data desired. (0 indexed)

Returns:

frame data

Return type:

matcal.full_field.data.FieldData

get_global_data()[source]

Return all global field data as MatCal Data class.

Return type:

Data

get_surfaces() dict[source]

Returns a dict of the surfaces names to their corresponding nodes, 0 indexed

set_state(state)

Sets the optional state value for the data.

Parameters:

state (State) – The state for this particular data set.

class matcal.full_field.data_importer.MeshFileScraperSelector(default=None)[source]
register(key, value)

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

matcal.full_field.data_importer.mesh_file_to_skeleton(mesh_filename: str, subset_name: str = None) MeshSkeleton[source]

This will load a mesh file and return a data structure containing the mesh cloud points, connectivity and side set information.

class matcal.full_field.data_importer.ImportedTwoDimensionalMesh(mesh_filename)[source]