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 28: Line 28:
 
{|
 
{|
 
|
 
|
[[Image:20081120_fdc_mean_cathode.gif|thumb|right|Example of the mean value of a cathode plane from scan "plane004 000deg 2008_11_06 09_26_26"]]
+
[[Image:flatness_plot_3d_LINES.gif|thumb|left|Raw data from a flatness scan of "planep1a 000deg 2009_06_15 14_47_40"]]
 +
 
 +
[[Image:flatness_plot_3d_TheRock.gif|thumb|right|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."]]
  
[[Image:20081120_fdc_mean_granite.gif|thumb|left|Example of the mean value of the granite slab from scan "plane999 999deg 2008_11_06 08_51_09"]]
 
  
 
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 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'''.
Line 36: Line 37:
 
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). 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.
 
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). 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.
  
The first page of '''Summary.txt''' is meant to provide an sense for the flatness of plane on a long scale.  The plots simply show the depth measured by the laser.  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. The image on the right shows the means of a scan of a cathode plane while the image on the left shows the same thing, but for the granite slab itself.  Therefore, we subtract a plot of the granite slab from a plot of the cathode plane.  As there are some holes in the surface of the granite slab, several areas have been ignored when calculating the statistics shown in '''Summary.txt'''.  See the plot on the ?????????.   
+
The first page of '''Summary.txt''' is meant to provide a sense for the flatness of plane on a long scale.  The plots simply show the depth measured by the laser.  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. The image below shows the mean depth per square inch plots of a cathode plane  of a scan of a cathode plane while the image on the left shows the same thing, but for the granite slab itself.  Therefore, we subtract a plot of the granite slab from a plot of the cathode plane.  As there are some holes in the surface of the granite slab, several areas have been ignored when calculating the statistics shown in '''Summary.txt'''.  See the plot on the ?????????.
 +
 
 +
[[Image:Flatness_plot_2d_Subtraction.gif|center|700px|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.]]
  
 
|-
 
|-

Revision as of 17:00, 29 June 2009

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"
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 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). 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.

The first page of Summary.txt is meant to provide a sense for the flatness of plane on a long scale. The plots simply show the depth measured by the laser. 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. The image below shows the mean depth per square inch plots of a cathode plane of a scan of a cathode plane while the image on the left shows the same thing, but for the granite slab itself. Therefore, we subtract a plot of the granite slab from a plot of the cathode plane. As there are some holes in the surface of the granite slab, several areas have been ignored when calculating the statistics shown in Summary.txt. See the plot on the ?????????.

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 RMS values for the cathode and granite scans are shown here on the right and left respectively. These correspond to the same bins used for the plots above of the means. In the cathode scan on the right, the 2 tape lines are easily seen while on the left, several drill holes in the granite slab show up as red spots. The color scales go from 0 to 100 microns so blue colors have an RMS of around 30 microns or less. Green is in the 50-60 micron range while red is in the 100 or more micron range.

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 animation on the right shows another view of these two scans on the same plot to further illustrate the similarity in the "wave" indicating it is the scanner and not the scannee that is the source.



One interesting thing to note is the imperfections in both the mean and the rms of the scan of the granite slab above. These correspond to drilled holes and divots in the slab's surface as shown in the 2 plots 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 slab after some effort was made to better align the system physically. A scan of the granite slab before the adjustment can be seen above. (Or you can click here.) As can be seen in the scans, prior to the adjustment, there was an approximately 700 micron drop from the left edge of the active area to the right. After the adjustment, the drop was only 500 microns.

The plot on the left is of the depth measurements with no correction and 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