Molecular Beam Epitaxy

This module contains functions for Molecular Beam Epitaxy (MBE) data. Of these functions, mbeparser is the main function, and the others are secondary helper functions. The main function, mbeparser, is designed to sort MBE data and provide options for data visualization. These functions were developed based on the specific file structure used in the MBE system for which this module was designed. This file structure consists solely of text files, so the functions may not work correctly with different file types or structures.

MBE Parser

The mbeparser function takes a folder containing .txt files from an MBE run, sorts the files into useful and useless categories, and allows the user to either plot a file, plot and save a file, or check a parameter value. Here is an example of how the function can be used:

from project_chameleon.mbeparser import mbeparser
mbeparser('mbe_run_folder')

In this example, the folder ‘mbe_run_folder’ holds all the files from a given MBE run. These should primarily consist of .txt files. Three subfolders will be created inside the given folder: Useful, Useless, and Output.

  • Files likely to contain relevant data are moved to the Useful folder.

  • Files unlikely to contain useful data are moved to the Useless folder.

  • Plots generated by the user are saved to the Output folder.

If the user chooses to plot a file, the function will generate a plot of the data values versus time. The plot will be color-coded to show which shutters were open at different times.

If the user chooses to check a setpoint, they must select a file containing setpoint data. The specific setpoint value will be displayed in the terminal. No file is generated for this action.

When finished, the user must select the exit option to terminate the function.

Below is more information on the main function, as well as some of the helper functions.

mbeparser.find_shutter_values(shutter_input)

find_shutter_values is a function that deciphers what shutters are open on a specific MBE run from the number given in the shutter control value text file. The number given is a combination of numbers that are 2 raised to an exponent.

Args:

shutter_input is an integer value.

Returns:

returns an array of the decompose exponents that make up the original shutter value.

Exceptions:

None

mbeparser.mbeparser(file_folder)

mbeparser() is a function to allow MBE users to parse their data more quickly and efficiently. The function allows users to sort their data into useful and non useful data, then query the useful data for specific files. When the function is run, the user can choose from three different actions: graph a chosen file, graph and save a chosen file, and check a specific setpoint. These actions can be repeated until the user chooses to exit.

Args:

file_folder should be the folder containing all .txt files generated during the MBE run.

Returns:

Does not return anything. Sorts data into two subdirectories within main directory. Displays plot of chosen file. Saves plot if users decides to save plot.

Exceptions:

file_folder must be a folder. file_folder must contain files.

mbeparser.mbeplot(useful_directory_path, filechoice, shutter_data, output_directory_path=None)

mbeplot is a function that takes an MBE measurement file and plots the contents of the file. The plot is shown and saved as a .png file. The plot shows which shutters are open during what portions of the measurement.

Args:

useful_directory_path is a string or path to the folder containing the measurement file. filechoise is a string or path to the file that will be plotted. shutter_data is an array containing the data to be plotted. output_directory_path is a string or path to the desired output directory. This parameter is optional.

Returns:

This function does not return anything. A plot of the data is saved.

Exceptions:

None