EmMotl#

class cryocat.core.cryomotl.EmMotl(input_motl=None, header=None)#

Bases: Motl

convert_to_motl(input_df)#

Convert input_df to correct motl_df format. In this class, it is expected to have the correct format already and no conversion is provided. If this function is called the format of the input is incorrect and error is raised.

Parameters:
input_dfpandas.DataFrame
Returns:
None
Raises:
UserInputError

The provided input_df should be in correct format

static read_in(emfile_path)#

Reads in an EM file and returns a pandas DataFrame and header.

Parameters:
emfile_pathstr

The path to the EM file.

Returns:
motl_dfpandas.DataFrame

Particle list.

headerdict

Header from the the parsed EM file.

Raises:
UserInputError

If the provided file does not exist or if it contains a different number of columns than expected.

write_out(output_path)#

Writes out the dataframe as emfile.

Parameters:
output_pathstr

Name of the file to be written out (including the path).

Returns:
None