Difference between revisions of "HOWTO Analyze a FDC Flatness Scan"

From GlueXWiki
Jump to: navigation, search
(Interpreting the Scan Data)
(Interpreting the Scan Data)
Line 42: Line 42:
 
The first page of '''Summary.txt''' is meant to provide a sense for the flatness of plane on a long scale.  The mounting rails for the laser itself are not perfectly straight. This is evidenced by a noticeable and similar "wave" in both the cathode scan and a scan of the granite slab itself (see plot on right, above). In order to remove this wave, a scan of the rock is subtracted from a scan of the cathode plane, as shown below.
 
The first page of '''Summary.txt''' is meant to provide a sense for the flatness of plane on a long scale.  The mounting rails for the laser itself are not perfectly straight. This is evidenced by a noticeable and similar "wave" in both the cathode scan and a scan of the granite slab itself (see plot on right, above). In order to remove this wave, a scan of the rock is subtracted from a scan of the cathode plane, as shown below.
  
Unfortunately, though most of the rock's surface is very flat (how flat??????????), there are several damaged areas (see surface contour plot on right).  All of this damage is due to holes that have drilled or chipped into the rock's surface, but when the laser goes out of range it may print out measurements at either extreme of it's range.  The plots therefore show some spikes in either direction.  These have been identified by hand and are indicated on the corrected plot below.  When statistics are calculated in '''Summary.txt''', these areas are ignored.
+
Unfortunately, though most of the rock's surface is very flat (to within 0.02 mm, according to a survey team), there are several damaged areas (see surface contour plot on right).  All of this damage is due to holes that have drilled or chipped into the rock's surface, but when the laser goes out of range it may print out measurements at either extreme of it's range.  The plots therefore show some spikes in either direction.  These have been identified by hand and are indicated on the corrected plot below.  When statistics are calculated in '''Summary.txt''', these areas are ignored.
  
 
No plane should vary more than 100 microns over the active area.  In this example, '''Summary.txt''' reports that the difference between the highest peak and lowest pit of the active area is 53 microns.
 
No plane should vary more than 100 microns over the active area.  In this example, '''Summary.txt''' reports that the difference between the highest peak and lowest pit of the active area is 53 microns.

Revision as of 23:57, 1 March 2010

Old Discussion

Old - Analyze a FDC Flatness Scan

Quick Start

Note: The following instructions run macros that should automatically be run at the end of every scan. Check if the output files already exist in the /home/laser/FLATNESS/flatness_data/images/XXX directory before going to the trouble of running these "by hand".


  1. To get started you need a scan data file.
    These have names like plane004 000deg 2008_11_06 09_26_26.txt and are generally found in the ~/laser/FLATNESS/flatness_data directory on the Linux computer kept in EEL126 next to the FDC laser scanner. Note that this computer can be accessed remotely via ssh or scp with the username and password that are posted in EEL126, or by copying the data files to a USB drive. [1].
  2. Run the snake_mktree program giving the data file as the only argument.
    e.g. snake_mktree "plane004 000deg 2008_11_06 09_26_26.txt"
    Note here that the double quotes(") surrounding the file name are needed since the filename contains spaces. The program should create a ROOT file with the same name as the input file, only with a ".root" suffix.
  3. Run the ROOT macro fdc_3Dplots.C on the resulting root file.
    This is kept in the directory ~laser/FLATNESS/macros. It can either be copied to the working directory or have the path prepended when actually running with root.
    Example: root -q -b -l 'fdc_3Dplots.C+("plane004 000deg 2008_11_06 09_26_26.root")'
    Notice the single quotes around the 'fdc_3Dplots.C+("plane004 000deg 2008_11_06 09_26_26.root")' . These are because the shell will try interpreting the parenthesis while we really want them to be passed as part of the argument. Also note the +, it is necessary to compile the macro before running it. This should create several plots saved in an images/plane004 000deg 2008_11_06 09_26_26/ subdirectory, as well as Summary.pdf. Note that this will overwrite any files already existing in the current directory with these names without asking.

Interpreting the Scan Data

Raw data from a flatness scan of "planep1a 000deg 2009_06_15 14_47_40"
Cathode (red) and granite (black) scans from scan "plane004 000deg 2008_11_06 09_26_26" and "plane999 999deg 2008_11_06 08_51_09" respectively

The root macro fdc_3Dplots.C creates many plots, but Summary.txt serves as a thorough report of cathode plane flatness. Page one is meant to indicate how flat a plane is on a long scale, while pages two and three convey flatness on a small scale. The rest of the plots that are created are blowups and rotatable versions of the plots in Summary.txt.

The scans are done with a high density of points in X (about 1.4 mm between points) and a low density in Y (1 inch between points) as shown in the plot on the left. Many of the plots generated take the mean, RMS, or max Δ of all points in a 1 inch section of a single horizontal scan. They therefore do not actually represent an area but rather, a line across that area. Scans can be taken with the cathode plane oriented at various angles in order to get a sense of the flatness in general.

Surface profile of the granite rock from "plane999 999deg 2009_06_24 12_24_17.root. The spikes indicate areas of the rock that have been damaged."

The first page of Summary.txt is meant to provide a sense for the flatness of plane on a long scale. The mounting rails for the laser itself are not perfectly straight. This is evidenced by a noticeable and similar "wave" in both the cathode scan and a scan of the granite slab itself (see plot on right, above). In order to remove this wave, a scan of the rock is subtracted from a scan of the cathode plane, as shown below.

Unfortunately, though most of the rock's surface is very flat (to within 0.02 mm, according to a survey team), there are several damaged areas (see surface contour plot on right). All of this damage is due to holes that have drilled or chipped into the rock's surface, but when the laser goes out of range it may print out measurements at either extreme of it's range. The plots therefore show some spikes in either direction. These have been identified by hand and are indicated on the corrected plot below. When statistics are calculated in Summary.txt, these areas are ignored.

No plane should vary more than 100 microns over the active area. In this example, Summary.txt reports that the difference between the highest peak and lowest pit of the active area is 53 microns.

The scan of the granite rock (center), is subtracted from a scan of the cathode plane (left). The resulting plot on the right has several bins labeled as "ignored bins". These are ignored when calculating statistics because the granite rock has several holes drilled into it.
Example of the mean value of a cathode plane from scan "plane004 000deg 2008_11_06 09_26_26"
Example of the mean value of the granite slab from scan "plane999 999deg 2008_11_06 08_51_09"

The second page of Summary.txt contains plots of the RMS of each one inch bin described above (see plot on left). For now, the limit for an acceptable RMS is 100 microns. Any bin with an RMS larger than this must be examined to determine the source of the error. In this example, the single red bin in the active area is due to a single datapoint that ~.5 mm away from it's neighbors. Upon inspection of the cathode plane, no damage was found in this area.

The third page contains plots of difference between the largest and smallest datapoint within a bin (see plot on right). This gives another view of flatness on a small scale. The limit for an acceptable "Max Δ" has not yet been determined.


It easy to prove that a 2D mean plot accurately indicates where the granite rock has been damaged by examining the images below. The image on the left is a photo of the granite slab and the one on the right is the same, but with the mean plot from the scan data overlayed.

20081120 granite slab.jpg 20081120 granite plot overlay.jpg

First order correction to the data

The two plots below show a scan of the granite rock before and after a linear correction was performed on the data. The plot on the right has a linear correction of 500 microns per 97cm. While structure can still be seen in the corrected plot, only 3 colors from the color ramp are present indicating about a 150 micron maximum variation over the active area.

Example of the mean value of the granite slab from scan "plane999 999deg 2008_12_02 13_29_13"
Example of the corrected mean value of the granite slab from scan "plane999 000deg 2008_12_02 13_29_13"

The two plots below are of the RMS values of 1 inch bins corresponding to the two plots above. Again, the uncorrected data is plotted on the left while the (linearly) corrected data is plotted on the right. A small improvement can be seen in the light blue band at around x=20cm. The change here is between 1 and 2 colors on the color ramp indicating an improvement of between 5 and 10 microns.

Example of the rms value of the granite slab from scan "plane999 999deg 2008_12_02 13_29_13"
Example of the corrected rms value of the granite slab from scan "plane999 000deg 2008_12_02 13_29_13"

Note that the RMS of a 1 inch cell with a constant slope of the cathode plane is given by: (500microns/97cm * 2.54cm)/sqrt(12) = 3.8 microns. Second order or higher corrections to the depth measurements are expected to be no larger than the first order linear correction and should therefore not affect the overall flatness spec. reported with this system by more than, say, 10 microns.

Location of the code

The definitive location of the source code for all of the laser scanner system is kept in the Hall-D subversion repository in the following directory:

https://halldsvn.jlab.org/repos/trunk/home/davidl/FDC_laser

A working copy, however, will necessarily be kept on the FDC laser scanner computer in the ~laser/FLATNESS/src' directory.



Footnotes

  1. To copy to a USB drive, just plug the drive into the back of the computer and wait for the system to automount the disk. It will appear on the desktop where it can be accessed through the user interface. The disk itself will be mounted at a point inside the /media directory (e.g. /media/USB1). Once the relevant copies are made, make sure to unmount the disk before removing it. This can be done by right-clicking on the drive on the Desktop and selecting "unmount".


Back to Forward Drift Chamber Page