diff --git a/Kernel/Material.wl b/Kernel/Material.wl index 3fb180e..e803326 100644 --- a/Kernel/Material.wl +++ b/Kernel/Material.wl @@ -428,6 +428,30 @@ findFDCIRanges[mFp_MaterialParameters] := +MaterialParameters /: Snippet[m_MaterialParameters] := With[{ + n = QuantityMagnitude[m["n"], {1/"Centimeters", 1}], + k = QuantityMagnitude[m["\[Alpha]"], {1/"Centimeters", 1/"Centimeters"}], + fdci = QuantityMagnitude[#, 1/"Centimeters"] &/@ m["FDCI"] +}, + +With[{ + nPlot = ListLinePlot[ + {#[[1]], Clip[#[[2]], {1,Infinity}]} &/@ Select[n, Function[item, item[[1]] > fdci[[1]] / E && item[[1]] < E fdci[[2]] ]], + PlotRange->Full, Frame->True, FrameLabel->{"wavenumber (1/cm)", ""} + , PlotStyle->ColorData[97][2], Prolog->{ + Opacity[0.2], Green, Rectangle[{fdci[[1]], Min[n[[All,2]]]}, {fdci[[2]], Max[n[[All,2]]]}] + }], + + kPlot = ListLinePlot[ + {#[[1]], Clip[#[[2]], {-20,Infinity}]} &/@ Select[k, Function[item, item[[1]] > fdci[[1]] / E && item[[1]] < E fdci[[2]] ]], + PlotRange->Full, Frame->True, FrameLabel->{"wavenumber (1/cm)", "absorption coefficient (1/cm)"} + , Prolog->{ + Opacity[0.2], Green, Rectangle[{fdci[[1]], 0}, {fdci[[2]], Max[k[[All,2]]]}] + }] +}, + Panel[Row[{kPlot, nPlot}]] +] ] + End[] EndPackage[] \ No newline at end of file diff --git a/Kernel/Transmission.wl b/Kernel/Transmission.wl index 1ffc085..7929547 100644 --- a/Kernel/Transmission.wl +++ b/Kernel/Transmission.wl @@ -122,6 +122,33 @@ TransmissionObject[a_Association][prop_String] := If[!KeyExistsQ[a, prop], a[prop] ] + +(* :: Snippet :: *) +TransmissionObject /: Snippet[m_TransmissionObject] := With[{ + phase = QuantityMagnitude[m["Phase Features"], {1/"Centimeters", 1}], + transm = QuantityMagnitude[m["Transmission"], {1/"Centimeters", 1}], + fdci = QuantityMagnitude[#, 1/"Centimeters"] &/@ m["FDCI"] +}, + +With[{ + phasePlot = ListLinePlot[ + Select[phase, Function[item, item[[1]] < E fdci[[2]] ]], + PlotRange->Full, Frame->True, FrameLabel->{"wavenumber (1/cm)", "Radians"} + , PlotStyle->ColorData[97][2], Prolog->{ + Opacity[0.2], Green, Rectangle[{fdci[[1]], Min[phase[[All,2]]]}, {fdci[[2]], Max[phase[[All,2]]]}] + }], + + transmPlot = ListLinePlot[ + {#[[1]], Clip[#[[2]], {0,1}]} &/@ Select[transm, Function[item, item[[1]] < E fdci[[2]] ]], + PlotRange->Full, Frame->True, FrameLabel->{"wavenumber (1/cm)", "T"} + , Prolog->{ + Opacity[0.2], Green, Rectangle[{fdci[[1]], -0.1}, {fdci[[2]], 1.1}] + }] +}, + Panel[Row[{transmPlot, phasePlot}]] +] ] + + (* :: Calculated properties :: *) TransmissionObject[a_Association]["Kramers-Kronig n"] := With[{ diff --git a/README.md b/README.md index 261c845..31fc4c6 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,16 @@ where `sign12` denotes the sign of a phase jump between parts, while `phaseJump1 - `"PhaseThreshold"` : sets the treshold for a detector to remove `2Pi` jump. By the default is `5.6` - `"PhaseShift"` : overrides a constant phase offset parameter to be used later in material parameters extraction +#### How to make a preview for a transmisstion object +##### `Snippet` +To show the quick preview of your data evalaute + +```mathematica +Snippet[t_TransmissionObject] +``` + +![](./imgs/snippet1.png) + ### Material Parameters ⤵️ This the main goal of all optical spectroscopy: use EM waves to probe the responce function of the material to extract all useful properties. Here we focus on $n$ and $\kappa$ (or their derivatives). @@ -292,6 +302,16 @@ All properties are *read-only*. - `"FDCI2"` : it serves the same purpose as `FDCI` (as a criteria parameter), but relies on the phase information. It cannot be with a wrapped phase. - `"FPReduction"` : a quality factor of Fabry-Perot fringes reduction. `1.0` or close to it means the deconvolution procedure was not succesfull. The higher - the better. +#### Preview the data +Apply `Snippet` on your object to get a formatted preview + +```mathematica +Snippet[m_MaterialParameters] +``` + +![](./imgs/snippet2.png) + + #### Optimizing parameters The main issue is inaccuracy in `"Thickness"` and `"Gain"`, which comes naturally in a measurements. In this case a slight misaligment can make your results look much worse, when `FabryPerotCancellation` is enabled. diff --git a/imgs/snippet1.png b/imgs/snippet1.png new file mode 100644 index 0000000..df8aff2 Binary files /dev/null and b/imgs/snippet1.png differ diff --git a/imgs/snippet2.png b/imgs/snippet2.png new file mode 100644 index 0000000..cb6fa52 Binary files /dev/null and b/imgs/snippet2.png differ