Angle-Resolved Photoemission Spectroscopy

This module contains all functions for Angle-Resolved Photoemission Spectroscopy (ARPES) data. Of the functions listed below, the higher-level functions are arpes_folder_workbook and single_log_grapher. All other functions are helper functions for these main functions. The functions are designed to read from .log log files and .pxt Cadillac files. All functions that take a folder as input are designed for a specific folder structure, which is as follows:

Main Folder
   - Analysis
   - ARPES Log Data
      - Jaina Cadillac
         - All Jaina logs here
      - System Cameras
      - Varian Cadillac
         - All Varian logs here
   - ARPES Raw Data
      - Material
         - Secondary Material
               - Sample Folder
                  - All scans
   - Data - Other

This folder structure can be easily customized for personal use if necessary.

ARPES Folder Workbook

The main function, arpes_folder_workbook, takes a folder as input, extracts data from .pxt files in the folder, and writes the data into a .xlsx file. Here is an example of how the function can be used:

from project_chameleon.arpes import arpes_folder_workbook
arpes_folder_workbook('Example/Folder/Path/XXX', 'example_excel_file.xlsx')

In this example, the folder ‘XXX’ holds the .pxt files from which data will be extracted. When referencing the file structure, it should correspond to one of the sample folders in the ARPES Raw Data section. The example Excel file should be empty before data is added. If no .xlsx file exists with the name ‘example_excel_file.xlsx’, one will be created. Once data is initially written, more can be appended to the same file if new data files need to be included.

The function extracts the following data from the .pxt and .log files:

  • Scan Number/File Name

  • Date

  • Scan Start Time

  • Scan End Time

  • Notes/Comments added to the scan

  • (X, Y, Z) coordinates for the scan

  • Theta (encoder) value

  • Phi (encoder) value

  • Kinetic Energy Range

  • Step Size

  • Temperature (Diode A, Diode B)

  • Run Mode

  • Acquisition Mode

  • Number of Sweeps and Layers

  • Pass Energy

  • Analyzer Slit

  • Pressure

  • Photon Energy

Below are more details on both the main and helper functions included in the ARPES module.

arpes.analyzer_slit_row(slit, workbook_name)

analyzer_slit_row is a function that creates a row in an excel .xlsx file with a specific premade format containing the slit information. This row is inserted each time there is a change the analyzer slit value.

Args:

slit a string that is the value of the analyzer slit that is passed. workbook_name is a string or a path that must end with ‘.xlsx’.

Returns:

Does not return anything. Creates a row within an excel file.

Exceptions:

workbook_name must end with ‘.xslx’.

arpes.arpes_folder_workbook(folder_name, workbook_name)

arpes_folder_workbook is a function that creates a workbook, looks through the folder to see how many scans there are, extracts values from .pxt, jaina, and varian files for each scan, and creates a row with the extracted values for each scan. This function utilizes functionality of build_arpes_workbook and insert_scan_row.

Args:

folder_name is a string or a path. workbook_name is a string or a path that must end with ‘.xlsx’.

Returns:

Does not return anything. Creates a workbook with a row for each .pxt file in the folder.

Exceptions:

folder_name must be a directory. workbook_name must end with ‘.xlsx’.

arpes.build_arpes_workbook(workbook_name)

build_arpes_workbook is a function that creates an excel .xlsx file with a specific premade format. This format is used to hold ARPES data. The function is used to create a new workbook for data to be put into in the arpes_folder_workbook function.

Args:

workbook_name is a string or path that must end with ‘.xlsx’.

Returns:

Does not return anything. Creates an excel file with a premade format.

Exceptions:

workbook_name must end with ‘.xslx’.

arpes.get_jaina_values(jaina_file, date_time=None)

get_jaina_values is a function that extracts values from the ‘jaina’ .log file. This function does not extract all values, only relevant values. This function was designed for the ‘jaina’ logs generated from the ARPES machine on which this function was designed.

Args:

jaina_file is a string or path that end with ‘.log’.``date_time`` is an array of length 2, that holds a date and a time. date_time is an optional input parameter.

Returns:

Returns a 1 dimensional array that holds relevant values from the varian file.

Exceptions:

jaina_file must end with ‘.log’. jaina_file must be a file.

arpes.get_sec(time_str)

Get seconds from time.

arpes.get_varian_values(varian_file, date_time=None)

get_varian_values is a function that extracts values from the ‘varian’ .log file. This function does not extract all values, only relevant values. This function was designed for the ‘varian’ logs generated from the ARPES machine on which this function was designed.

Args:

varian_file is a string or path that end with ‘.log’.``date_time`` is an array of length 2, that only holds a date and a time. date_time is an optional input parameter.

Returns:

Returns a 1 dimensional array that holds relevant values from the varian file.

Exceptions:

varian_file must end with ‘.log’. varian_file must be a file.

arpes.get_wavenote_values(wavenote_file)

get_wavenote_values is a function that extracts values from the wave note of the .pxt file using HTMDEC_formats. This function does not extract all values, only values that were consiedered relevant. All relevant values are returned. Which values are considered relevant can be easily changed locally.

Args:

wavenote_file is a string or path to a ‘.pxt’ file.

Returns:

Returns a 1 dimensional array that holds relevant values from the wave note of the .pxt file.

Exceptions:

wavenote_file must end with ‘.pxt’. wavenote_file must be a file.

arpes.insert_scan_row(wavenote_file, jaina_file, varian_file, workbook_name)

insert_scan_row is a function that extracts relevant values from a .pxt wave note file, a jaina log file, a varian log file, and inserts all of the values into the first open row of the workbook workbook_name. This function utilizes the functionality of get_wavenote_values, get_jaina_values, and get_varian_values.

Args:

wavenote_file is a string or a path. jaina_file is a string or path. varian_file is a string or a path. workbook_name is a string or a path.

Returns:

Does not return anything. Inserts values into the workbook workbook_name.

Exceptions:

wavenote_file must end with ‘.pxt’. jaina_file must end with ‘.log’. varian_file must end with ‘.log’. workbook_name must end with ‘.xlsx’.

arpes.single_log_grapher(log_file, scan_folder, log_type, value)

single_log_grapher is a function that take a single Varian or Jaina log file from an ARPES scan folder and plots it. The x axis of the plot is 24 hours, the length of time of the log file, and the y axis is the value that is selected in the value variable. All scans over the time of the log will be plotted. Each scan will be in a different color. This function has been designed to handle ‘Jaina’ and ‘Varian’ log files, the types existing on the system for which this code was written. These logs may not exist, or may not be the same for all systems.

Args:

log_file is a string or a path to the log file that will be graphed, ending in ‘.log’. scan_folder is a string or a path to the folder that contains the scans that happen during the log time.``log_type`` is a string that is either ‘varian’ or ‘jaina’.``value`` is a string that is the log value that will be graphed.

Returns:

Does not return anything. Plots, displays, and saves a .png file of the plot.

Exceptions:

log_file must be a .log file. scan_folder must be a folder. scan_folder must have files in it. log_type must be either ‘varian’ or ‘jaina’. value must be a valid value.