tcc_python_scripts.post_processing package

Submodules

tcc_python_scripts.post_processing.cluster_ouptut module

tcc_python_scripts.post_processing.cluster_ouptut.main()[source]

tcc_python_scripts.post_processing.net module

tcc_python_scripts.post_processing.net.net_cluster_calculation(dir_name, priority_list)[source]

Take gross TCC cluster population and calculate net cluster population.

Parameters:
  • dir_name – Directory containing python RAW output files.
  • priority_list – List of cluster names in order of priority

tcc_python_scripts.post_processing.cluster_movie_maker module

A script to take the RAW file output from the TCC and produce a combined cluster XYZ for rendering. Takes a cluster list argument and labels particles according to the list priority.

class tcc_python_scripts.post_processing.cluster_movie_maker.RawFileReader(file_stub, cluster_type)[source]

Bases: object

Reader for TCC .RAW files. Instantiation opens a file handle and the get frame method then allows the file to be read a frame at a time.

get_frame()[source]

Get a single frame of data from the raw file.

Returns:Whether the particles are in a cluster or not.
Return type:list of string
class tcc_python_scripts.post_processing.cluster_movie_maker.Snapshot[source]

Bases: object

Object representing a single configuration of a system with particle types and coordinates.

write_xyz(output_name)[source]

Write the Snapshot to an xyz file.

class tcc_python_scripts.post_processing.cluster_movie_maker.XyzFileReader(file_name)[source]

Bases: object

Generator for xyz files. Opens a file handle when the object is instantiated. Iteration then returns the file frame by frame.

static process_num_particles(line)[source]

Process the first line of an XYZ frame to make sure that it is a valid number.

Parameters:line (string) – The first line of an xyz frame.
Returns:The number of particles from line.
Return type:integer
tcc_python_scripts.post_processing.cluster_movie_maker.add_cluster_to_xyz(xyz_frame, particle_types, cluster_number)[source]

Given a list of particle types, overwrite the cluster type in xyz_frame if a particle is in a cluster.

Parameters:
  • xyz_frame (cluster_movie_maker.Snapshot) – A snapshot of the system.
  • particle_types (list of string) – Whether particles are in a cluster or not. “A” and “B” correspond to particles not in a cluster while “C” and “D” correspond to particles in a cluster
  • cluster_number (integer) – The index of the cluster in the priority
Returns:

an updated XYZ snapshot.

Return type:

cluster_movie_maker.Snapshot

tcc_python_scripts.post_processing.cluster_movie_maker.main(xyz_name, raw_stub, cluster_list)[source]

The main loop.

Returns:0 if script ran successfully.
Return type:int
tcc_python_scripts.post_processing.cluster_movie_maker.open_raw_files(cluster_list, raw_stub)[source]

Given a list of clusters, open the corresponding TCC RAW files.

Parameters:
  • cluster_list (list of string) – TCC cluster names in reverse order of priority.
  • raw_stub (string) – The base of the RAW file name relative to the working directory.
Returns:

Objects representing the open RAW files.

Return type:

list of RawFileReader

tcc_python_scripts.post_processing.cluster_movie_maker.prepare_output_file(output_filename)[source]

Open the output file once at the beginning of the analysis to delete any previous copy.

tcc_python_scripts.post_processing.cluster_movie_maker.process_arguments()[source]

Process the command line arguments and return variables with the values.

Returns:Processed command line parameters.
Return type:strings