(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 1132991, 18887] NotebookOptionsPosition[ 1108735, 18360] NotebookOutlinePosition[ 1126625, 18666] CellTagsIndexPosition[ 1126582, 18663] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Nanoexplorer", "Title", CellChangeTimes->{{3.4167325659211903`*^9, 3.416732576655359*^9}}], Cell[CellGroupData[{ Cell["Declarations", "Section", CellChangeTimes->{{3.4167326059516716`*^9, 3.416732613685898*^9}}], Cell[CellGroupData[{ Cell["Miscellaneous", "Subsection", CellChangeTimes->{{3.4167327504176474`*^9, 3.4167327633392744`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"npix", "=", "128"}], ";", " ", RowBox[{"nh", "=", RowBox[{"n", "/", "2"}]}], ";", " ", RowBox[{"nq", "=", RowBox[{"n", "/", "4"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.392545202846976*^9, 3.3925452073468895`*^9}, { 3.3925491237646093`*^9, 3.392549148936001*^9}, {3.39491015754327*^9, 3.3949101582932363`*^9}, {3.4165152430091844`*^9, 3.4165152460559225`*^9}}, CellID->60044823], Cell[BoxData[ RowBox[{ RowBox[{"aOff", "[", "array_", "]"}], ":=", RowBox[{"RotateLeft", "[", RowBox[{"array", ",", RowBox[{"{", RowBox[{"nh", ",", "nh"}], "}"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3925452346744895`*^9, 3.392545240158759*^9}, { 3.392545323907151*^9, 3.392545333266347*^9}}, CellID->228712398], Cell[BoxData[ RowBox[{ RowBox[{"AbsSqOf", "[", "z_", "]"}], ":=", SuperscriptBox[ RowBox[{"Abs", "[", "z", "]"}], "2"]}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{"ArrayPwr", "[", "Array_", "]"}], ":=", RowBox[{"Map", "[", RowBox[{"AbsSqOf", ",", "Array", ",", RowBox[{"{", "2", "}"}]}], "]"}]}]], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["Display Routines", "Subsection", CellChangeTimes->{{3.4169070970814185`*^9, 3.4169071014251127`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"DotsZ", "[", RowBox[{ "CoordListZ_", ",", "xx_", ",", "yy_", ",", "zz_", ",", "srad_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "pts", "}"}], ",", "\n", "\t\t", RowBox[{ RowBox[{ RowBox[{"dots2", "[", RowBox[{"{", RowBox[{"x_", ",", "y_", ",", "z_", ",", "Z_"}], "}"}], "]"}], ":=", RowBox[{"Point", "[", RowBox[{"{", RowBox[{ RowBox[{"x", "+", "xx"}], ",", RowBox[{"y", "+", "yy"}], ",", RowBox[{"z", "+", "zz"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\t ", RowBox[{"pts", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"CoordListZ", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "CoordListZ", "]"}]}], "}"}]}], "]"}]}], ";", "\n", "\t\t", RowBox[{"pts", "=", RowBox[{"Map", "[", RowBox[{"dots2", ",", "pts"}], "]"}]}], ";", "\[IndentingNewLine]", "\t", RowBox[{"pts", "=", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"PointSize", "[", RowBox[{"srad", "*", FractionBox[ RowBox[{"ElementData", "[", RowBox[{ RowBox[{"CoordListZ", "[", RowBox[{"[", RowBox[{"i", ",", "4"}], "]"}], "]"}], ",", "\"\\""}], "]"}], "1000"]}], "]"}], ",", RowBox[{"ColorData", "[", RowBox[{"\"\\"", ",", RowBox[{"CoordListZ", "[", RowBox[{"[", RowBox[{"i", ",", "4"}], "]"}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Opacity", "[", ".5", "]"}], ",", "\[IndentingNewLine]", RowBox[{"pts", "[", RowBox[{"[", "i", "]"}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "pts", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\t", RowBox[{"{", "pts", "}"}]}]}], "]"}]}], ";"}], "\t\t"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.405332436717231*^9, 3.40533246493562*^9}, { 3.4054555634717894`*^9, 3.4054556477832108`*^9}, {3.405455775375327*^9, 3.405455783297101*^9}, {3.405455854108694*^9, 3.4054558899676104`*^9}, { 3.4054568637745733`*^9, 3.4054569627895646`*^9}, {3.4101012380019627`*^9, 3.410101291204747*^9}, {3.4101013828135357`*^9, 3.4101014137664633`*^9}, { 3.4101026388367476`*^9, 3.410102644977333*^9}, {3.4101031354898186`*^9, 3.410103141864778*^9}, {3.416473089115525*^9, 3.416473204378937*^9}, { 3.4164732579404087`*^9, 3.4164733152205586`*^9}, {3.4164734029844985`*^9, 3.4164734162811184`*^9}, {3.416473498420166*^9, 3.416473499295149*^9}, { 3.4164764382082653`*^9, 3.4164764429269247`*^9}, {3.416514200916687*^9, 3.4165142016510477`*^9}}, FontFamily->"Courier New", CellID->174799049], Cell[BoxData[ RowBox[{ RowBox[{"Fire5", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Black"}], "}"}], ",", RowBox[{"{", RowBox[{".1", ",", RowBox[{"Darker", "[", RowBox[{"Blue", ",", ".35"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{".25", ",", RowBox[{"Darker", "[", RowBox[{"Magenta", ",", ".25"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{".4", ",", RowBox[{"Darker", "[", RowBox[{"Red", ",", ".15"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{".6", ",", RowBox[{"Darker", "[", RowBox[{"Orange", ",", "0.05"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{".8", ",", "Yellow"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "White"}], "}"}]}], "}"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.416301827911166*^9, 3.4163018325985765`*^9}, { 3.416301937299691*^9, 3.416302001470334*^9}, {3.416302036844655*^9, 3.4163020904530005`*^9}, {3.4163357532472925`*^9, 3.4163357643715096`*^9}, { 3.416335801134546*^9, 3.4163358082277966`*^9}, {3.4163358996744833`*^9, 3.4163359278443747`*^9}, {3.4163360002611513`*^9, 3.4163360089480395`*^9}, { 3.4163360678032713`*^9, 3.416336070771812*^9}, {3.416336103738241*^9, 3.416336112097028*^9}, {3.416336142766743*^9, 3.416336142844863*^9}, { 3.4163361868105173`*^9, 3.416336188138549*^9}, {3.4163362345571556`*^9, 3.416336316582631*^9}, {3.4163363472367225`*^9, 3.4163363596733465`*^9}, { 3.4163390214546947`*^9, 3.416339025860634*^9}, {3.416339138743312*^9, 3.4163391430711317`*^9}, {3.4163392140661335`*^9, 3.416339223549841*^9}, { 3.416339257203721*^9, 3.4163392722495375`*^9}, {3.41633931921498*^9, 3.4163393306204276`*^9}}, CellID->287920634] }, Closed]], Cell[CellGroupData[{ Cell["Specimens", "Subsection", CellChangeTimes->{{3.4169070933158417`*^9, 3.416907094315829*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"dccxyz4", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "0", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "0", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "5.43`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "5.43`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "5.43`"}], ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "5.43`"}], ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "10.86`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5.43`", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5.43`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5.43`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5.43`", ",", "10.86`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10.86`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10.86`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", RowBox[{"-", "5.43`"}], ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", RowBox[{"-", "5.43`"}], ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "0", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "0", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "0", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "0", ",", "10.86`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "5.43`", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "5.43`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "5.43`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "10.86`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"10.86`", ",", "0", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"10.86`", ",", "0", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"10.86`", ",", "5.43`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "2.715`"}], ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "2.715`"}], ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "2.715`", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "2.715`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "2.715`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "8.145`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "8.145`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", RowBox[{"-", "2.715`"}], ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", RowBox[{"-", "2.715`"}], ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "2.715`", ",", RowBox[{"-", "5.43`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "2.715`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "2.715`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "2.715`", ",", "10.86`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "8.145`", ",", RowBox[{"-", "5.429999`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "8.145`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "8.145`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", RowBox[{"-", "2.715`"}], ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", RowBox[{"-", "2.715`"}], ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "2.715`", ",", RowBox[{"-", "5.429999`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "2.715`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "2.715`", ",", "5.43`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "8.145`", ",", "0", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ "8.145`", ",", "8.145`", ",", "5.4300000000000015`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", RowBox[{"-", "2.715`"}], ",", "2.7149994`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "2.715`", ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "2.715`", ",", "2.7149994`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.43`"}], ",", "2.715`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5.429999`"}], ",", "8.145`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2.715`"}], ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2.715`"}], ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2.715`", ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2.715`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2.715`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "8.145`", ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "8.145`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "8.145`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", RowBox[{"-", "2.715`"}], ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", RowBox[{"-", "2.715`"}], ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "2.715`", ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "2.715`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "2.715`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "8.145`", ",", RowBox[{"-", "2.714999`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.43`", ",", "8.145`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"5.431`", ",", "8.145`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"10.86`", ",", "2.715`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", RowBox[{"-", "5.43`"}], ",", "2.7149994`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "0", ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "0", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.715`"}], ",", "0", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.7149994`"}], ",", "5.43`", ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.7149994`"}], ",", "5.43`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.7149994`"}], ",", "5.43`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.7149994`", ",", RowBox[{"-", "5.43`"}], ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.7149994`", ",", RowBox[{"-", "5.43`"}], ",", "2.7149994`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.7149994`", ",", RowBox[{"-", "5.43`"}], ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "0", ",", RowBox[{"-", "2.715`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "0", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "0", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "5.43`", ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "5.43`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "5.43`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"2.715`", ",", "10.86`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", RowBox[{"-", "5.43`"}], ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "0", ",", RowBox[{"-", "2.7149994`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "0", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "0", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "5.43`", ",", RowBox[{"-", "2.714999`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "5.43`", ",", "2.715`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"8.145`", ",", "5.43`", ",", "8.145`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "4.0725`"}], ",", "1.3574995`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "4.0725`"}], ",", "6.787499`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "1.3575`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "1.3575`", ",", "1.3574997`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "1.3575`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "6.7875`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "6.7875`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3574997`", ",", RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3574997`", ",", RowBox[{"-", "4.0725`"}], ",", "1.3574997`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3574997`", ",", RowBox[{"-", "4.0725`"}], ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "1.3575`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "1.3575`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "1.3575`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "6.7875`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "6.7875`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "1.3575`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "1.3575`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "1.3575`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "6.7875`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "6.7875`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "6.7875`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6.7875`"}], ",", RowBox[{"-", "1.3575`"}], ",", "1.3574995`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6.7875`"}], ",", "4.0725`", ",", "1.3574997`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "6.7875`"}], ",", "1.3574995`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3575`"}], ",", "1.3574997`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3575`"}], ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574997`"}], ",", "4.0725`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574997`"}], ",", "4.0725`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574997`"}], ",", "4.0725`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574993`"}], ",", "9.5025`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574993`"}], ",", "9.5025`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "6.7875`"}], ",", "1.3574997`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "1.3575`"}], ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "4.0725`", ",", RowBox[{"-", "4.0725`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "4.0725`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "4.0725`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "9.5025`", ",", RowBox[{"-", "4.072499`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "9.5025`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "9.5025`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", RowBox[{"-", "1.3575`"}], ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "4.0725`", ",", RowBox[{"-", "4.072499`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "4.0725`", ",", "1.3575`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "4.0725`", ",", "6.7875`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "1.3575`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4.072499`"}], ",", "9.5025`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3574995`", ",", RowBox[{"-", "6.7875`"}], ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3574995`", ",", RowBox[{"-", "6.7875`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "6.7875`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "4.0725`", ",", RowBox[{"-", "6.7875`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "4.0725`", ",", RowBox[{"-", "1.3574997`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "4.0725`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "4.0725`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "9.5025`", ",", RowBox[{"-", "1.3574993`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"1.3575`", ",", "9.5025`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "1.3574995`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "1.3575`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", RowBox[{"-", "1.3575`"}], ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "4.0725`", ",", RowBox[{"-", "1.3574993`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "4.0725`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "4.0725`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "9.5025`", ",", RowBox[{"-", "1.3574988`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"6.7875`", ",", "9.5025`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6.7875`"}], ",", "1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6.7875`"}], ",", "1.3575`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", RowBox[{"-", "6.7875`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3575`"}], ",", "1.3575`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574995`"}], ",", "6.7875`", ",", RowBox[{"-", "1.3574995`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574995`"}], ",", "6.7875`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.3574995`"}], ",", "6.7875`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "4.0725`"}], ",", RowBox[{"-", "1.3575`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", RowBox[{"-", "4.0725`"}], ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "1.3575`", ",", RowBox[{"-", "6.7875`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "1.3575`", ",", RowBox[{"-", "1.3574997`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "1.3575`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "1.3575`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "6.7875`", ",", RowBox[{"-", "1.3574993`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "6.7875`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"4.0725`", ",", "6.7875`", ",", "9.5025`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", RowBox[{"-", "4.0725`"}], ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "1.3575`", ",", RowBox[{"-", "1.3574993`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "1.3575`", ",", "4.0725`", ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "6.7875`", ",", RowBox[{"-", "1.3574988`"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"9.5025`", ",", "6.7875`", ",", "4.0725`", ",", "14"}], "}"}]}], "}"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.3926448882254105`*^9, 3.3926448963971286`*^9}, 3.3927185173616114`*^9, {3.3949088696663404`*^9, 3.3949088996165895`*^9}, { 3.394909054976674*^9, 3.394909301569437*^9}, {3.3949094291556387`*^9, 3.3949094351240835`*^9}, {3.394909468669241*^9, 3.3949095041830473`*^9}}, CellID->507777796], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"2", "*", RowBox[{"Abs", "[", RowBox[{"Min", "[", "dccxyz4", "]"}], "]"}], " ", RowBox[{"(*", " ", RowBox[{ "14", " ", "Angstrom", " ", "Diameter", " ", "Silicon", " ", "Sphere"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.41647909311766*^9, 3.4164791693249855`*^9}}, CellID->10774885], Cell[BoxData["13.575`"], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.4164790962890277`*^9, 3.416479170418582*^9}, 3.4164825924208965`*^9, 3.4165138400798655`*^9, 3.416559337916521*^9, 3.416562557956833*^9, 3.4165665979092093`*^9, 3.4166511053846164`*^9, 3.4167327129339924`*^9, 3.4167354914195747`*^9, 3.4168360283149447`*^9, 3.416845776647967*^9, 3.416852922087963*^9, 3.417083454030796*^9, 3.417085711112459*^9, 3.417085843969283*^9, 3.417176175259322*^9, 3.4171930560415263`*^9}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Phase Contrast", "Subsection", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165154632499657`*^9, 3.4165154659373965`*^9}}, CellID->91206955], Cell[BoxData[ RowBox[{" ", RowBox[{ RowBox[{"\[Alpha]", "=", ".0005"}], ";", RowBox[{"mppx", "=", FractionBox[ RowBox[{"2.54", " ", SuperscriptBox["10", RowBox[{"-", "2"}]]}], RowBox[{"2400", " ", "240000"}]]}], ";", RowBox[{"\[CapitalDelta]z", "=", RowBox[{"80", "*", SuperscriptBox["10", RowBox[{"-", "10"}]]}]}], ";", RowBox[{"Cs", "=", RowBox[{"1.2", "*", SuperscriptBox["10", RowBox[{"-", "3"}]]}]}], ";", RowBox[{"\[Lambda]", "=", RowBox[{"0.0197", "*", SuperscriptBox["10", RowBox[{"-", "10"}]]}]}], ";", RowBox[{"\[CapitalDelta]f", "=", RowBox[{ RowBox[{"-", "561"}], "*", SuperscriptBox["10", RowBox[{"-", "10"}]]}]}], ";"}]}]], "Input", InitializationCell->True, CellID->258702932], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"fieldWidth", "=", RowBox[{"N", "[", RowBox[{"npix", "*", "mppx"}], "]"}], " ", RowBox[{"(*", " ", RowBox[{"in", " ", "meters"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165153112248783`*^9, 3.416515386471507*^9}, { 3.4170833602513466`*^9, 3.4170833639544*^9}}, CellID->121479852], Cell[BoxData["5.644444444444444`*^-9"], "Output", CellChangeTimes->{3.35696210375764*^9, 3.4165153785812354`*^9, 3.416559337947771*^9, 3.416562557988082*^9, 3.4165665979404593`*^9, 3.41665110543149*^9, 3.416732712949617*^9, 3.4167354914508243`*^9, 3.4168360283461943`*^9, 3.416845776663591*^9, 3.416852922103587*^9, 3.4170834540464206`*^9, 3.4170854413363886`*^9, 3.417085711143708*^9, 3.417085843984908*^9, 3.4171761752749414`*^9, 3.417193056057145*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"fieldWidth", "=", RowBox[{"20", "*", SuperscriptBox["10", RowBox[{"-", "10"}]]}]}], ";"}], " ", RowBox[{"(*", " ", RowBox[{"in", " ", "meters"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4170856536448126`*^9, 3.4170856835973625`*^9}, { 3.4170858373444104`*^9, 3.417085839078752*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"mag", "=", FractionBox[ RowBox[{"2.54", "*", SuperscriptBox["10", RowBox[{"-", "2"}]]}], RowBox[{"2400", "*", RowBox[{"fieldWidth", "/", "npix"}]}]], " ", RowBox[{"(*", " ", RowBox[{ "magnification", " ", "of", " ", "image", " ", "digitized", " ", "at", " ", "2400", " ", "dpi"}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.4170862421335135`*^9, 3.417086264070592*^9}, { 3.4170863122884164`*^9, 3.4170863438503103`*^9}}], Cell[BoxData["677333.3333333334`"], "Output", CellChangeTimes->{3.417086264898701*^9, 3.417086314335252*^9, 3.417086344506548*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"metersPerPixel", "[", "fw_", "]"}], ":=", FractionBox["fw", "npix"]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.416906233498722*^9, 3.416906246561055*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"AngstromsPerPixel", "[", "fwA_", "]"}], ":=", FractionBox["fwA", "npix"]}]], "Input", CellChangeTimes->{{3.417083420906432*^9, 3.4170834503589916`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"freqNyquist", "=", RowBox[{"N", "[", FractionBox["npix", RowBox[{"2", "*", "fieldWidth"}]], "]"}], " ", RowBox[{"(*", " ", RowBox[{"in", " ", "reciprocal", " ", "Angstroms"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165153332551413`*^9, 3.4165153968460417`*^9}}, CellID->590566246], Cell[BoxData["3.2`*^10"], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.416515364300625*^9, 3.4165153786437325`*^9}, 3.416559337963396*^9, 3.416562558003707*^9, 3.4165665979717083`*^9, 3.416651105447114*^9, 3.4167327129652414`*^9, 3.416735491466449*^9, 3.416836028361819*^9, 3.416845776663591*^9, 3.4168529221192117`*^9, 3.417083454062045*^9, 3.417085711174958*^9, 3.417085844016157*^9, 3.417176175290561*^9, 3.4171930560883827`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"1", "+", "1"}]], "Input", CellChangeTimes->{{3.417083711228983*^9, 3.417083713478939*^9}}], Cell[BoxData["2"], "Output", CellChangeTimes->{3.4170837140883026`*^9}] }, Open ]], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"IncidentBeam", "=", RowBox[{"Table", "[", RowBox[{"1.0", ",", RowBox[{"{", RowBox[{"x", ",", "1", ",", "npix"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "1", ",", "npix"}], "}"}]}], "]"}]}], ";"}], FontColor->GrayLevel[0]]], "Input", InitializationCell->True, CellChangeTimes->{{3.417083666589215*^9, 3.417083679495217*^9}}, FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"exitSurfacePhase", "[", "projectedPotential_", "]"}], ":=", RowBox[{"(*", " ", RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", RowBox[{"FLA", ","}], " "}]}]}], "*)"}], RowBox[{"Map", "[", RowBox[{"Exp", ",", RowBox[{ RowBox[{"-", "\[ImaginaryI]"}], " ", "projectedPotential"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{",", "IncidentBeam"}], "}"}], ",", "2"}], "]"}], " ", "*)"}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4169065179482064`*^9, 3.4169065320417757`*^9}, { 3.417083747681408*^9, 3.417083789493105*^9}, {3.417083840851494*^9, 3.4170838931629896`*^9}, {3.4170839487869215`*^9, 3.417083949849401*^9}, 3.417195871830552*^9}], Cell[BoxData[ RowBox[{ RowBox[{"CircleAp", "[", RowBox[{"x_", ",", "y_", ",", "r_"}], "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Sqrt", "[", RowBox[{ SuperscriptBox["x", "2"], "+", SuperscriptBox["y", "2"]}], "]"}], "<", "r"}], ",", "1.0", ",", "0.1"}], "]"}]}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{"OA", "=", RowBox[{"aOff", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"CircleAp", "[", RowBox[{ RowBox[{"u", "-", "nh"}], ",", RowBox[{"v", "-", "nh"}], ",", "nh"}], "]"}], ",", RowBox[{"{", RowBox[{"u", ",", "1", ",", "npix"}], "}"}], ",", RowBox[{"{", RowBox[{"v", ",", "1", ",", "npix"}], "}"}]}], "]"}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4169066458840685`*^9, 3.41690664852466*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"backFocalPlane", "[", "exitSurfacePhase_", "]"}], ":=", RowBox[{"Fourier", "[", RowBox[{"N", "[", "exitSurfacePhase", "]"}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417083920537464*^9, 3.417084020144926*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"objectiveApertureWave", "[", "backFocalPlane_", "]"}], ":=", RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", RowBox[{"OA", ",", "backFocalPlane"}], "}"}], ",", "2"}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417084084956182*^9, 3.4170841173618097`*^9}, { 3.4170841663296194`*^9, 3.417084176673171*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"\[Omega]", "[", RowBox[{"u_", ",", "v_"}], "]"}], ":=", SqrtBox[ RowBox[{ SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"u", "-", "nh"}], "fieldWidth"], ")"}], "2"], "+", SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"v", "-", "nh"}], "fieldWidth"], ")"}], "2"]}]]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4169068840216455`*^9, 3.416906885021633*^9}, { 3.417085048234562*^9, 3.4170850487658014`*^9}, {3.417085447164402*^9, 3.417085469757718*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Chi]", "[", "\[Omega]_", "]"}], ":=", RowBox[{ RowBox[{"\[Pi]", " ", "\[CapitalDelta]f", " ", "\[Lambda]", " ", SuperscriptBox["\[Omega]", "2"]}], "+", RowBox[{ FractionBox["1", "2"], "\[Pi]", " ", "Cs", " ", SuperscriptBox["\[Lambda]", "3"], SuperscriptBox["\[Omega]", "4"]}]}]}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{"Phase2D", "[", RowBox[{"A_", ",", RowBox[{"{", RowBox[{"u_", ",", "v_"}], "}"}]}], "]"}], ":=", RowBox[{"A", " ", SuperscriptBox["\[ExponentialE]", RowBox[{"I", " ", RowBox[{"\[Chi]", "[", RowBox[{"\[Omega]", "[", RowBox[{"u", ",", "v"}], "]"}], "]"}]}]]}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417084885253316*^9, 3.4170849091122327`*^9}, { 3.41708499131378*^9, 3.4170850030010552`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"PhaseChange", "=", RowBox[{"MapIndexed", "[", RowBox[{"Phase2D", ",", RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", "npix", "}"}], ",", RowBox[{"{", "npix", "}"}]}], "]"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4170850666717076`*^9, 3.41708506887479*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Damp2D", "[", RowBox[{"\[CapitalDelta]z_", ",", RowBox[{"{", RowBox[{"u_", ",", "v_"}], "}"}]}], "]"}], ":=", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", SuperscriptBox[ RowBox[{"(", RowBox[{"\[Pi]", " ", "\[Lambda]", " ", "\[CapitalDelta]z"}], ")"}], "2"]}], " ", RowBox[{ SuperscriptBox[ RowBox[{"\[Omega]", "[", RowBox[{"u", ",", "v"}], "]"}], "4"], "/", "2"}]}]]}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{"Damp", "=", RowBox[{"MapIndexed", "[", RowBox[{"Damp2D", ",", RowBox[{"Table", "[", RowBox[{"\[CapitalDelta]z", ",", RowBox[{"{", "npix", "}"}], ",", RowBox[{"{", "npix", "}"}]}], "]"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417085084093248*^9, 3.4170850862182074`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Conv2D", "[", RowBox[{"\[Alpha]_", ",", RowBox[{"{", RowBox[{"u_", ",", "v_"}], "}"}]}], "]"}], ":=", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"\[Pi]", " ", "\[Alpha]"}], "\[Lambda]"], ")"}], "2"]}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ RowBox[{"Cs", " ", SuperscriptBox["\[Lambda]", "3"], " ", SuperscriptBox[ RowBox[{"\[Omega]", "[", RowBox[{"u", ",", "v"}], "]"}], "3"]}], "+", RowBox[{"\[CapitalDelta]f", " ", "\[Lambda]", " ", RowBox[{"\[Omega]", "[", RowBox[{"u", ",", "v"}], "]"}]}]}], ")"}], "2"]}]]}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{"ConvMatrix", "=", RowBox[{"MapIndexed", "[", RowBox[{"Conv2D", ",", RowBox[{"Table", "[", RowBox[{"\[Alpha]", ",", RowBox[{"{", "npix", "}"}], ",", RowBox[{"{", "npix", "}"}]}], "]"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417085093186824*^9, 3.417085095249284*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Damp", "=", RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", RowBox[{"Damp", ",", "ConvMatrix"}], "}"}], ",", "2"}], "]"}]}], ";"}]], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"CTF", "=", RowBox[{"aOff", "[", RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", RowBox[{"Damp", ",", "PhaseChange"}], "}"}], ",", "2"}], "]"}], "]"}]}], ";"}], " ", RowBox[{"(*", " ", RowBox[{ "presently", " ", "CTF", " ", "does", " ", "not", " ", "depend", " ", "on", " ", "fieldWidth", " ", "in", " ", "Meters", " ", "which", " ", "is", " ", "fixed"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4170860104817114`*^9, 3.4170860235283356`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Omega]new", "[", RowBox[{"u_", ",", "v_", ",", "fwm_"}], "]"}], ":=", SqrtBox[ RowBox[{ SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"u", "-", "nh"}], "fwm"], ")"}], "2"], "+", SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"v", "-", "nh"}], "fwm"], ")"}], "2"]}]]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417087054649163*^9, 3.4170870892578735`*^9}, 3.417087295051823*^9}], Cell[BoxData[ RowBox[{ RowBox[{"CTFnew", "[", RowBox[{"fwm_", ",", "\[CapitalDelta]f_"}], "]"}], ":=", RowBox[{"aOff", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", SuperscriptBox[ RowBox[{"(", FractionBox[ RowBox[{"\[Pi]", " ", "\[Alpha]"}], "\[Lambda]"], ")"}], "2"]}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ RowBox[{"Cs", " ", SuperscriptBox["\[Lambda]", "3"], " ", SuperscriptBox[ RowBox[{"\[Omega]new", "[", RowBox[{"u", ",", "v", ",", "fwm"}], "]"}], "3"]}], "+", RowBox[{"\[CapitalDelta]f", " ", "\[Lambda]", " ", RowBox[{"\[Omega]new", "[", RowBox[{"u", ",", "v", ",", "fwm"}], "]"}]}]}], ")"}], "2"]}]], SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", SuperscriptBox[ RowBox[{"(", RowBox[{"\[Pi]", " ", "\[Lambda]", " ", "\[CapitalDelta]z"}], ")"}], "2"]}], " ", FractionBox[ SuperscriptBox[ RowBox[{"\[Omega]new", "[", RowBox[{"u", ",", "v", ",", "fwm"}], "]"}], "4"], "2"]}]], SuperscriptBox["\[ExponentialE]", RowBox[{"\[ImaginaryI]", " ", RowBox[{"\[Chi]", "[", RowBox[{"\[Omega]new", "[", RowBox[{"u", ",", "v", ",", "fwm"}], "]"}], "]"}]}]]}], ",", RowBox[{"{", RowBox[{"u", ",", "1", ",", "npix"}], "}"}], ",", RowBox[{"{", RowBox[{"v", ",", "1", ",", "npix"}], "}"}]}], "]"}], "]"}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.4170869055739*^9, 3.417086963135295*^9}, { 3.4170870206498156`*^9, 3.417087032196469*^9}, {3.417087098538945*^9, 3.417087142225606*^9}, {3.417087194426837*^9, 3.417087275430254*^9}, 3.4170873224825945`*^9}], Cell[CellGroupData[{ Cell[BoxData["fieldWidth"], "Input", CellChangeTimes->{{3.4171939792296333`*^9, 3.4171939809787817`*^9}}], Cell[BoxData[ FractionBox["1", "500000000"]], "Output", CellChangeTimes->{3.417193981244278*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"CTFnew", "[", RowBox[{"fieldWidth", ",", "\[CapitalDelta]f"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.4170873006319914`*^9, 3.4170873421951447`*^9}}], Cell[BoxData[ RowBox[{"0.9817750029030644`", "\[InvisibleSpace]", "-", RowBox[{"0.16852524440967773`", " ", "\[ImaginaryI]"}]}]], "Output", CellChangeTimes->{{3.417087334658885*^9, 3.4170873473052444`*^9}, 3.417087478375953*^9, 3.417193959411107*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Dimensions", "[", "CTF", "]"}]], "Input", CellChangeTimes->{{3.4170852958391824`*^9, 3.4170852984641323`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"128", ",", "128"}], "}"}]], "Output", CellChangeTimes->{3.4170852988859987`*^9, 3.41719397227989*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"CTF", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.41708484441035*^9, 3.4170848471134233`*^9}, { 3.4170854966165776`*^9, 3.4170854967259502`*^9}, {3.417087356433671*^9, 3.4170873565701427`*^9}}], Cell[BoxData[ RowBox[{"0.9989964059827774`", "\[InvisibleSpace]", "-", RowBox[{"0.027663004030112653`", " ", "\[ImaginaryI]"}]}]], "Output", CellChangeTimes->{ 3.41708484756654*^9, 3.4170851027022657`*^9, {3.4170854925541553`*^9, 3.4170854970384445`*^9}, 3.417087357040211*^9, 3.417193973295021*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"imageAmplitude", "[", "objectiveApertureWave_", "]"}], ":=", RowBox[{"InverseFourier", "[", RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", RowBox[{"CTF", ",", "objectiveApertureWave"}], "}"}], ",", "2"}], "]"}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.417084268999523*^9, 3.4170843135455427`*^9}, { 3.4170843869972577`*^9, 3.41708439232528*^9}, {3.417087431417179*^9, 3.4170874610159454`*^9}}], Cell[BoxData[ RowBox[{"ListDensityPlot", "[", RowBox[{ RowBox[{"ArrayPwr", "[", RowBox[{"imageAmplitude", "[", "]"}], "]"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "False"}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"ColorData", "[", "\"\\"", "]"}]}], ",", RowBox[{"ImageSize", "\[Rule]", "npix"}]}], "]"}]], "Input", CellChangeTimes->{{3.417084445589883*^9, 3.4170844640270286`*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Utilities", "Subsection", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165154489534564`*^9, 3.4165154501877995`*^9}}, CellID->592950290], Cell[BoxData[ RowBox[{ RowBox[{"zonexyz", "[", RowBox[{"u_", ",", "v_", ",", "w_"}], "]"}], ":=", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"5.43", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5.43", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "5.43"}], "}"}]}], "}"}], ".", RowBox[{"{", RowBox[{"u", ",", "v", ",", "w"}], "}"}], " ", RowBox[{"(*", " ", RowBox[{ "this", " ", "gives", " ", "the", " ", "viewing", " ", "direction", " ", "in", " ", "cartesian", " ", RowBox[{"coordinates", "?"}]}], " ", "*)"}]}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.3949043556269846`*^9, 3.3949044240319214`*^9}, { 3.4164796097444324`*^9, 3.4164796256964345`*^9}}, CellID->94631176], Cell[BoxData[ RowBox[{ RowBox[{"tilt", "[", "zone_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "1", "]"}], "]"}], "\[Equal]", "0"}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "2", "]"}], "]"}], "\[Equal]", "0"}], ")"}]}], ",", "0", ",", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "3", "]"}], "]"}], ",", RowBox[{"Norm", "[", RowBox[{"{", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"zone", "[", RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "]"}]}], "]"}]}], "]"}], " ", RowBox[{"(*", " ", RowBox[{ "this", " ", "determines", " ", "the", " ", "corresponding", " ", "tilt"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.3949045574266834`*^9, 3.3949045900953555`*^9}, { 3.394904829759943*^9, 3.394904832321869*^9}, {3.394905120211355*^9, 3.394905227262892*^9}, 3.394905277726474*^9, {3.4164796606939707`*^9, 3.4164796679434605`*^9}}, CellID->124053898], Cell[BoxData[ RowBox[{ RowBox[{"azimuth", "[", "zone_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "1", "]"}], "]"}], "\[Equal]", "0"}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "2", "]"}], "]"}], "\[Equal]", "0"}], ")"}]}], ",", "0", ",", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"zone", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"zone", "[", RowBox[{"[", "2", "]"}], "]"}]}], "]"}]}], "]"}], " ", RowBox[{"(*", " ", RowBox[{ "this", " ", "determines", " ", "the", " ", "corresponding", " ", "azimuth"}], " ", "*)"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.3949046034314194`*^9, 3.3949046152214994`*^9}, { 3.3949053649519157`*^9, 3.394905382215773*^9}, {3.4164796699120717`*^9, 3.416479679442651*^9}}, CellID->329159580], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.416479848903302*^9, 3.416479860793471*^9}, { 3.416480127986968*^9, 3.4164801593140907`*^9}}, CellID->6471421], Cell[BoxData[ RowBox[{"{", RowBox[{"0.`", ",", "0.`", ",", "5.43`"}], "}"}]], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.416479856778*^9, 3.416479861152832*^9}, { 3.4164801298150344`*^9, 3.4164801597828255`*^9}, 3.4164825930459604`*^9, 3.416513840142364*^9, 3.416559338072769*^9, 3.416562558066205*^9, 3.4165665980185823`*^9, 3.416651105525236*^9, 3.4167327129964914`*^9, 3.4167354914976983`*^9, 3.4168360283930683`*^9, 3.4168457766948395`*^9, 3.4168529221504602`*^9, 3.417083460749417*^9, 3.4170857188623104`*^9, 3.4170858509847736`*^9, 3.4171761816007986`*^9, 3.417193062226492*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"tilt", "[", RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "]"}], ",", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "]"}]}], "}"}], "*", RowBox[{"180", "/", "Pi"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4164798697306275`*^9, 3.416479891886027*^9}, { 3.416480133189926*^9, 3.4164801528299227`*^9}}, CellID->456310], Cell[BoxData[ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.416479885730013*^9, 3.416479892198515*^9}, { 3.4164801392522326`*^9, 3.4164801533455315`*^9}, 3.416482593061587*^9, 3.4165138401579885`*^9, 3.416559338088394*^9, 3.416562558097454*^9, 3.4165665980498323`*^9, 3.41665110554086*^9, 3.4167327129964914`*^9, 3.416735491513323*^9, 3.4168360284086924`*^9, 3.4168457767104635`*^9, 3.4168529221660843`*^9, 3.4170834607650414`*^9, 3.417085718877935*^9, 3.4170858510472727`*^9, 3.417176181616418*^9, 3.4171930622421107`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{ RowBox[{"tilt", "[", RowBox[{"zonexyz", "[", RowBox[{"1", ",", "1", ",", "1"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"1", ",", "1", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"1", ",", "1", ",", "1"}], "]"}], "]"}], "]"}], ",", "0"}], "}"}]}], "]"}], "//", "MatrixForm"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4164800109439545`*^9, 3.4164800712544084`*^9}}, CellID->228136928], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0.7886751345948129`", "0.21132486540518713`", "0.5773502691896257`"}, {"0.21132486540518713`", "0.7886751345948129`", RowBox[{"-", "0.5773502691896258`"}]}, { RowBox[{"-", "0.5773502691896257`"}], "0.5773502691896258`", "0.5773502691896257`"} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.416480064957735*^9, 3.416480071488776*^9}, 3.41648259309284*^9, 3.416513840236112*^9, 3.4165593381196437`*^9, 3.416562558113079*^9, 3.416566598065457*^9, 3.416651105572109*^9, 3.4167327130277405`*^9, 3.416735491528948*^9, 3.4168360284243174`*^9, 3.4168457767260876`*^9, 3.416852922181709*^9, 3.4170834607962914`*^9, 3.4170857188935595`*^9, 3.4170858511097713`*^9, 3.4171761818194704`*^9, 3.4171930623670597`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{ RowBox[{"tilt", "[", RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "]"}], "]"}], ",", "0"}], "}"}]}], "]"}], "//", "MatrixForm"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4164800109439545`*^9, 3.4164800712544084`*^9}, { 3.4164801135343056`*^9, 3.4164801199715996`*^9}, {3.416480170766849*^9, 3.4164801794696956`*^9}}, CellID->189217841], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0"}, {"0", "1", "0"}, {"0", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.35696210375764*^9, 3.416480120862196*^9, 3.416480179985304*^9, 3.416482593108467*^9, 3.4165138402517366`*^9, 3.4165593381352687`*^9, 3.416562558144328*^9, 3.416566598096706*^9, 3.4166511056033583`*^9, 3.4167327130433655`*^9, 3.4167354915445724`*^9, 3.4168360284399414`*^9, 3.416845776741712*^9, 3.4168529221973333`*^9, 3.4170834608119154`*^9, 3.4170857189248095`*^9, 3.4170858511410203`*^9, 3.4171761818350897`*^9, 3.417193062382678*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RotationMatrix", "[", RowBox[{ RowBox[{"-", "\[Phi]"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165656780049973`*^9, 3.416565700285819*^9}}, CellID->720003849], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Phi]", "]"}], ",", RowBox[{"Sin", "[", "\[Phi]", "]"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Sin", "[", "\[Phi]", "]"}]}], ",", RowBox[{"Cos", "[", "\[Phi]", "]"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{ 3.35696210375764*^9, {3.4165656890360355`*^9, 3.4165657006451874`*^9}, 3.416566598112331*^9, 3.4166511056189823`*^9, 3.41673271305899*^9, 3.416735491560197*^9, 3.4168360284555664`*^9, 3.416845776741712*^9, 3.4168529222129574`*^9, 3.4170834608275404`*^9, 3.4170857189404335`*^9, 3.41708585117227*^9, 3.417176181850709*^9, 3.417193062398297*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Range", "[", "5", "]"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.4165599825611877`*^9, 3.4165599834361706`*^9}}, CellID->324920997], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "5"}], "}"}]], "Output", CellChangeTimes->{3.35696210375764*^9, 3.4165599936390996`*^9, 3.416562558159953*^9, 3.4165665981279554`*^9, 3.4166511056502314`*^9, 3.41673271305899*^9, 3.4167354915914464`*^9, 3.4168360284868155`*^9, 3.4168457767573357`*^9, 3.416852922228582*^9, 3.4170834608587894`*^9, 3.4170857189560585`*^9, 3.417085851187895*^9, 3.4171761818663282`*^9, 3.417193062429534*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"ProjPot4x", "[", RowBox[{ "npixels_", ",", " ", "molecule_", ",", " ", "fieldwidth_", ",", "rotate_", ",", "tilt_", ",", "fieldoffset_"}], "]"}], ":=", "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ "Here", " ", "molecule", " ", "is", " ", "a", " ", "list", " ", "of", " ", "atom", " ", "positions", " ", "of", " ", "the", " ", "form", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x1", ",", "y1", ",", "z1", ",", "Z1"}], "}"}], ",", "...", ",", RowBox[{"{", RowBox[{"xN", ",", "yN", ",", "zN", ",", "ZN"}], "}"}]}], "}"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{ "npix", " ", "are", " ", "the", " ", "number", " ", "of", " ", "pixels", " ", "on", " ", "a", " ", "side", " ", "in", " ", "the", " ", "output", " ", "array"}], ",", " ", RowBox[{ "fieldwidth", " ", "is", " ", "the", " ", "width", " ", "in", " ", "x", " ", "and", " ", "y", " ", "that", " ", "the", " ", "output", " ", "array", " ", "spans"}], ",", " ", RowBox[{ "beameuler", " ", "is", " ", "so", " ", "far", " ", "not", " ", "used"}], ",", " ", RowBox[{ "and", " ", "fieldoffset", " ", "relative", " ", "to", " ", "the", " ", "origin", " ", "of", " ", "molecule", " ", "coordinates", " ", "has", " ", "the", " ", "form", " ", RowBox[{"{", RowBox[{"xoff", ",", "yoff"}], "}"}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"scratch", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "npixels"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "npixels"}], "}"}]}], "]"}]}], ",", RowBox[{"mrot", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "molecule", "]"}]}], "}"}]}], "]"}]}], ",", "indx", ",", "nndx", ",", "Fxy", ",", "infield", ",", "kk"}], "}"}], ",", "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{"begin", " ", "local", " ", "declarations"}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 1, 0]], RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", RowBox[{"i", "<", RowBox[{"Length", "[", "molecule", "]"}]}], ",", RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"mrot", "[", RowBox[{"[", "i", "]"}], "]"}], "=", " ", RowBox[{ RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{"tilt", ",", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"RotationMatrix", "[", RowBox[{"rotate", ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}], ".", RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], ",", RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], "}"}], "-", "fieldoffset", "-", RowBox[{ FractionBox["fieldwidth", "2"], RowBox[{"{", RowBox[{"1", ",", "1", ",", "0"}], "}"}]}]}], ")"}]}], "+", RowBox[{ FractionBox["fieldwidth", "2"], RowBox[{"{", RowBox[{"1", ",", "1", ",", "0"}], "}"}]}]}]}]}], " ", RowBox[{"(*", " ", RowBox[{ "this", " ", "gets", " ", "the", " ", "rotated", " ", "coordinate", " ", "set"}], " ", "**)"}], "\[IndentingNewLine]", "]"}], ";", RowBox[{"(*", " ", RowBox[{ RowBox[{"Print", "[", "mrot", "]"}], ";"}], " ", "*)"}], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 1, 0]], RowBox[{"(*", " ", RowBox[{ RowBox[{"scratch", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "npixels"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "npixels"}], "}"}]}], "]"}]}], ";"}], " ", "*)"}], "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{ "this", " ", "creates", " ", "a", " ", "scratch", " ", "table", " ", "filled", " ", "with", " ", "zeros"}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"indx", "[", RowBox[{"m_", ",", "n_"}], "]"}], ":=", RowBox[{"Round", "[", RowBox[{ RowBox[{ FractionBox[ RowBox[{"mrot", "[", RowBox[{"[", RowBox[{"m", ",", "n"}], "]"}], "]"}], "fieldwidth"], "*", "npixels"}], "+", "1"}], "]"}]}], ";", "\[IndentingNewLine]", " ", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"calculate", " ", "the", " ", "main", " ", RowBox[{"indx", "[", RowBox[{"m", ",", "n"}], "]"}]}], ":", " ", RowBox[{"the", " ", "n"}]}], "=", "1"}], ",", RowBox[{ "2", " ", "pixel", " ", "index", " ", "associated", " ", "with", " ", "the", " ", "mth", " ", "atom", " ", "in", " ", RowBox[{"molecule", "."}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", RowBox[{ RowBox[{"nndx", "[", RowBox[{"m_", ",", "n_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ FractionBox[ RowBox[{"mrot", "[", RowBox[{"[", RowBox[{"m", ",", "n"}], "]"}], "]"}], "fieldwidth"], "*", "npixels"}], "+", "1", "-", RowBox[{"indx", "[", RowBox[{"m", ",", "n"}], "]"}]}], ">", "0"}], ",", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "n"}], "]"}], "+", "1"}], ",", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "n"}], "]"}], "-", "1"}]}], "]"}]}], ";", "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{"nndx", "[", RowBox[{"m", ",", "n"}], "]"}], ":", " ", RowBox[{ RowBox[{"the", " ", "diagonal", " ", "nearest"}], "-", RowBox[{ "neighbor", " ", "index", " ", "in", " ", "the", " ", "nth", " ", "direction", " ", "associated", " ", "with", " ", "the", " ", "mth", " ", "atom"}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", RowBox[{ RowBox[{"Fxy", "[", RowBox[{"m_", ",", "n_"}], "]"}], ":=", RowBox[{"1", "-", RowBox[{"Abs", "[", RowBox[{ RowBox[{ FractionBox[ RowBox[{"mrot", "[", RowBox[{"[", RowBox[{"m", ",", "n"}], "]"}], "]"}], "fieldwidth"], "*", "npixels"}], "+", "1", "-", RowBox[{"indx", "[", RowBox[{"m", ",", "n"}], "]"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{"fraction", " ", RowBox[{"Fxy", "[", RowBox[{"m", ",", "n"}], "]"}], " ", "is", " ", "Fx", " ", "if", " ", "n"}], "=", RowBox[{ RowBox[{"1", " ", "and", " ", "Fy", " ", "if", " ", "n"}], "=", RowBox[{"2", " ", "frac", " ", "btwn", " ", RowBox[{"{", RowBox[{ RowBox[{"1", "/", "2"}], ",", "1"}], "}"}], " ", "for", " ", "the", " ", "mth", " ", "atom", " ", "in", " ", RowBox[{"molecule", "."}]}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", RowBox[{ RowBox[{"infield", "[", "m_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "1"}], "]"}], "\[GreaterEqual]", "2"}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "1"}], "]"}], "\[LessEqual]", RowBox[{"npixels", "-", "1"}]}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "2"}], "]"}], "\[GreaterEqual]", "2"}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"indx", "[", RowBox[{"m", ",", "2"}], "]"}], "\[LessEqual]", RowBox[{"npixels", "-", "1"}]}], ")"}]}], ",", "True", ",", "False"}], "]"}]}], ";", " ", StyleBox[ RowBox[{"(*", " ", RowBox[{"Now", " ", RowBox[{"apply", ":", " ", RowBox[{ "record", " ", "atom", " ", "location", " ", "in", " ", "scratch", " ", "if", " ", RowBox[{"it", "'"}], "s", " ", "in", " ", "the", " ", "field", " ", "of", " ", "view"}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", RowBox[{"Do", "[", " ", RowBox[{"(*", " ", RowBox[{ "now", " ", "cycle", " ", "through", " ", "all", " ", "atoms"}], " ", "*)"}], "\[IndentingNewLine]", "\t", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"infield", "[", "k", "]"}], ",", " ", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ "if", " ", "and", " ", "only", " ", "if", " ", "the", " ", "kth", " ", "atom", " ", "is", " ", "in", " ", "the", " ", "field", " ", "of", " ", "view"}], "..."}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", "\t", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"indx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"indx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "=", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"indx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"indx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "+", RowBox[{ RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"k", ",", "4"}], "]"}], "]"}], " ", RowBox[{"Fxy", "[", RowBox[{"k", ",", "1"}], "]"}], " ", RowBox[{"Fxy", "[", RowBox[{"k", ",", "2"}], "]"}]}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{ RowBox[{"infield", "[", "k", "]"}], ",", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"indx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "=", "\[IndentingNewLine]", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"indx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "+", RowBox[{ RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"k", ",", "4"}], "]"}], "]"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"Fxy", "[", RowBox[{"k", ",", "1"}], "]"}]}], ")"}], " ", RowBox[{"Fxy", "[", RowBox[{"k", ",", "2"}], "]"}]}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{ RowBox[{"infield", "[", "k", "]"}], ",", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"indx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "=", "\[IndentingNewLine]", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"indx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "+", RowBox[{ RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"k", ",", "4"}], "]"}], "]"}], " ", RowBox[{"Fxy", "[", RowBox[{"k", ",", "1"}], "]"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"Fxy", "[", RowBox[{"k", ",", "2"}], "]"}]}], ")"}]}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{ RowBox[{"infield", "[", "k", "]"}], ",", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "=", "\[IndentingNewLine]", RowBox[{ RowBox[{"Part", "[", RowBox[{"scratch", ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "1"}], "]"}], ",", RowBox[{"nndx", "[", RowBox[{"k", ",", "2"}], "]"}]}], "]"}], "+", RowBox[{ RowBox[{"molecule", "[", RowBox[{"[", RowBox[{"k", ",", "4"}], "]"}], "]"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"Fxy", "[", RowBox[{"k", ",", "1"}], "]"}]}], ")"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"Fxy", "[", RowBox[{"k", ",", "2"}], "]"}]}], ")"}]}]}]}]}], "]"}]}], ",", "\[IndentingNewLine]", "\t", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{"first", " ", "add", " ", RowBox[{"lion", "'"}], "s", " ", "share", " ", "of", " ", "atom", " ", RowBox[{"type", " ", "[", RowBox[{"[", RowBox[{"k", ",", "4"}], "]"}], "]"}], " ", "to", " ", "scratch", " ", "array", " ", "at", " ", "location", " ", RowBox[{"indx", "[", RowBox[{"k", ",", "1"}], "]"}]}], ",", RowBox[{ RowBox[{"indx", "[", RowBox[{"k", ",", "2"}], "]"}], ";", " ", RowBox[{ "the", " ", "next", " ", "3", " ", "lines", " ", "distribute", " ", "\"\\"", " ", "using", " ", "nndx", " ", "and", " ", "Fxy", " ", "to", " ", "increment", " ", "3", " ", "neighboring", " ", "cells"}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], "\[IndentingNewLine]", "\t", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", RowBox[{"molecule", ",", "1"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"N", "[", " ", "scratch", "]"}]}]}], " ", StyleBox[ RowBox[{"(*", " ", RowBox[{"finally", ",", " ", RowBox[{ "return", " ", "the", " ", "scratch", " ", "array", " ", "value"}], ",", " ", RowBox[{"where", " ", RowBox[{"N", "[", "]"}], " ", "has", " ", "been", " ", "added", " ", "to", " ", "gloss", " ", "over", " ", "an", " ", RowBox[{"error", "?"}]}]}], " ", "*)"}], FontColor->RGBColor[0, 1, 0]], " ", "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.392547981519483*^9, {3.3925505099894915`*^9, 3.392550512974286*^9}, { 3.392551554384966*^9, 3.392551694430048*^9}, {3.392551740976327*^9, 3.3925517491480975`*^9}, {3.392551783100788*^9, 3.3925518523183513`*^9}, { 3.392551955128877*^9, 3.392552015596466*^9}, {3.39255207425159*^9, 3.3925520994386063`*^9}, {3.3925523387152624`*^9, 3.3925523612617044`*^9}, {3.392552418573104*^9, 3.3925524525099525`*^9}, { 3.392552539195788*^9, 3.3925525585079174`*^9}, {3.3925528405181274`*^9, 3.3925528438930626`*^9}, 3.3926357884236326`*^9, {3.392635824110448*^9, 3.3926358321884174`*^9}, {3.392635863156573*^9, 3.3926358986402664`*^9}, { 3.392636097823942*^9, 3.392636114948613*^9}, {3.3926361841347847`*^9, 3.3926362319151173`*^9}, {3.392636296163884*^9, 3.3926362994606953`*^9}, { 3.392638907863738*^9, 3.392638926175887*^9}, {3.3926395672104535`*^9, 3.392639573804077*^9}, {3.392640204995083*^9, 3.3926402234478536`*^9}, { 3.3926402676501303`*^9, 3.392640274946865*^9}, {3.392640845144574*^9, 3.392640846082128*^9}, {3.392640971539118*^9, 3.39264099372676*^9}, { 3.3926410663209743`*^9, 3.392641084242964*^9}, {3.3926424198492737`*^9, 3.392642428083491*^9}, {3.392642526237856*^9, 3.392642527300336*^9}, { 3.3926427990451183`*^9, 3.392642880918546*^9}, {3.392643407064694*^9, 3.392643412283344*^9}, {3.4165640648953447`*^9, 3.4165640677077904`*^9}, { 3.4165664611462107`*^9, 3.4165665494257655`*^9}, 3.4165666819700956`*^9, { 3.416651361718523*^9, 3.4166513685307612`*^9}, {3.4166580256188693`*^9, 3.4166581347240543`*^9}, {3.416658167285304*^9, 3.416658169582091*^9}, { 3.416658305561244*^9, 3.4166583100141983`*^9}, {3.4167354871852813`*^9, 3.4167354882008867`*^9}, 3.41673643852639*^9, {3.4167372020586047`*^9, 3.416737226948752*^9}}, CellID->232797880], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"viewhalfangle", "[", "fw_", "]"}], ":=", RowBox[{"fw", "*", RowBox[{"Pi", "/", "30000"}]}]}], ";", " ", RowBox[{"viewvectormag", "=", "10000"}], ";"}]], "Input", CellChangeTimes->{{3.4168528180613737`*^9, 3.416852895417283*^9}, { 3.416853052394625*^9, 3.416853053222713*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{"viewhalfangle", "[", "19.5", "]"}], "]"}]], "Input", CellChangeTimes->{{3.41685298889747*^9, 3.41685299638151*^9}, { 3.4168530604880123`*^9, 3.4168530608004985`*^9}, {3.4168531117825894`*^9, 3.41685311356376*^9}, {3.4168531501246214`*^9, 3.4168531506402235`*^9}, { 3.416907224146493*^9, 3.4169072243496294`*^9}, {3.416907629178069*^9, 3.416907631053093*^9}}], Cell[BoxData["0.0020420352248333657`"], "Output", CellChangeTimes->{3.416852996772117*^9, 3.4168530628316574`*^9, 3.4168531137825*^9, 3.416853151265196*^9, 3.4169072250371695`*^9, 3.4169076317874775`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{"14", "/", "10000"}], "]"}]], "Input", CellChangeTimes->{{3.416906424761899*^9, 3.416906435871132*^9}}], Cell[BoxData["0.0014`"], "Output", CellChangeTimes->{{3.4169064275587387`*^9, 3.416906436089879*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", FractionBox[ RowBox[{"14", "/", "2"}], "10000"], "]"}]], "Input", CellChangeTimes->{{3.4169077753359814`*^9, 3.416907788367148*^9}}], Cell[BoxData["0.0007`"], "Output", CellChangeTimes->{{3.416907780726572*^9, 3.4169077886171465`*^9}}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"viewHalfAngle2", "[", "fw_", "]"}], ":=", RowBox[{ FractionBox["21", "7"], RowBox[{"ArcTan", "[", RowBox[{"10000", ",", FractionBox["fw", "2"]}], "]"}], " ", RowBox[{"(*", " ", RowBox[{"factor", " ", "of", " ", RowBox[{"21", "/", "7"}], " ", "is", " ", "of", " ", "mysterious", " ", "origin"}], " ", "*)"}]}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.4169062857011795`*^9, 3.4169063111071043`*^9}, { 3.4169079031164136`*^9, 3.4169079841158953`*^9}, {3.4169083092231894`*^9, 3.416908340191741*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{"viewHalfAngle2", "[", "14", "]"}], "]"}]], "Input", CellChangeTimes->{{3.4169063142164392`*^9, 3.4169063261069117`*^9}, { 3.4169079390380588`*^9, 3.4169079412567945`*^9}, {3.4169080214281564`*^9, 3.416908022271901*^9}, {3.4169081289430933`*^9, 3.4169081300993357`*^9}, { 3.4169083025982323`*^9, 3.416908320988739*^9}}], Cell[BoxData["0.0020999996570001006`"], "Output", CellChangeTimes->{{3.4169063212788486`*^9, 3.416906326341284*^9}, { 3.4169079361162024`*^9, 3.416907986772128*^9}, 3.416908024881259*^9, 3.4169081305368333`*^9, {3.4169083041138473`*^9, 3.4169083415511074`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData["Degree"], "Input", CellChangeTimes->{{3.416908194770797*^9, 3.4169081957707906`*^9}}], Cell[BoxData["\[Degree]"], "Output", CellChangeTimes->{3.416908196114538*^9, 3.416908343113598*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"35", " ", "Degree"}]], "Input", CellChangeTimes->{{3.4169082093019543`*^9, 3.4169082107706947`*^9}}], Cell[BoxData[ RowBox[{"35", " ", "\[Degree]"}]], "Output", CellChangeTimes->{3.416908211020693*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{"Sin", "[", RowBox[{"35", " ", "Degree"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.4169082158019123`*^9, 3.4169082230674906`*^9}}], Cell[BoxData["0.573576436351046`"], "Output", CellChangeTimes->{{3.4169082190987663`*^9, 3.416908223317489*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{"Sin", "[", RowBox[{"35", "*", RowBox[{"Pi", "/", "180"}]}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.416908226442469*^9, 3.4169082417236214`*^9}}], Cell[BoxData["0.573576436351046`"], "Output", CellChangeTimes->{{3.416908238411143*^9, 3.41690824194237*^9}}] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Interactive Module", "Section", CellChangeTimes->{{3.41673269115316*^9, 3.4167326986998906`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"GraphicsGrid", "[", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Graphics3D", "[", RowBox[{ RowBox[{"{", RowBox[{"DotsZ", "[", RowBox[{"dccxyz4", ",", "0", ",", "0", ",", "0", ",", RowBox[{".5", "*", RowBox[{"25", "/", "fw"}]}]}], "]"}], RowBox[{"(*", RowBox[{",", " ", RowBox[{"Sphere", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", "5"}], "]"}]}], " ", "*)"}], "}"}], ",", RowBox[{"Boxed", "\[Rule]", "False"}], ",", " ", "\[IndentingNewLine]", RowBox[{"ViewVector", " ", "\[Rule]", " ", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"10000", "*", " ", RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{"(*", RowBox[{"tilt", " ", RowBox[{"amount", ":"}]}], "*)"}], RowBox[{ RowBox[{"\[Theta]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"(*", RowBox[{"tilt", " ", RowBox[{"axis", ":"}]}], "*)"}], RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}], ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}]}], "+", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"offset", "[", RowBox[{"[", "2", "]"}], "]"}]}], "+", "2.5"}], ",", RowBox[{ RowBox[{"-", RowBox[{"offset", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", "2.5"}], ",", "2.5"}], "}"}]}], ",", "\[IndentingNewLine]", " ", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "1", "]"}], "]"}], "+", "2.5"}], ",", RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "2", "]"}], "]"}], "+", "2.5"}], ",", "2.5"}], "}"}]}], " ", "}"}]}], "\[IndentingNewLine]", RowBox[{"(*", "\[IndentingNewLine]", RowBox[{"ViewPoint", "\[Rule]", RowBox[{"600", "*", " ", RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{ RowBox[{"tilt", "[", RowBox[{"zonexyz", "[", RowBox[{"u", ",", "v", ",", "w"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"u", ",", "v", ",", "w"}], "]"}], "]"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"azimuth", "[", RowBox[{"zonexyz", "[", RowBox[{"u", ",", "v", ",", "w"}], "]"}], "]"}], "]"}], ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}]}]}], RowBox[{"(*", " ", RowBox[{"100", "*", RowBox[{"zonexyz", "[", RowBox[{"u", ",", "v", ",", "w"}], "]"}]}], "*)"}], " ", "*)"}], ",", RowBox[{"ViewVertical", "\[Rule]", " ", RowBox[{"600", "*", RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{"(*", RowBox[{"tilt", " ", RowBox[{"amount", ":"}]}], "*)"}], RowBox[{ RowBox[{"\[Theta]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"(*", RowBox[{"tilt", " ", RowBox[{"axis", ":"}]}], "*)"}], RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}], ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"(*", RowBox[{"vertical", " ", "direction", " ", "before", " ", RowBox[{"tilt", ":"}]}], "*)"}], RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Sin", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}]}], ",", RowBox[{"Cos", "[", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], "]"}], ",", "0"}], "}"}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"ViewAngle", "\[Rule]", RowBox[{"fw", "*", RowBox[{"Pi", "/", "30000"}]}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "1"}], ",", " ", RowBox[{"ImageSize", "\[Rule]", "128"}], " ", ",", " ", RowBox[{"RotationAction", "\[Rule]", "\"\\""}]}], "]"}], " ", ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"mode", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{"ListDensityPlot", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"ProjPot4x", "[", RowBox[{"npix", ",", "dccxyz4", ",", "fw", ",", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"\[Theta]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", "2.5"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "False"}], " ", ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"(", RowBox[{ RowBox[{"Blend", "[", RowBox[{"Fire5", ",", "#"}], "]"}], "&"}], ")"}]}], ",", RowBox[{"ImageSize", "\[Rule]", "128"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"mode", "\[Equal]", "2"}], ",", "\[IndentingNewLine]", RowBox[{"ListDensityPlot", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"aOff", "[", "\[IndentingNewLine]", RowBox[{"Abs", "[", "\[IndentingNewLine]", RowBox[{"Fourier", "[", "\[IndentingNewLine]", RowBox[{"Transpose", "[", "\[IndentingNewLine]", RowBox[{"ProjPot4x", "[", RowBox[{"npix", ",", "dccxyz4", ",", "fw", ",", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"\[Theta]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", "2.5"}], "}"}]}], "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "False"}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"(", RowBox[{ RowBox[{"Blend", "[", RowBox[{"Fire5", ",", "#"}], "]"}], "&"}], ")"}]}], ",", " ", RowBox[{"ImageSize", "\[Rule]", "128"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"mode", "\[Equal]", "3"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"CTF", "=", RowBox[{"CTFnew", "[", RowBox[{ RowBox[{"fw", "*", SuperscriptBox["10", RowBox[{"-", "10"}]]}], ",", "\[CapitalDelta]f"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ListDensityPlot", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"ArrayPwr", "[", "\[IndentingNewLine]", RowBox[{"imageAmplitude", "[", "\[IndentingNewLine]", RowBox[{ "objectiveApertureWave", "[", "\[IndentingNewLine]", RowBox[{"backFocalPlane", "[", "\[IndentingNewLine]", RowBox[{"exitSurfacePhase", "[", "\[IndentingNewLine]", RowBox[{"Transpose", "[", "\[IndentingNewLine]", RowBox[{"ProjPot4x", "[", RowBox[{"npix", ",", "dccxyz4", ",", "fw", ",", RowBox[{"\[Phi]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"\[Theta]view", "*", FractionBox["\[Pi]", "180"]}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", RowBox[{ RowBox[{"offset", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"fw", "/", "2"}], "+", "2.5"}], ",", "2.5"}], "}"}]}], "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Mesh", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"ColorData", "[", "\"\\"", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", "npix"}]}], "\[IndentingNewLine]", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{"White", ",", RowBox[{"Rectangle", "[", "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "128"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "fw", ",", "50", ",", "\"\\""}], "}"}], ",", "1", ",", "50", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"offset", ",", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "15"}], ",", RowBox[{"-", "15"}]}], "}"}], ",", RowBox[{"{", RowBox[{"15", ",", "15"}], "}"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"direction", ",", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "Pi"}], ",", RowBox[{ RowBox[{"-", "Pi"}], "/", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"Pi", ",", RowBox[{"Pi", "/", "2"}]}], "}"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ","}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Theta]view", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", "90", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Phi]view", ",", "0", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "180"}], ",", "180", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"mode", ",", "0", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", "\"\\""}], ",", RowBox[{"1", "\[Rule]", " ", "\"\\""}], ",", RowBox[{"2", "->", "\"\\""}], ",", RowBox[{"3", "->", "\"\\""}], ",", RowBox[{"4", "\[Rule]", "\"\\""}], ",", RowBox[{"5", "\[Rule]", "\"\\""}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "SetterBar"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"NA", " ", "means", " ", "not", " ", "applicable"}], ",", " ", RowBox[{"PP", " ", "means", " ", "projected", " ", "potential"}], ",", " ", RowBox[{"DP", " ", "means", " ", "diffraction", " ", "pattern"}], ",", " ", RowBox[{"BF", " ", "means", " ", "brightfield", " ", "image"}], ",", " ", RowBox[{ "PS", " ", "means", " ", "power", " ", "spectrum", " ", "of", " ", "image"}], ",", " ", RowBox[{"DF", " ", "means", " ", "darkfield", " ", "image"}], ",", " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"u", ",", "0"}], "}"}], ",", RowBox[{"-", "4"}], ",", "4", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"v", ",", "0"}], "}"}], ",", RowBox[{"-", "4"}], ",", "4", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"w", ",", "1"}], "}"}], ",", RowBox[{"-", "4"}], ",", "4", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ","}], "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"\"\\"", ","}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Deployed", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"ContinuousAction", "\[Rule]", "False"}]}], "\[IndentingNewLine]", "]"}]], "Input", CellChangeTimes->{{3.3925415959539747`*^9, 3.392541675718068*^9}, { 3.3925417584977283`*^9, 3.3925417591695905`*^9}, {3.3925417946376595`*^9, 3.39254180321562*^9}, {3.3925418352150054`*^9, 3.3925418486522474`*^9}, { 3.392541879917272*^9, 3.392541926572626*^9}, {3.3925419722279997`*^9, 3.392542007930439*^9}, {3.3925421924893956`*^9, 3.392542258050637*^9}, { 3.3925422934718313`*^9, 3.392542406954028*^9}, {3.392542489858686*^9, 3.392542518451887*^9}, {3.3925429268502955`*^9, 3.3925429369438515`*^9}, { 3.3925470666572857`*^9, 3.392547093533146*^9}, {3.392550837464952*^9, 3.3925509081081834`*^9}, {3.3925509700613084`*^9, 3.3925509922800584`*^9}, {3.3925521262505913`*^9, 3.3925522082333927`*^9}, {3.3925522415296288`*^9, 3.392552245498302*^9}, { 3.392635254605757*^9, 3.392635274292879*^9}, {3.392635314026491*^9, 3.3926353566819224`*^9}, {3.3926353938687086`*^9, 3.392635415852661*^9}, { 3.3926359171086617`*^9, 3.392635918452386*^9}, {3.392636008560031*^9, 3.3926360175442333`*^9}, {3.3926363530846663`*^9, 3.392636355865863*^9}, { 3.3926363888496046`*^9, 3.3926363930682735`*^9}, {3.392639065688833*^9, 3.3926391023287544`*^9}, {3.3926432207245216`*^9, 3.392643222740108*^9}, { 3.392643279989009*^9, 3.392643296379319*^9}, {3.3926435414058647`*^9, 3.392643567592862*^9}, {3.3926450100355716`*^9, 3.392645014441737*^9}, { 3.392645441027296*^9, 3.3926454439491158`*^9}, 3.3927186275469956`*^9, { 3.3927186899520473`*^9, 3.39271869451446*^9}, {3.394892924974765*^9, 3.394892931412141*^9}, {3.394903262210479*^9, 3.394903368677185*^9}, { 3.3949034750345173`*^9, 3.3949036180473967`*^9}, {3.3949046788566995`*^9, 3.3949047717562833`*^9}, {3.394904887106469*^9, 3.39490492533228*^9}, { 3.3949049632300386`*^9, 3.394905030168166*^9}, {3.39490542943042*^9, 3.394905439461092*^9}, {3.394906446589893*^9, 3.3949064665111303`*^9}, { 3.3949065302903395`*^9, 3.394906551305292*^9}, {3.3949066079909782`*^9, 3.394906667020339*^9}, {3.3949067514863863`*^9, 3.3949067626266546`*^9}, { 3.394907081788316*^9, 3.3949071065843973`*^9}, {3.394907191597302*^9, 3.3949071923160286`*^9}, {3.394907235564645*^9, 3.394907302125015*^9}, { 3.394907368951001*^9, 3.394907399825013*^9}, {3.3949089680475197`*^9, 3.3949089686568365`*^9}, {3.3949103079427814`*^9, 3.3949103163174067`*^9}, {3.416334720398135*^9, 3.416334737428186*^9}, { 3.416475677200082*^9, 3.4164756814342403`*^9}, {3.416475727650624*^9, 3.416475735572093*^9}, {3.4164760127971*^9, 3.416476047452242*^9}, { 3.4164764835511446`*^9, 3.416476497582125*^9}, {3.4164765606902885`*^9, 3.4164766194547853`*^9}, {3.416476804732478*^9, 3.4164768289663877`*^9}, 3.4164791925248437`*^9, {3.416479227176214*^9, 3.4164793354890866`*^9}, { 3.4164812408634405`*^9, 3.4164814028749175`*^9}, {3.416481658571497*^9, 3.4164816792272177`*^9}, {3.416482254540614*^9, 3.4164822711495647`*^9}, { 3.416482500223956*^9, 3.4164826207831755`*^9}, {3.4164826670062017`*^9, 3.4164826708969016`*^9}, {3.416482709647646*^9, 3.416482714007104*^9}, { 3.4164827693831673`*^9, 3.41648285754111*^9}, {3.4164828949637036`*^9, 3.4164829173547583`*^9}, {3.416482948745986*^9, 3.4164830638862014`*^9}, { 3.416483096542242*^9, 3.4164831044015675`*^9}, {3.416483256416219*^9, 3.416483262088051*^9}, {3.416513835423704*^9, 3.416513898844362*^9}, { 3.4165592436052284`*^9, 3.416559371931711*^9}, {3.41655942280606*^9, 3.4165594301653404`*^9}, {3.416559483273899*^9, 3.4165594942893124`*^9}, { 3.416559526273073*^9, 3.4165595339760504`*^9}, {3.416559595099877*^9, 3.4165597343628283`*^9}, {3.416559806189574*^9, 3.416559811267601*^9}, { 3.4165600764656343`*^9, 3.4165601698075924`*^9}, {3.4165602312907867`*^9, 3.4165603546321683`*^9}, {3.4165607314686832`*^9, 3.4165607366560836`*^9}, {3.4165612863955283`*^9, 3.4165615892008133`*^9}, {3.416562550097659*^9, 3.416562555675641*^9}, { 3.4165626009244833`*^9, 3.416562607236821*^9}, {3.4165627973103075`*^9, 3.416562799529015*^9}, {3.416562965978944*^9, 3.4165630289152355`*^9}, { 3.4165631583815002`*^9, 3.416563166662591*^9}, {3.4165632532234287`*^9, 3.4165632688793783`*^9}, {3.416563568967366*^9, 3.4165637382766156`*^9}, { 3.416563772682205*^9, 3.416563776994622*^9}, 3.4165638348997602`*^9, 3.4165655603978806`*^9, {3.4165655998814974`*^9, 3.416565631177771*^9}, { 3.416566617627581*^9, 3.4165666435020847`*^9}, {3.4165668124519653`*^9, 3.4165669030752254`*^9}, {3.416567174648136*^9, 3.416567179007427*^9}, { 3.416654645467422*^9, 3.416654650904713*^9}, {3.416654798977152*^9, 3.4166548529282055`*^9}, {3.416654893504772*^9, 3.416654907832347*^9}, { 3.4166584762421894`*^9, 3.416658511975192*^9}, {3.416658590081568*^9, 3.4166586365485334`*^9}, {3.4166587359509664`*^9, 3.416658837748765*^9}, { 3.416737274385341*^9, 3.4167373077597003`*^9}, {3.416737338884103*^9, 3.4167373467589517`*^9}, {3.4167376461282034`*^9, 3.416737664909093*^9}, { 3.4167379107949967`*^9, 3.4167379165448866`*^9}, 3.416738225523329*^9, { 3.4167382559602447`*^9, 3.4167382660069265`*^9}, {3.416738311646675*^9, 3.4167383155528507`*^9}, {3.4167386232500677`*^9, 3.416738626921872*^9}, 3.4167386636242924`*^9, {3.416738787215669*^9, 3.4167388125433083`*^9}, { 3.416738923213058*^9, 3.4167389570405335`*^9}, {3.4168360227213383`*^9, 3.416836025736886*^9}, {3.4168384329489594`*^9, 3.4168384347926035`*^9}, { 3.4168385096320424`*^9, 3.416838512085026*^9}, {3.4168385523014593`*^9, 3.416838567566205*^9}, {3.417084559040829*^9, 3.41708463061758*^9}, { 3.4170846726480227`*^9, 3.4170847538808384`*^9}, {3.4170851902630844`*^9, 3.417085209418967*^9}, {3.417085479163788*^9, 3.4170854801637683`*^9}, { 3.4170867698265066`*^9, 3.417086770373371*^9}, {3.417087499399649*^9, 3.417087519743167*^9}, {3.4170876797705936`*^9, 3.4170877004696593`*^9}, { 3.417193019384672*^9, 3.4171930913539305`*^9}, {3.417193425323842*^9, 3.4171934293063045`*^9}, {3.417196217585712*^9, 3.417196219272359*^9}, { 3.4171962523337593`*^9, 3.417196252443079*^9}}, CellID->2729147], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`fw$$ = 50, $CellContext`mode$$ = 0, $CellContext`offset$$ = {0.5, 0.5}, $CellContext`\[Theta]view$$ = 0, $CellContext`\[Phi]view$$ = 0, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`fw$$], 50, "field width in \[CapitalARing]"}, 1, 50}, {{ Hold[$CellContext`offset$$], {0, 0}, "offset in \[CapitalARing]"}, {-15, -15}, {15, 15}}, {{ Hold[$CellContext`\[Theta]view$$], 0, "tilt"}, 0, 90}, {{ Hold[$CellContext`\[Phi]view$$], 0, "rotate"}, -180, 180}, {{ Hold[$CellContext`mode$$], 0, "mode"}, { 0 -> "NA", 1 -> "PrjPot", 2 -> "DifPat", 3 -> "BriFld", 4 -> "PowSpc", 5 -> "DrkFld"}}}, Typeset`size$$ = {285., {71., 75.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`fw$137026$$ = 0, $CellContext`offset$137027$$ = {0, 0}, $CellContext`\[Theta]view$137028$$ = 0, $CellContext`\[Phi]view$137029$$ = 0, $CellContext`mode$137030$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`fw$$ = 50, $CellContext`mode$$ = 0, $CellContext`offset$$ = {0, 0}, $CellContext`\[Theta]view$$ = 0, $CellContext`\[Phi]view$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`fw$$, $CellContext`fw$137026$$, 0], Hold[$CellContext`offset$$, $CellContext`offset$137027$$, {0, 0}], Hold[$CellContext`\[Theta]view$$, $CellContext`\[Theta]view$137028$$, 0], Hold[$CellContext`\[Phi]view$$, $CellContext`\[Phi]view$137029$$, 0], Hold[$CellContext`mode$$, $CellContext`mode$137030$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> GraphicsGrid[{{ Graphics3D[{ $CellContext`DotsZ[$CellContext`dccxyz4, 0, 0, 0, 0.5 (25/$CellContext`fw$$)]}, Boxed -> False, ViewVector -> {10000 Dot[ RotationMatrix[$CellContext`\[Theta]view$$ (Pi/180), { Cos[$CellContext`\[Phi]view$$ (Pi/180)], Sin[$CellContext`\[Phi]view$$ (Pi/180)], 0}], {0, 0, 1}] + {-Part[$CellContext`offset$$, 2] + 2.5, -Part[$CellContext`offset$$, 1] + 2.5, 2.5}, { Part[$CellContext`offset$$, 1] + 2.5, Part[$CellContext`offset$$, 2] + 2.5, 2.5}}, ViewVertical -> 600 Dot[ RotationMatrix[$CellContext`\[Theta]view$$ (Pi/180), { Cos[$CellContext`\[Phi]view$$ (Pi/180)], Sin[$CellContext`\[Phi]view$$ (Pi/180)], 0}], {- Sin[$CellContext`\[Phi]view$$ (Pi/180)], Cos[$CellContext`\[Phi]view$$ (Pi/180)], 0}], ViewAngle -> $CellContext`fw$$ (Pi/30000), AspectRatio -> 1, ImageSize -> 128, RotationAction -> "Clip"], If[$CellContext`mode$$ == 1, ListDensityPlot[ Transpose[ $CellContext`ProjPot4x[$CellContext`npix, $CellContext`dccxyz4, \ $CellContext`fw$$, $CellContext`\[Phi]view$$ (Pi/ 180), $CellContext`\[Theta]view$$ (Pi/180), { Part[$CellContext`offset$$, 1] - $CellContext`fw$$/2 + 2.5, Part[$CellContext`offset$$, 2] - $CellContext`fw$$/2 + 2.5, 2.5}]], Frame -> False, ColorFunction -> (Blend[$CellContext`Fire5, #]& ), ImageSize -> 128], If[$CellContext`mode$$ == 2, ListDensityPlot[ $CellContext`aOff[ Abs[ Fourier[ Transpose[ $CellContext`ProjPot4x[$CellContext`npix, \ $CellContext`dccxyz4, $CellContext`fw$$, $CellContext`\[Phi]view$$ (Pi/ 180), $CellContext`\[Theta]view$$ (Pi/180), { Part[$CellContext`offset$$, 1] - $CellContext`fw$$/2 + 2.5, Part[$CellContext`offset$$, 2] - $CellContext`fw$$/2 + 2.5, 2.5}]]]]], Frame -> False, ColorFunction -> (Blend[$CellContext`Fire5, #]& ), ImageSize -> 128], If[$CellContext`mode$$ == 3, $CellContext`CTF = $CellContext`CTFnew[$CellContext`fw$$ 10^(-10), $CellContext`\[CapitalDelta]f]; ListDensityPlot[ $CellContext`ArrayPwr[ $CellContext`imageAmplitude[ $CellContext`objectiveApertureWave[ $CellContext`backFocalPlane[ $CellContext`exitSurfacePhase[ Transpose[ $CellContext`ProjPot4x[$CellContext`npix, \ $CellContext`dccxyz4, $CellContext`fw$$, $CellContext`\[Phi]view$$ (Pi/ 180), $CellContext`\[Theta]view$$ (Pi/180), { Part[$CellContext`offset$$, 1] - $CellContext`fw$$/2 + 2.5, Part[$CellContext`offset$$, 2] - $CellContext`fw$$/2 + 2.5, 2.5}]]]]]]], Mesh -> False, PlotRange -> {-1, 2}, Frame -> False, ColorFunction -> ColorData["GrayTones"], ImageSize -> $CellContext`npix], Graphics[{White, Rectangle[]}, ImageSize -> 128]]]]}}], "Specifications" :> {{{$CellContext`fw$$, 50, "field width in \[CapitalARing]"}, 1, 50, Appearance -> "Labeled"}, {{$CellContext`offset$$, {0, 0}, "offset in \[CapitalARing]"}, {-15, -15}, {15, 15}, Appearance -> "Labeled"}, {{$CellContext`\[Theta]view$$, 0, "tilt"}, 0, 90, Appearance -> "Labeled"}, {{$CellContext`\[Phi]view$$, 0, "rotate"}, -180, 180, Appearance -> "Labeled"}, {{$CellContext`mode$$, 0, "mode"}, { 0 -> "NA", 1 -> "PrjPot", 2 -> "DifPat", 3 -> "BriFld", 4 -> "PowSpc", 5 -> "DrkFld"}, ControlType -> SetterBar}}, "Options" :> {Deployed -> True, ContinuousAction -> False}, "DefaultOptions" :> {}], ImageSizeCache->{347., {195., 200.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`DotsZ[ Pattern[$CellContext`CoordListZ, Blank[]], Pattern[$CellContext`xx, Blank[]], Pattern[$CellContext`yy, Blank[]], Pattern[$CellContext`zz, Blank[]], Pattern[$CellContext`srad, Blank[]]] := Module[{$CellContext`pts}, $CellContext`dots2[{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]], Pattern[$CellContext`z, Blank[]], Pattern[$CellContext`Z, Blank[]]}] := Point[{$CellContext`x + $CellContext`xx, $CellContext`y + \ $CellContext`yy, $CellContext`z + $CellContext`zz}]; $CellContext`pts = Table[ Part[$CellContext`CoordListZ, $CellContext`i], {$CellContext`i, 1, Length[$CellContext`CoordListZ]}]; $CellContext`pts = Map[$CellContext`dots2, $CellContext`pts]; $CellContext`pts = Table[{ PointSize[$CellContext`srad (ElementData[ Part[$CellContext`CoordListZ, $CellContext`i, 4], "AtomicRadius"]/1000)], ColorData["Atoms", Part[$CellContext`CoordListZ, $CellContext`i, 4]], Opacity[0.5], Part[$CellContext`pts, $CellContext`i]}, {$CellContext`i, 1, Length[$CellContext`pts]}]; {$CellContext`pts}], \ $CellContext`dots2[{ Pattern[$CellContext`x$, Blank[]], Pattern[$CellContext`y$, Blank[]], Pattern[$CellContext`z$, Blank[]], Pattern[$CellContext`Z$, Blank[]]}] := Point[{$CellContext`x$ + 0, $CellContext`y$ + 0, $CellContext`z$ + 0}], Attributes[$CellContext`x$] = {Temporary}, Attributes[$CellContext`y$] = {Temporary}, Attributes[$CellContext`z$] = {Temporary}, Attributes[$CellContext`Z$] = {Temporary}, $CellContext`i = 205, $CellContext`dccxyz4 = {{-5.43, 0, 0, 14}, {-5.43, 0, 5.43, 14}, {-5.43, 5.43, 0, 14}, {-5.43, 5.43, 5.43, 14}, { 0, -5.43, 0, 14}, {0, -5.43, 5.43, 14}, {0, 0, -5.43, 14}, {0, 0, 0, 14}, {0, 0, 5.43, 14}, {0, 0, 10.86, 14}, {0, 5.43, -5.43, 14}, { 0, 5.43, 0, 14}, {0, 5.43, 5.43, 14}, {0, 5.43, 10.86, 14}, { 0, 10.86, 0, 14}, {0, 10.86, 5.43, 14}, {5.43, -5.43, 0, 14}, { 5.43, -5.43, 5.43, 14}, {5.43, 0, -5.43, 14}, {5.43, 0, 0, 14}, { 5.43, 0, 5.43, 14}, {5.43, 0, 10.86, 14}, {5.43, 5.43, -5.43, 14}, { 5.43, 5.43, 0, 14}, {5.43, 5.43, 5.43, 14}, {5.43, 10.86, 0, 14}, { 10.86, 0, 0, 14}, {10.86, 0, 5.43, 14}, { 10.86, 5.43, 0, 14}, {-2.715, -2.715, 0, 14}, {-2.715, -2.715, 5.43, 14}, {-2.715, 2.715, -5.43, 14}, {-2.715, 2.715, 0, 14}, {-2.715, 2.715, 5.43, 14}, {-2.715, 8.145, 0, 14}, {-2.715, 8.145, 5.43, 14}, {2.715, -2.715, -5.43, 14}, {2.715, -2.715, 0, 14}, { 2.715, -2.715, 5.43, 14}, {2.715, 2.715, -5.43, 14}, { 2.715, 2.715, 0, 14}, {2.715, 2.715, 5.43, 14}, { 2.715, 2.715, 10.86, 14}, {2.715, 8.145, -5.429999, 14}, { 2.715, 8.145, 0, 14}, {2.715, 8.145, 5.43, 14}, { 8.145, -2.715, 0, 14}, {8.145, -2.715, 5.43, 14}, { 8.145, 2.715, -5.429999, 14}, {8.145, 2.715, 0, 14}, { 8.145, 2.715, 5.43, 14}, {8.145, 8.145, 0, 14}, { 8.145, 8.145, 5.4300000000000015`, 14}, {-5.43, -2.715, 2.7149994, 14}, {-5.43, 2.715, -2.715, 14}, {-5.43, 2.715, 2.7149994, 14}, {-5.43, 2.715, 8.145, 14}, {-5.429999, 8.145, 2.715, 14}, { 0, -2.715, -2.715, 14}, {0, -2.715, 2.715, 14}, { 0, -2.715, 8.145, 14}, {0, 2.715, -2.715, 14}, { 0, 2.715, 2.715, 14}, {0, 2.715, 8.145, 14}, { 0, 8.145, -2.7149994, 14}, {0, 8.145, 2.715, 14}, { 0, 8.145, 8.145, 14}, {5.43, -2.715, -2.7149994, 14}, { 5.43, -2.715, 2.715, 14}, {5.43, -2.715, 8.145, 14}, { 5.43, 2.715, -2.7149994, 14}, {5.43, 2.715, 2.715, 14}, { 5.43, 2.715, 8.145, 14}, {5.43, 8.145, -2.714999, 14}, { 5.43, 8.145, 2.715, 14}, {5.431, 8.145, 8.145, 14}, { 10.86, 2.715, 2.715, 14}, {-2.715, -5.43, 2.7149994, 14}, {-2.715, 0, -2.715, 14}, {-2.715, 0, 2.715, 14}, {-2.715, 0, 8.145, 14}, {-2.7149994, 5.43, -2.7149994, 14}, {-2.7149994, 5.43, 2.715, 14}, {-2.7149994, 5.43, 8.145, 14}, { 2.7149994, -5.43, -2.715, 14}, {2.7149994, -5.43, 2.7149994, 14}, { 2.7149994, -5.43, 8.145, 14}, {2.715, 0, -2.715, 14}, { 2.715, 0, 2.715, 14}, {2.715, 0, 8.145, 14}, { 2.715, 5.43, -2.7149994, 14}, {2.715, 5.43, 2.715, 14}, { 2.715, 5.43, 8.145, 14}, {2.715, 10.86, 2.715, 14}, { 8.145, -5.43, 2.715, 14}, {8.145, 0, -2.7149994, 14}, { 8.145, 0, 2.715, 14}, {8.145, 0, 8.145, 14}, { 8.145, 5.43, -2.714999, 14}, {8.145, 5.43, 2.715, 14}, { 8.145, 5.43, 8.145, 14}, {-4.0725, -4.0725, 1.3574995, 14}, {-4.0725, -4.0725, 6.787499, 14}, {-4.0725, 1.3575, -4.0725, 14}, {-4.0725, 1.3575, 1.3574997, 14}, {-4.0725, 1.3575, 6.7875, 14}, {-4.0725, 6.7875, -4.0725, 14}, {-4.0725, 6.7875, 1.3575, 14}, {-4.0725, 6.7875, 6.7875, 14}, { 1.3574997, -4.0725, -4.0725, 14}, { 1.3574997, -4.0725, 1.3574997, 14}, { 1.3574997, -4.0725, 6.7875, 14}, {1.3575, 1.3575, -4.0725, 14}, { 1.3575, 1.3575, 1.3575, 14}, {1.3575, 1.3575, 6.7875, 14}, { 1.3575, 6.7875, -4.0725, 14}, {1.3575, 6.7875, 1.3575, 14}, { 1.3575, 6.7875, 6.7875, 14}, {6.7875, -4.0725, -4.0725, 14}, { 6.7875, -4.0725, 1.3575, 14}, {6.7875, -4.0725, 6.7875, 14}, { 6.7875, 1.3575, -4.0725, 14}, {6.7875, 1.3575, 1.3575, 14}, { 6.7875, 1.3575, 6.7875, 14}, {6.7875, 6.7875, -4.0725, 14}, { 6.7875, 6.7875, 1.3575, 14}, { 6.7875, 6.7875, 6.7875, 14}, {-6.7875, -1.3575, 1.3574995, 14}, {-6.7875, 4.0725, 1.3574997, 14}, {-1.3575, -6.7875, 1.3574995, 14}, {-1.3575, -1.3575, -4.0725, 14}, {-1.3575, -1.3575, 1.3574997, 14}, {-1.3575, -1.3575, 6.7875, 14}, {-1.3574997, 4.0725, -4.0725, 14}, {-1.3574997, 4.0725, 1.3575, 14}, {-1.3574997, 4.0725, 6.7875, 14}, {-1.3574993, 9.5025, 1.3575, 14}, {-1.3574993, 9.5025, 6.7875, 14}, {4.0725, -6.7875, 1.3574997, 14}, { 4.0725, -1.3575, -4.0725, 14}, {4.0725, -1.3575, 1.3575, 14}, { 4.0725, -1.3575, 6.7875, 14}, {4.0725, 4.0725, -4.0725, 14}, { 4.0725, 4.0725, 1.3575, 14}, {4.0725, 4.0725, 6.7875, 14}, { 4.0725, 9.5025, -4.072499, 14}, {4.0725, 9.5025, 1.3575, 14}, { 4.0725, 9.5025, 6.7875, 14}, {9.5025, -1.3575, 1.3575, 14}, { 9.5025, -1.3575, 6.7875, 14}, {9.5025, 4.0725, -4.072499, 14}, { 9.5025, 4.0725, 1.3575, 14}, { 9.5025, 4.0725, 6.7875, 14}, {-4.0725, -1.3575, -1.3575, 14}, {-4.0725, -1.3575, 4.0725, 14}, {-4.0725, 4.0725, -1.3575, 14}, {-4.0725, 4.0725, 4.0725, 14}, {-4.0725, 4.0725, 9.5025, 14}, {-4.072499, 9.5025, 4.0725, 14}, { 1.3574995, -6.7875, -1.3575, 14}, {1.3574995, -6.7875, 4.0725, 14}, { 1.3575, -1.3575, -6.7875, 14}, {1.3575, -1.3575, -1.3575, 14}, { 1.3575, -1.3575, 4.0725, 14}, {1.3575, -1.3575, 9.5025, 14}, { 1.3575, 4.0725, -6.7875, 14}, {1.3575, 4.0725, -1.3574997, 14}, { 1.3575, 4.0725, 4.0725, 14}, {1.3575, 4.0725, 9.5025, 14}, { 1.3575, 9.5025, -1.3574993, 14}, {1.3575, 9.5025, 4.0725, 14}, { 6.7875, -1.3575, -1.3574995, 14}, {6.7875, -1.3575, 4.0725, 14}, { 6.7875, -1.3575, 9.5025, 14}, {6.7875, 4.0725, -1.3574993, 14}, { 6.7875, 4.0725, 4.0725, 14}, {6.7875, 4.0725, 9.5025, 14}, { 6.7875, 9.5025, -1.3574988, 14}, { 6.7875, 9.5025, 4.0725, 14}, {-6.7875, 1.3575, -1.3575, 14}, {-6.7875, 1.3575, 4.0725, 14}, {-1.3575, -4.0725, -1.3575, 14}, {-1.3575, -4.0725, 4.0725, 14}, {-1.3575, 1.3575, -6.7875, 14}, {-1.3575, 1.3575, -1.3575, 14}, {-1.3575, 1.3575, 4.0725, 14}, {-1.3575, 1.3575, 9.5025, 14}, {-1.3574995, 6.7875, -1.3574995, 14}, {-1.3574995, 6.7875, 4.0725, 14}, {-1.3574995, 6.7875, 9.5025, 14}, {4.0725, -4.0725, -1.3575, 14}, { 4.0725, -4.0725, 4.0725, 14}, {4.0725, -4.0725, 9.5025, 14}, { 4.0725, 1.3575, -6.7875, 14}, {4.0725, 1.3575, -1.3574997, 14}, { 4.0725, 1.3575, 4.0725, 14}, {4.0725, 1.3575, 9.5025, 14}, { 4.0725, 6.7875, -1.3574993, 14}, {4.0725, 6.7875, 4.0725, 14}, { 4.0725, 6.7875, 9.5025, 14}, {9.5025, -4.0725, 4.0725, 14}, { 9.5025, 1.3575, -1.3574993, 14}, {9.5025, 1.3575, 4.0725, 14}, { 9.5025, 6.7875, -1.3574988, 14}, { 9.5025, 6.7875, 4.0725, 14}}, $CellContext`offset$$ = {0.5, 0.5}, $CellContext`ProjPot4x[ Pattern[$CellContext`npixels, Blank[]], Pattern[$CellContext`molecule, Blank[]], Pattern[$CellContext`fieldwidth, Blank[]], Pattern[$CellContext`rotate, Blank[]], Pattern[$CellContext`tilt, Blank[]], Pattern[$CellContext`fieldoffset, Blank[]]] := Module[{$CellContext`scratch = Table[0, {$CellContext`i, 1, $CellContext`npixels}, {$CellContext`j, 1, $CellContext`npixels}], $CellContext`mrot = Table[{0, 0, 0}, {$CellContext`i, 1, Length[$CellContext`molecule]}], $CellContext`indx, \ $CellContext`nndx, $CellContext`Fxy, $CellContext`infield, $CellContext`kk}, For[$CellContext`i = 1, $CellContext`i < Length[$CellContext`molecule], Increment[$CellContext`i], Part[$CellContext`mrot, $CellContext`i] = Dot[ RotationMatrix[$CellContext`tilt, {1, 0, 0}], RotationMatrix[$CellContext`rotate, {0, 0, 1}], { Part[$CellContext`molecule, $CellContext`i, 1], Part[$CellContext`molecule, $CellContext`i, 2], Part[$CellContext`molecule, $CellContext`i, 3]} - $CellContext`fieldoffset - ($CellContext`fieldwidth/ 2) {1, 1, 0}] + ($CellContext`fieldwidth/2) {1, 1, 0}]; $CellContext`indx[ Pattern[$CellContext`m, Blank[]], Pattern[$CellContext`n, Blank[]]] := Round[(Part[$CellContext`mrot, $CellContext`m, \ $CellContext`n]/$CellContext`fieldwidth) $CellContext`npixels + 1]; $CellContext`nndx[ Pattern[$CellContext`m, Blank[]], Pattern[$CellContext`n, Blank[]]] := If[(Part[$CellContext`mrot, $CellContext`m, \ $CellContext`n]/$CellContext`fieldwidth) $CellContext`npixels + 1 - $CellContext`indx[$CellContext`m, $CellContext`n] > 0, $CellContext`indx[$CellContext`m, $CellContext`n] + 1, $CellContext`indx[$CellContext`m, $CellContext`n] - 1]; $CellContext`Fxy[ Pattern[$CellContext`m, Blank[]], Pattern[$CellContext`n, Blank[]]] := 1 - Abs[( Part[$CellContext`mrot, $CellContext`m, \ $CellContext`n]/$CellContext`fieldwidth) $CellContext`npixels + 1 - $CellContext`indx[$CellContext`m, $CellContext`n]]; \ $CellContext`infield[ Pattern[$CellContext`m, Blank[]]] := If[ And[$CellContext`indx[$CellContext`m, 1] >= 2, $CellContext`indx[$CellContext`m, 1] <= $CellContext`npixels - 1, $CellContext`indx[$CellContext`m, 2] >= 2, $CellContext`indx[$CellContext`m, 2] <= $CellContext`npixels - 1], True, False]; Do[If[ $CellContext`infield[$CellContext`k], Part[$CellContext`scratch, $CellContext`indx[$CellContext`k, 1], $CellContext`indx[$CellContext`k, 2]] = Part[$CellContext`scratch, $CellContext`indx[$CellContext`k, 1], $CellContext`indx[$CellContext`k, 2]] + Part[$CellContext`molecule, $CellContext`k, 4] $CellContext`Fxy[$CellContext`k, 1] $CellContext`Fxy[$CellContext`k, 2]]; If[ $CellContext`infield[$CellContext`k], Part[$CellContext`scratch, $CellContext`nndx[$CellContext`k, 1], $CellContext`indx[$CellContext`k, 2]] = Part[$CellContext`scratch, $CellContext`nndx[$CellContext`k, 1], $CellContext`indx[$CellContext`k, 2]] + Part[$CellContext`molecule, $CellContext`k, 4] ( 1 - $CellContext`Fxy[$CellContext`k, 1]) $CellContext`Fxy[$CellContext`k, 2]]; If[ $CellContext`infield[$CellContext`k], Part[$CellContext`scratch, $CellContext`indx[$CellContext`k, 1], $CellContext`nndx[$CellContext`k, 2]] = Part[$CellContext`scratch, $CellContext`indx[$CellContext`k, 1], $CellContext`nndx[$CellContext`k, 2]] + Part[$CellContext`molecule, $CellContext`k, 4] $CellContext`Fxy[$CellContext`k, 1] ( 1 - $CellContext`Fxy[$CellContext`k, 2])]; If[ $CellContext`infield[$CellContext`k], Part[$CellContext`scratch, $CellContext`nndx[$CellContext`k, 1], $CellContext`nndx[$CellContext`k, 2]] = Part[$CellContext`scratch, $CellContext`nndx[$CellContext`k, 1], $CellContext`nndx[$CellContext`k, 2]] + Part[$CellContext`molecule, $CellContext`k, 4] ( 1 - $CellContext`Fxy[$CellContext`k, 1]) ( 1 - $CellContext`Fxy[$CellContext`k, 2])], {$CellContext`k, 1, Part[ Dimensions[$CellContext`molecule, 1], 1]}]; N[$CellContext`scratch]], $CellContext`tilt[ Pattern[$CellContext`zone, Blank[]]] := If[ And[ Part[$CellContext`zone, 1] == 0, Part[$CellContext`zone, 2] == 0], 0, ArcTan[ Part[$CellContext`zone, 3], Norm[{ Part[$CellContext`zone, 1], Part[$CellContext`zone, 2]}]]], $CellContext`n = 128, $CellContext`npix = 128, $CellContext`Fire5 = {{0, GrayLevel[0]}, {0.1, RGBColor[0., 0., 0.65]}, {0.25, RGBColor[0.75, 0., 0.75]}, {0.4, RGBColor[0.85, 0., 0.]}, {0.6, RGBColor[0.95, 0.475, 0.]}, {0.8, RGBColor[1, 1, 0]}, {1, GrayLevel[1]}}, $CellContext`aOff[ Pattern[$CellContext`array, Blank[]]] := RotateLeft[$CellContext`array, {$CellContext`nh, $CellContext`nh}], \ $CellContext`nh = 64, $CellContext`CTF = {{