| name | check-line-scan |
| description | Instructions for checking a line scan. |
You will be given a figure generated by a tool that controls a
scanning microscope to acquire a line scan of a thin feature in a sample.
In the figure, you will see the following:
- Plot 1: A line profile plot along the scan line and a Gaussian fit to the line profile.
The FWHM of the Gaussian fit will be shown.
- Plot 2: The path of the line scan that you see in plot 1 overlaid on the last acquired 2D image.
- Plot 3: (may not be present) The path of the reference line scan
overlaid on the reference image.
When you see the figure, first verify:
- Plot 1 shows one and exactly one peak. The FWHM of the Gaussian
fit is not NaN. Correspondingly, in plot 2, the scan line should cross a thin line perpendicular
to it.
- The peak in plot 1 is well centered and complete. It is not cut off by the edges of the plot.
Correspondingly, in plot 2, you should see the scan line crosses the thin feature near
the center of the scan line. The intersection should not be too close to the edges of the scan line.
- If plot 3 is present, then also check that the relative position of the scan line to the thin feature
in plot 3 is the same as in plot 2. Note that there might be a translational offset in the scan line
and features between plot 2 and plot 3. Focus on the position of the scan line relative to other
features in the image. As long as the relative position is the same, it is good.
If all the conditions above are met, reply with the following JSON (return just the JSON, do not enclose it
in triple backticks):
{
"result": "ok"
}
If any of the conditions above are not met, use the acquire_line_scan tool
to acquire a new line scan and check it again. When plot 3 is present, make sure the relative
location of your new line scan is the same with the reference. After you manage to obtain a good
line scan, reply with the following JSON:
{
"result": "adjusted",
"new_line_scan_kwargs": <here should be a dictionary of the arguments passed to the line scan tool>,
"fwhm": <the FWHM of the Gaussian fit from the successful line scan>
}
If you are unable to find a good line scan after 5 trials, reply with the following JSON:
{
"result": "failed"
}
Note:
- The images might be very blurry. Track the middle line of blurry line features to determine their
locations relative to the scan line.
- Plot 2 and 3 might also have very different blurriness. Again, use the middle line of blurry line
features to deterine their locations. It is okay if plot 2 if much blurrier or sharper than plot 3
as long as the relative position of the scan line is the same.
Below are examples of potential problematic line scans and how to fix them.
Example of exceptions and handling in line scan (case 1)
Exception: relative position of the scan line is different from the reference, and the intersection of
the scan line with the landmark feature is away from the scan line's center. It also almost intersects
with another undesired feature.
Fix: redo line scan at x from 7 to 17, y = 7 to restore the relative location of the scan line.

<message_break>
Example of exceptions and handling in line scan (case 2)
Exception: scan line coincides with another line parallel to it, and the relative position of the line scan
is different from the reference.
Fix: redo line scan at x from 12 to 22, y = 12 to move away from the overlapping feature.

<message_break>
Example of exceptions and handling in line scan (case 3)
Exception: scan line coincides with another line parallel to it, and the relative position of the line scan
is different from the reference.
Fix: redo line scan at x from 10 to 20 and y = 10 to restore the relative location of the scan line in the reference scan.

<message_break>
Example of exceptions and handling in line scan (case 4)
Exception: the scan line does not properly cross the landmark feature.
Fix: redo line scan at x from 200, 300 and y = 150 so that the scan line crosses the isolated thin line
and the relative position of the scan line in the reference scan is restored.

<message_break>
Example of exceptions and handling in line scan (case 5)
Exception: the scan line is crossing an undesired feature and the relative position of the scan line in the reference scan is different from the reference scan.
Fix: redo the line scan at x from 10 to 20 and y = 11 to restore the relative position of the scan line in the reference scan.

<message_break>
Example of exceptions and handling in line scan (case 6)
Exception: the scan line coincides with another line and is at a different relative position compared to the reference.
Fix: redo the line scan at x from 12 to 22 and y = 13 to restore the relative position of the scan line in the reference scan.

<message_break>
Example of exceptions and handling in line scan (case 7)
Exception: intersection of landmark thin feature and scan line is away from the scan line’s center, and the relative positions
of the scan line and the landmark feature are different from the reference scan.
Fix: redo the line scan at x from 10 to 20 and y = 10.

<message_break>
Example of exceptions and handling in line scan (case 8)
Exception: intersection of landmark thin feature and scan line is away from the scan line’s center, and the scan line
crosses two thin lines instead of one.
Fix: redo the line scan at x from 10 to 20 and y = 11.

<message_break>
This concludes the examples of exceptions and handling in line scan. Now expect actual line scan images from the user.