> For the complete documentation index, see [llms.txt](https://mpqc.swcmicroscopy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mpqc.swcmicroscopy.com/analysis-and-summaries/power.md). Agents can also search and read this documentation through its [MCP server](https://mpqc.swcmicroscopy.com/~gitbook/mcp).

# Power

Power measurements designed to check that the scanimage calibration is accurate and find the min and max laser values from the objective. This tool can also be used to monitor the health and outputs of the laser in the microscope setup. NOTE: This is not a replacement for scanimage power calibration which must be done prior to running this code.

## mpqc.record.power

The code interfaces with the Thorlabs family of powermeters. A sensor placed under the objective of the microscope to measure the power at the objective.&#x20;

NOTE: The Thorlabs OPM software MUST be installed prior to plugging the powermeter into the computer for the first time. The powermeter connects to the computer via USB.

Once the powermeter is connected to the computer, place the sensor under the objective and move the z position so that they are close together. Run:

```
mpqc.record.power
```

In the command line, the user will be prompted to input the laser wavelength and which beam to measure (select 1 if there is only one laser in the system). Then a GUI will open to control the powermeter. Zero the sensor and then press measure power curve.

<figure><img src="https://1521207187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3zmCqXEmICTAPZjyGAIY%2Fuploads%2FsQmnGtXpmFFqtAFKon9o%2FpowerGUI.PNG?alt=media&amp;token=d4084e82-ab5f-47d3-a8a0-f964fd17074f" alt=""><figcaption></figcaption></figure>

After power is measured, the data can be saved and set as the scanimage laser power calibration.

## mpqc.plot.power

The left side plot shows the power given by scanimage in blue, the mean observed power in the fine red line, and the fit of the observed power in the bold red line. The right plot shows the difference between the observed power and the scanimage listed power.&#x20;

<figure><img src="https://1521207187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3zmCqXEmICTAPZjyGAIY%2Fuploads%2FAEB8gnTvG5TMy4yn8P62%2Fplot_power.PNG?alt=media&amp;token=fae3172a-e037-419d-8c30-f08c5e355d0e" alt=""><figcaption></figcaption></figure>

## mpqc.longitudinal.power

Function displays the maximum laser power recorded on each date and the scanimage percent when the power is 100mW.&#x20;

```
mpqc.longitudinal.power(maintenance_folder_path, varargin)
```

```
Optional inputs:
 'startDate', 'year-month-day'
  mpqc.longitudinal.power(maintennace_folder_path,'startDate','2024-06-20')
  Plots all data from given day forward
  
 'wavelength', value
  mpqc.longitudinal.power(maintenance_folder_path,'wavelength',800)
  Plots measurements taken at specific wavelengths
```

<figure><img src="https://1521207187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3zmCqXEmICTAPZjyGAIY%2Fuploads%2FGFPUAES19Ags3oN2YPP6%2Flong_power.PNG?alt=media&amp;token=d93a148e-6c7d-49e8-b736-c2f3f6036cfe" alt=""><figcaption></figcaption></figure>
