(***********************************************************************

                    Mathematica-Compatible Notebook

This notebook can be used on any computer system with Mathematica 4.0,
MathReader 4.0, or any compatible application. The data for the notebook 
starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do one of 
the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the 
word CacheID, otherwise Mathematica-compatible applications may try to 
use invalid cache data.

For more information on notebooks and Mathematica-compatible 
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info@wolfram.com
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from 
Wolfram Research.
***********************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[     11766,        289]*)
(*NotebookOutlinePosition[     12441,        313]*)
(*  CellTagsIndexPosition[     12397,        309]*)
(*WindowFrame->Normal*)



Notebook[{
Cell["Droplet Source Data Form - Diffuser", "Title"],

Cell[CellGroupData[{

Cell["Collect Raw Data", "Section"],

Cell[BoxData[
    RowBox[{
      RowBox[{
        RowBox[{"rawdata", "=", 
          RowBox[{"(", GridBox[{
                {"\"\<Angle (\[Degree])\>\"", "\"\<Signal (mV)\>\"", 
                  "\"\<\[PlusMinus]\>\"", "\"\<Pick-Off (V)\>\"", 
                  "\"\<PMT\>\"", "\"\<\[PlusMinus]\>\"", 
                  "\"\<Gain (mV nA)\>\""},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"},
                {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                  "\[Placeholder]"}
                }], ")"}]}], ";"}], 
      "       ", \( (*\ Ctrl - Enter\ for\ more\ rows; \ 
        rows\ of\ boxes\ will\ be\ discarded\ *) \)}]], "Input"],

Cell[BoxData[{
    \(\(\(PMTflare = 21;\) (*mV*) ;\)\), "\[IndentingNewLine]", 
    \(\(\(PMTflarePickOff = 1;\) (*V*) ;\)\), "\[IndentingNewLine]", 
    \(\(\(PMTuncert = 1;\) (*\ NOT\ USED\ CURRENTLY\ *) ;\)\)}], "Input"],

Cell[BoxData[
    RowBox[{
      RowBox[{"blankdata", "=", 
        RowBox[{"(", GridBox[{
              {"\"\<Angle (\[Degree])\>\"", "\"\<Signal (mV)\>\"", 
                "\"\<\[PlusMinus]\>\"", "\"\<Pick-Off (V)\>\"", 
                "\"\<Gain (mV nA)\>\""},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"},
              {"\[Placeholder]", "\[Placeholder]", "\[Placeholder]", 
                "\[Placeholder]", "\[Placeholder]"}
              }], ")"}]}], ";"}]], "Input"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Process Raw Data", "Section"],

Cell[BoxData[
    \( (*\ Note\ that, \ since\ we\ are\ dividing\ signal\ by\ pick - off, \ 
      there\ is\ no\ need\ to\ worry\ about\ the\ difference\ in\ units\ \((V\
\ vs\ mV)\)\ *) \)], "Input"],

Cell[BoxData[
    \(\(\(<< Graphics`MultipleListPlot`\)\(\ \)\( (*\ 
      Load\ this\ first\ so\ ErrorBar\ doesn' 
        t\ get\ shadowed\ *) \)\)\)], "Input"],

Cell[BoxData[{
    \(\(\(rawdata = 
          Select[rawdata, 
            NumberQ[#1[\([1]\)]] &];\)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
 (*\ Get\ rid\ of\ non - numerical\ colunms\ *) ;\)\), "\n", 
    \(\(blankdata = Select[blankdata, NumberQ[#1[\([1]\)]] &];\)\), "\n", 
    \(\(finaldata = 
        Table[{If[rawdata[\([i, 1]\)] \[Equal] blankdata[\([i, 1]\)], 
              rawdata[\([i, 
                  1]\)], "\<Error\>"], \(\(rawdata[\([i, 2]\)]\ rawdata[\([i, \
7]\)]\)\/rawdata[\([i, 4]\)] - \(blankdata[\([i, 2]\)]\ blankdata[\([i, 5]\)]\
\)\/blankdata[\([i, 4]\)]\)\/\(rawdata[\([i, 5]\)]\/rawdata[\([i, 4]\)] - \
PMTflare\/PMTflarePickOff\), 
            Sqrt[\((\(rawdata[\([i, 3]\)]\ rawdata[\([i, \
7]\)]\)\/\(rawdata[\([i, 4]\)] \((rawdata[\([i, 5]\)]\/rawdata[\([i, 4]\)] - \
PMTflare\/PMTflarePickOff)\)\))\)\^2 + \((\(blankdata[\([i, 3]\)]\ blankdata[\
\([i, 5]\)]\)\/\(blankdata[\([i, 4]\)] \((rawdata[\([i, 5]\)]\/rawdata[\([i, \
4]\)] - PMTflare\/PMTflarePickOff)\)\))\)\^2 + \((\(\(blankdata[\([i, 2]\)]\ \
blankdata[\([i, 5]\)]\)\/blankdata[\([i, 4]\)] - \(rawdata[\([i, 2]\)]\ \
rawdata[\([i, 7]\)]\)\/rawdata[\([i, 4]\)]\)\/\(rawdata[\([i, 4]\)] \
\((rawdata[\([i, 5]\)]\/rawdata[\([i, 4]\)] - PMTflare\/PMTflarePickOff)\)\^2\
\)*rawdata[\([i, 6]\)])\)\^2]}, {i, 1, 
            Length[rawdata]}];\)\), "\[IndentingNewLine]", 
    \(\(finaldataerror = 
        Table[{{finaldata[\([i, 1]\)], finaldata[\([i, 2]\)]}, 
            ErrorBar[finaldata[\([i, 3]\)]]}, {i, 1, 
            Length[finaldata]}];\)\)}], "Input"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Plot Adjusted Data", "Section"],

Cell[BoxData[
    RowBox[{
      RowBox[{
        RowBox[{"MultipleListPlot", "[", 
          RowBox[{"finaldataerror", ",", 
            StyleBox[\(SymbolShape \[Rule] PlotSymbol[Box]\),
              FontColor->GrayLevel[0.666667]], 
            StyleBox[",",
              FontColor->GrayLevel[0.666667]], 
            StyleBox[\(Frame \[Rule] True\),
              FontColor->GrayLevel[0.666667]], 
            StyleBox[",",
              FontColor->GrayLevel[0.666667]], 
            
            StyleBox[\(FrameLabel \[Rule] {StyleForm[
                    TraditionalForm["\<Angle (\[Degree])\>"], 
                    FontSize \[Rule] 14], 
                  StyleForm[
                    TraditionalForm["\<Intensity (arbitrary units)\>"], 
                    FontSize \[Rule] 14]}\),
              FontColor->GrayLevel[0.666667]], 
            StyleBox[",",
              FontColor->GrayLevel[0.666667]], 
            
            StyleBox[\(PlotLabel \[Rule] 
                StyleForm[TraditionalForm["\<Intensity vs. Angle\>"], 
                  FontSize \[Rule] 20]\),
              FontColor->GrayLevel[0.666667]]}], "]"}], ";"}], " "}]], "Input"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Export Data Table", "Section"],

Cell[BoxData[{
    \(\(filename = "\<data.txt\>";\)\), "\n", 
    \(\(Export["\<c:\\documents\\mschubmehl\\\>" <> filename, 
        finaldata, "\<Table\>"];\)\)}], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Import and Plot Results of Fit", "Section"],

Cell[BoxData[
    \(\(bestfit = 
        Drop[Import["\<c:\\documents\\mschubmehl\\bestfit.txt\>", \
"\<Table\>"], 5];\)\)], "Input"],

Cell[BoxData[
    \(\(chidist = 
        Import["\<c:\\documents\\mschubmehl\\chidist.txt\>", \
"\<Table\>"];\)\)], "Input"],

Cell[BoxData[
    RowBox[{
      RowBox[{"MultipleListPlot", "[", 
        RowBox[{"finaldataerror", ",", "bestfit", ",", 
          StyleBox[\(SymbolShape \[Rule] {PlotSymbol[Box], None}\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          StyleBox[\(Frame \[Rule] True\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          
          StyleBox[\(FrameLabel \[Rule] {StyleForm[
                  TraditionalForm["\<Angle (\[Degree])\>"], 
                  FontSize \[Rule] 14], 
                StyleForm[TraditionalForm["\<Intensity (arbitrary units)\>"], 
                  FontSize \[Rule] 14]}\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          
          StyleBox[\(PlotLabel \[Rule] 
              StyleForm[
                TraditionalForm["\<Intensity vs. Angle: Data and Theory\>"], 
                FontSize \[Rule] 20]\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          StyleBox[\(PlotJoined \[Rule] {False, True}\),
            FontColor->GrayLevel[0.666667]]}], "]"}], ";"}]], "Input"],

Cell[BoxData[
    RowBox[{
      RowBox[{"ListPlot", "[", 
        RowBox[{"chidist", ",", 
          StyleBox[\(PlotJoined \[Rule] True\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          StyleBox[\(Frame \[Rule] True\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          
          StyleBox[\(FrameLabel \[Rule] {StyleForm[
                  TraditionalForm["\<Size Parameter\>"], 
                  FontSize \[Rule] 14], 
                StyleForm[TraditionalForm[\*"\"\<\!\(\[Chi]\^2\)\>\""], 
                  FontSize \[Rule] 14]}\),
            FontColor->GrayLevel[0.666667]], 
          StyleBox[",",
            FontColor->GrayLevel[0.666667]], 
          
          StyleBox[\(PlotLabel \[Rule] 
              StyleForm[TraditionalForm["\<Chi-squared vs Size Parameter\>"], 
                FontSize \[Rule] 20]\),
            FontColor->GrayLevel[0.666667]]}], "]"}], ";"}]], "Input",
  PageWidth->WindowWidth,
  CellMargins->{{Inherited, 0}, {Inherited, Inherited}},
  CellSize->{1939, Inherited}]
}, Open  ]]
},
FrontEndVersion->"4.0 for Microsoft Windows",
ScreenRectangle->{{0, 1280}, {0, 951}},
CellGrouping->Manual,
WindowSize->{887, 668},
WindowMargins->{{0, Automatic}, {Automatic, 0}}
]


(***********************************************************************
Cached data follows.  If you edit this Notebook file directly, not using
Mathematica, you must remove the line containing CacheID at the top of 
the file.  The cache data will then be recreated when you save this file 
from within Mathematica.
***********************************************************************)

(*CellTagsOutline
CellTagsIndex->{}
*)

(*CellTagsIndex
CellTagsIndex->{}
*)

(*NotebookFileOutline
Notebook[{
Cell[1717, 49, 52, 0, 105, "Title"],

Cell[CellGroupData[{
Cell[1794, 53, 35, 0, 53, "Section"],
Cell[1832, 55, 1960, 35, 188, "Input"],
Cell[3795, 92, 223, 3, 70, "Input"],
Cell[4021, 97, 1414, 25, 169, "Input"]
}, Open  ]],

Cell[CellGroupData[{
Cell[5472, 127, 35, 0, 53, "Section"],
Cell[5510, 129, 200, 3, 50, "Input"],
Cell[5713, 134, 162, 3, 30, "Input"],
Cell[5878, 139, 1556, 26, 303, "Input"]
}, Open  ]],

Cell[CellGroupData[{
Cell[7471, 170, 37, 0, 53, "Section"],
Cell[7511, 172, 1166, 27, 90, "Input"]
}, Open  ]],

Cell[CellGroupData[{
Cell[8714, 204, 36, 0, 53, "Section"],
Cell[8753, 206, 173, 3, 50, "Input"]
}, Closed]],

Cell[CellGroupData[{
Cell[8963, 214, 49, 0, 33, "Section"],
Cell[9015, 216, 133, 3, 30, "Input"],
Cell[9151, 221, 124, 3, 30, "Input"],
Cell[9278, 226, 1306, 30, 110, "Input"],
Cell[10587, 258, 1163, 28, 94, "Input"]
}, Open  ]]
}
]
*)




(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)

