INOM
EXAMENSARBETE INFORMATIONS- OCH
KOMMUNIKATIONSTEKNIK, AVANCERAD NIVÅ, 30 HP
,
STOCKHOLM SVERIGE 2016
Unaltered Blinking in Single
Silicon Oxidized Nanocrystals
when X-ray Irradiated
Contents
1 Introduction 5
2 Theoretical background 7
2.1 Silicon Nanocrystals (Si-NCs) . . . 7
2.2 Blinking in nanocrystals . . . 9
3 Experimental Setup 12 3.1 Sample Preparation . . . 12
3.2 X-Ray Irradiation Chamber Setup . . . 14
3.3 PL Setup . . . 15
3.4 Blinking analysis . . . 17
4 Results 27 4.1 Number of luminescent objects . . . 27
4.2 Single-dot Blinking Analysis . . . 33
4.2.1 ON Intensity . . . 33
4.2.2 ON Percentage . . . 36
4.2.3 ON and OFF Time Constants . . . 43
5 Conclusions 48 Appendix 49 Experiment Schedule . . . 49
Statistical Evaluation of Data . . . 49
Andor Solis . . . 50
ImageJ Data Processing . . . 50
Matlab Data Processing . . . 50
ImageJ Methods Used . . . 51
Image - Stacks - Z Project. . . 51
Process - Find Maxima. . . 52
Custom ImageJ Plugins . . . 53
Dot_Trace_Extractor.py . . . 53
Map_Translator.py . . . 63
Custom Matlab Scripts . . . 67
Blinking_Detector.m . . . 67
List of Figures 99
List of Tables 102
Abstract
Quantum dots exhibit a range of interesting and useful properties linked to their elemental composition, crystal structure, size and shape. Two such properties is the work function and blinking frequency. Tests on several dif-ferent quantum dot types have shown that x-ray radiation will alter these factors; with increasing doses "bleaching" the dots and making them perma-nently dark. There are several competing theories to explain this behavior and a lot of materials systems that have not been investigated yet. One such unexplored material is oxidized silicon NCs. This work found no con-sistent change in work function or blinking frequency after an X-ray dose of ∼272 000 Gy absorbed by the SiO2. Individual dots changed between PL
Acknowledgments
1
Introduction
properties in single oxidized Si-NCs when they were irradiated with a X-ray dose of ∼65 000 Gy (absorbed by the SiO2).
In this work, the same sample of oxide-passivated Si-NCs made by undu-lating nanowalls [22] as used in Ref.[21] was additionally irradiated with a cumulative X-rays dose of ∼272 000 Gy (absorbed by the SiO2) in 6
irradia-tion steps. Between each step photoluminescence measurements were carried out to study the blinking behavior of individual Si-NCs. By analyzing the ON-/OFF- time distributions with an improved plugin we have been able to achieve a better statistical data in a wider range of irradiation doses with respect to the previous work [21]. In addition, a reference non-irradiated sample was measured for comparison. Although the blinking parameters can change between one irradiation step to another, the results show that after a total dose of ∼272 000 Gy (absorbed by the SiO2) the PL properties of
the Si-NCs seem to be unaltered on average. This could be due to that thin (∼30 µm) SiO2 has a high X-ray radiation resistance or alternatively could
2
Theoretical background
2.1
Silicon Nanocrystals (Si-NCs)
In bulk semiconductors the electron energy bands can be divided into a va-lence band (VB) and a conduction band (CB), both continuous and separated by a bandgap (see Fig.1). The CB is the lowest unoccupied energy band and the VB is the highest occupied (by electrons). When an electron is excited (for example optically by laser light) to the CB it eventually relaxes down to the VB by recombining with a hole. This process can be radiative, i.e. a photon is emitted, or non-radiative, i.e. the energy is released as heat (phonons).
When semiconductors are shrunk down to or below their characteristic exci-ton Bohr radius (aB), the “quantum confinement effect” leads to a
quantiza-tion of the VB and CB and to an increase in the bandgap. More precisely, the bandgap becomes dependent on the size of the NC, as shown in Fig.1 [17]. This means that a single material system can emit light in a wide wavelength range, one such materials system is oxidized silicon NCs.
Silicon (Si) is a semiconducting material of interest for use in NCs since it is inexpensive, abundant, bio-compatible and bio-degradable. There are other NC materials which are already embedded in currently available devices. For example Sony and Samsung have both produced televisions using NCs (CdSe and InP respectively) as red and green phosphors in their back lighting panels, improving their color gamut compared to current technology [23, 24]. However, most of currently commercially available NCs are either toxic (e.g. Pb, Cd, In, etc.) and/or made of less abundant and expensive materials (e.g. In, Se, Te, etc.). Silicon is of interest since it, (as stated earlier) is inexpensive, abundant, bio-compatible and bio-degradable.
So far silicon NCs have been fabricated with band gaps ranging from ∼1.4 to ∼3.5 eV (by altering size, shape and with different surface ligands) [25]. Si-NCs have been made with PL lifetimes varying between ∼10 ns and ∼10 ms depending on the temperature and the size of the NCs [26, 27]. Very narrow room temperature PL linewidths of ∼25 meV which rival direct-bandgap QDs and conventional dyes [28] have also been achieved. In addition, Silicon NCs have also been fabricated with near-unity internal quantum efficiencies (IQE) [14]. All these results are very promising for a future application of Si-NCs applications such as:
• bio-markers [29]: as explained before, Si-NCs can achieve narrower PL linewidths than currently conventional dyes, thus they could be used for fluorescence multiplexing [9]. Moreover, they do not suffer from photo-bleaching [30] which currently used technology does; • phosphors in LEDs: replacing the rare-earth elements that are
cur-rently used as red/green phosphors in commercially available white LEDs;
• down-converters in photovoltaics: for example by embedding them in a glass window to absorb UV-light and emit “reddish” light that can be efficiently converted by a standard Si photo-voltaic cell installed in the frame [31].
2.2
Blinking in nanocrystals
Upon continuous-wave excitation, a NC can randomly jump between a bright radiative "ON state" and a dark non-radiative "OFF state", as shown in Fig.2. 0 1000 2000 3000 4000 5000 -200 0 200 400 600 I n t e n s i t y ( a r b . u . ) Time (s)
Figure 2: (Left) PL intensity time trace of a single Si/SiO2-QD with a
binning time of 0.5 s clearly showing a blinking behavior. (Right) Total intensity histogram of the trace.
There are several theories attempting to explain this blinking and experi-ments have shown that the ON- and OFF- time statistics vary depending on the material and the surrounding matrix of the NC. Generally two types of blinking are present: type-A and type-B [12].
• Type-A blinking: While being excited the NC can get charged. If a charge is present, non-radiative Auger recombination takes place and the NC switches to the OFF state. Once the charge is neutralized the NC returns back to the radiative ON state [32]. This theory is sup-ported by the fact that thick-shell CdSe-NCs (i.e. NCs with a smooth confining potential) exhibit very low Auger rates, and type-A blinking can be entirely suppressed [33]. In type-A blinking the length of these ON and OFF events follow a truncated power law probability distri-bution (see Formula.1) and preceding ON events affect the successive OFF events length.
for t > tmin where N is a scaling constant ensuring the total area is one,
t is time and k is a time constant greater than 1. The constant must be above one or the tail will be infinite and there must be a lower limit t > tmin since at zero an non-truncated power law approaches infinity.
• Type-B blinking: When an electron is exited it can (if given enough energy) pass the potential barrier separating the NC from the sur-rounding matrix and get trapped in an interface or matrix trap. This charges the NC and efficient non-radiative Auger recombination takes place [32]. This model is supported by the fact that annealing can decrease type-B blinking. Indeed, annealing can repair lattice abnor-malities like charge traps thus decreasing blinking. Type-B blinking is typically mono exponential (see Formula.2 and Fig.3) and there is no link between a certain ON time and the following OFF time (as opposed to A-type blinking).
f (t) = N e
−
τt (2)where N is a scaling constant ensuring the total area is one, t is time and τ is the time constant.
0 5 10 15 20 25 1 10 100 ON Data ON Linear Fit OFF Data OFF Linear Fit
O c c u r e n c e Time (s) OFF = 4.14 0.07 s ON = 7.65 0.06 s
3
Experimental Setup
3.1
Sample Preparation
An N-type silicon wafer was spun with negative electron-sensitive resist (HSQ 6%) at 6000 rpm for 25 s and then baked at 150◦C for 10 min. A 200x200
µm2 pattern was then formed by EBL (Electron Beam Lithography) with
MF-CD26 development for 1 min (see Fig.5).This pattern was then further defined with 50 s of reactive ion etching using HBr, Cl2 and HeO2. The sample was finally oxidized at 900◦ C for 30 min [22] (as seen in Fig.4).
Figure 4: a) Bare Wafer. b)Negative electron resist added. c)EBL expo-sure. d)MF-CD26 development. e)Reactive ion etching. f)Oxidation. g-i) Different patterns formed [34].
3.2
X-Ray Irradiation Chamber Setup
The sample was irradiated by putting it in a holder 5 cm away from the focal point of a Hamamtsu L9181-04 X-ray source kept inside a lead-shielded chamber. The emission spectrum of the source confidentially provided by Hamamtsu (i.e. not reported here) reveals that there is a peak at ∼10 keV with a tail till 100 keV. The source was set to run at 130 kV and 300 µA (maximum power) in continuous mode. It should be noted that the sample had already been irradiated in earlier experiments with a cumulative dose of ∼65 kGy [21] using the same setup and settings.
3.3
PL Setup
The PL measurements were done on a Zeiss Observer Z1m inverted micro-scope with a 100x Nikon 0.9 NA lens. Using an Andor iXon 888 EMCCD camera (thermo-electrically cooled at -100° C) installed in a side port to ac-quire PL sequences. The sample was place upside down on a platform above the lens and was excited using an Omicron PhoxX 405 nm diode laser set in CW mode at 30 mW power at a 70° incident angle (relative to the surface normal) in dark-field configuration. The resulting mean excitation power density was estimated as ∼10 W/cm2. The fluorescence cube used during
the PL measurements consisted of a 395-440 nm Zeiss band-pass filter for the excitation, a 460 nm Zeiss short-pass dichroic mirror (with an upper cutting edge at 750 nm) and a Semrock 442 nm ultra-steep long-pass edge filter. While acquiring the PL sequences the following camera parameters were used:
• acquisition time: ∼2 Hours • number of frames: 10 000 Frames • read-out time: 0.5 Seconds
• read-out delay time: 0.1 Seconds • pre-amplifier gain: x5.2
• EM gain: 20
• pixel read-out rate: 10 MHz
3.4
Blinking analysis
As mentioned previously NCs blink with a certain ON-state intensity, with varying ON and OFF times according to an unknown distribution. Usually, when acquiring a blinking trace of a dot, these factors are unknown and the intensity data is affected by noise. This noise is composed of both systematic and experimental sources:
• Shot Noise: This type of noise has a Poissonian distribution and is caused by the fact that photons are emitted by the NC at random. This type of noise only becomes relevant when the number of emitted photons gets small enough. Our Si-NCs emit photons in the order of hundreds per second (when they are ON). Which corresponds to a maximum error of ± 31 EMCCD Counts/NC (using a 3x3 pixel array for a single NC) but this value varies between NCs.
• EMCCD Noise: This type of noise is due to the read-out process of the EMCCD and in our case can be estimated as ± 18 EMCCD Counts/NC.
Figure 8: Schematic supplied by the manufacturer of camera showing the steps to calculate from EMCCD counts to photons or vice versa [35].
These noise sources sum up to white noise i.e. a normal distribution sur-rounding the NCs ON and OFF levels (as seen in Fig.2). This is what makes reconstructing the original blinking distribution hard, here follows a tutoring section to explain the type of noise on the final retrieved distribution data caused by this.
Consider ideal blinking with an OFF state at intensity 0 and an ON state at 100, with a set of switching times. This would correspond to a plot like Fig.9.
Now consider if low variance white noise is added on top of that signal then your data would look like Fig.10.
Figure 10: PL intensity time trace of a blinking QD with white noise and a histogram to display the noise width
Figure 11: Simulated PL intensity traces of a blinking QD: (left) original trace with low levels of white noise and (right) reconstructed trace by thresh-olding (threshold is indicated with a red line on the left).
Figure 12: Simulated PL intensity traces of a blinking QD: (left) origi-nal trace with high levels of white noise and (right) reconstructed trace by thresholding (threshold is indicated with a red line on the left).
Figure 13: Time vs. Intensity plot displaying the three different types of errors that occur when reconstructing the original signal
In Figure 13 you can see three kinds of errors, lets name and explain them: 1. Missed Blinking Error: The dot is OFF and turns ON but this isn’t
detected for one or more frames because the measured signal is so low that it falls below the switching limit. Which means an entire blinking event is missed and two blinking events are combined as one. This is a problem in very fast blinking dots with ON/OFF times in the order of only one to ten frames.
2. False Blinking Error: The dot doesn’t go from ON to OFF but the measured signal is lower than the limit and it is registered as a blink-ing event. Effectively cuttblink-ing the ON/OFF time into two pieces and also adding a false blinking event. This is a bigger problem in slower blinking dots as this increases the odds of detecting a false event at any point when the dot is ON/OFF and thus corrupting one of only a few events.
additional ± error to the entire set of ON and OFF times corresponding to this formula AverageError = 1 ∗ n + 2 ∗ n2+ 3 ∗ n3+ ...where n is
the odds of missing a single frame
The probability of these errors occurring actually corresponds to the ON and OFF noise distributions. For example if your dot is currently OFF and turns ON the green region in Fig.14 (purple for ON to OFF) corresponds to the likelihood of not switching to ON each frame after it has turned ON. Meaning that if a signal is n frames long that probability raised to the power n is the probability of entirely missing that event (Missed Blinking Error). The average Edge Blinking Error is the average number of frames missed due to this (AverageError = 1 ∗ n + 2 ∗ n2 + 3 ∗ n3 + ...). This error will
Figure 14: Two overlapping normal distributions representing the white noise of a simulated blinking QD centered on the ON and OFF states with the percentile area of the ON and OFF state that overlap past the switching limit shown.
(a) ON to OFF limit
(b) OFF to ON limit
Figure 15: Two Figures showing the percentile areas corresponding to dif-ferent limits
For example if you measure for 10 000 Frames and the dot blinks 249 times (124 jumps from OFF to ON and 125 jumps from ON to OFF) and the dot is in the ON state for 4000 Frames and in the OFF state for 6000. This means that to minimize errors of all kinds the limits should be set so the ratio between the odds is the reverse of blinking events to that state to the number of frames in that state. Which in this case is the ratio of 125 to 6000 for the OFF to ON limit and 124 to 4000 for the ON to OFF limit. Or in other words for the ON limit there should be a 32 times lower chance for a "False Blinking Error" than a "Missed/Edge Blinking Error" event (e.g. 20.14% chance for "False Blinking Error" and 0.63% chance for "Missed/Edge Blinking Error" as seen in Fig.16). The probability ratio for the OFF limit is ∼48.39 and the limit should be set in the same way there.
Figure 16: The OFF to ON limit set based on the blinking events measured in a previous iteration with different limits.
4
Results
The image sequences that were generated as described in the "Experimental Setup" were studied using the plugins and scripts described in the "Ap-pendix". This data of single NCs were compiled both as assembles in his-tograms and individually in single dot line graphs of selected dots. This was done to both get a perspective on the sample as a whole and on individual NCs.
4.1
Number of luminescent objects
0 50000 100000 150000 200000 250000 300000 -20 -10 0 10 20 30 40 50 60 R e l a t i v e n u m b e r o f l u m i n e s c e n t o b j e c t s ( % )
Absorbed Dose (SiO2) (Gy)
Irradiated Sample Reference Sample
(a) 2016-05-11, Day 0 (b) 2016-05-19, Day 8
(c) 2016-05-26, Day 15 (d) 2016-06-02, Day 22
(e) 2016-06-09, Day 29 (f) 2016-06-14, Day 34
(a) 2016-04-26, 0 Gy (b) 2016-05-18, 23648 Gy
(c) 2016-05-25, 47296 Gy (d) 2016-06-01, 82767 Gy
(e) 2016-06-08, 130063 Gy (f) 2016-06-15, 271950 Gy
Figure 20: PL images of the irradiated sample at different absorbed irradia-tion doses (of the SiO2). Each image is the sum of its corresponding image
A unforeseen discovery was a clear increase in double dots (a blinking line profile with three or four defined levels see Fig. 21) with absorbed irradiation dose (see Fig.22). Which seems to max saturate somewhere between 83 000-130 000 Gy at an increase of ∼25%. 0 1000 2000 3000 4000 5000 0 200 400 600 800 I n t e n s i t y ( a r b . u . ) Time (s)
Figure 21: Line profile of a detected luminous object clearly showing three distinct levels (a less defined fourth is visible) of luminescence intensity.
0 50000 100000 150000 200000 250000 300000 0 5 10 15 20 25 30 R e l a t i v e N u m b e r o f D o u b l e D o t s ( % )
Absorbed Dose (SiO2) (Gy)
Irradiated Sample Reference Sample
4.2
Single-dot Blinking Analysis
Every luminescent NC detected was studied and the NCs with a good enough SNR (signal-to-noise ratio) were used and will be shown here in multiple plots. The dots were studied in terms of their ON Intensity, their ON Per-centage and the ON and OFF time constants associated with their blinking (each data point will be explained in detail in its individual section).
4.2.1 ON Intensity
0 50000 100000 150000 200000 250000 300000 0 100 200 300 400 500 600 700 O N I n t e n s i t y ( a r b . u . )
Absorbed Dose (SiO2) (Gy)
Dot M9 Dot M12 Dot M13 Dot M14 Dot M22 Dot M28 Dot M29 Dot M33 Mean
(a) Irradiated Sample
0 5 10 15 20 25 30 35 40 0 100 200 300 400 500 O N I n t e n s i t y ( a r b . u . ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7 (b) Control Sample
his-10 20 30 12 24 36 11 22 33 12 24 36 13 26 39 0 100 200 300 400 500 600 700 0 11 22 0 Gy 211,47 23648 Gy 187,89 47296 Gy N u m b e r o f N C s 229,41 82767 Gy 186,73 130063 Gy 190,79 271950 Gy
ON Intensity (arb. u.) 151,93
4.2.2 ON Percentage
The ON percentage is the percentile time that the dot is emitting light vs the total time measured. This data point was retrieved in three different ways throughout the processing.
1. Using The Normal Fittings The area of the ON state normal dis-tribution retrieved during processing divided by the total area of both normal distributions retrieved. ON Percentage = AON/(AON + AOF F)
(see Fig.2 on p.9, the histogram on the right side of the figure is fit with two normal distributions with the top being the ON state) 2. Using The ON and OFF Times During processing the original
noisy signal is converted to a binary trace of ON and OFF events. The total time of the ON events is compared vs the total time measured. 3. Using The ON and OFF Time Constants The ON and OFF
times previously mentioned are used in creating histograms and mono exponential formula fittings predict the individual NCs time constants. Theses constants are also used to calculate their predicted ON Percent-age.
0 50000 100000 150000 200000 250000 300000 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % )
Absorbed Dose (SiO2) (Gy) Dot M9 Dot M12 Dot M13 Dot M14 Dot M22 Dot M28 Dot M29 Dot M33 Mean
(a) Irradiated Sample
0 5 10 15 20 25 30 35 40 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7 (b) Control Sample
20 40 60 80 15 30 45 15 30 45 12 24 36 20 40 60 0 10 20 30 40 50 60 70 80 90 100 0 6 12 18 0 Gy 27,8% 23648 Gy 28,61% N u m b e r o f N C s 47296 Gy 27,35% 82767 Gy 27,35% 130063 Gy 28,81% ON Percentage (%) 271950 Gy 30,65 %
0 50000 100000 150000 200000 250000 300000 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % )
Absorbed Dose (SiO2) (Gy) Dot M9 Dot M12 Dot M13 Dot M14 Dot M22 Dot M28 Dot M29 Dot M33 Mean
(a) Irradiated Sample
0 5 10 15 20 25 30 35 40 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7 (b) Control Sample
20 40 60 80 15 30 45 15 30 45 12 24 36 20 40 60 0 10 20 30 40 50 60 70 80 90 100 0 6 12 18 0 Gy 28,48% 23648 Gy 28,94% N u m b e r o f N C s 47296 Gy 28,35% 82767 Gy 27,27% 130063 Gy 28,98% ON Percentage (%) 271950 Gy 30,19 %
0 50000 100000 150000 200000 250000 300000 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % )
Absorbed Dose (SiO2) (Gy) Dot M9 Dot M12 Dot M13 Dot M14 Dot M22 Dot M28 Dot M29 Dot M33 Mean
(a) Irradiated Sample
0 5 10 15 20 25 30 35 40 0 10 20 30 40 50 60 70 80 90 100 O N P e r c e n t a g e ( % ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7 (b) Control Sample
5 10 15 4 8 12 3 6 9 3 6 9 6 12 18 0 10 20 30 40 50 60 70 80 90 100 3 6 9 0 Gy 37,36% 23648 Gy 38,02% 47296 Gy 43,1% N u m b e r o f N C s 82767 Gy 37% 130063 Gy 39,77% ON Percentage (%) 271950 Gy 42,1 %
4.2.3 ON and OFF Time Constants
9 18 27 8 16 24 4 8 12 7 14 21 8 16 24 0 5 10 15 20 25 30 35 40 45 50 3 6 9 0 Gy 7,42 23648 Gy 9,91 47296 Gy 9,04 N u m b e r o f N C s 82767 Gy 10,84 130063 Gy 15,16 ON (s) 271950 Gy 13,75
6 12 18 4 8 12 4 8 12 4 8 12 7 14 21 0 10 20 30 40 50 60 70 80 90 100 3 6 9 0 Gy 28.07 23648 Gy 25.75 47296 Gy 25.83 N u m b e r o f N C s 82767 Gy 25.04 130063 Gy 37.52 OFF (s) 271950 Gy 28.07
0 50000 100000 150000 200000 250000 300000 0,1 1 10 100 1000 O N ( s )
Absorbed Dose (SiO2) (Gy) Dot M9 Dot M12
Dot M13 Dot M14 Dot M22 Dot M28 Dot M29 Dot M33 Mean
(a) ON Time Constants.
0 50000 100000 150000 200000 250000 300000 1 10 100 1000 Dot M28 Dot M29 Dot M33 Mean O F F ( s )
Absorbed Dose (SiO2) (Gy) Dot M9 Dot M12 Dot M13 Dot M14 Dot M22
(b) OFF Time Constants.
0 5 10 15 20 25 30 35 40 0,1 1 10 100 O N ( s ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7
(a) ON Time Constants.
0 5 10 15 20 25 30 35 40 1 10 100 O F F ( s ) Time (Days) Dot C4 Dot C5 Dot C6 Dot C7
(b) OFF Time Constants.
5
Conclusions
In this work the irradiated sample (named "20100407III") was irritated in five steps with PL sequences taken of it and a control sample (named "20150407IV") between each irritation. From these PL sequences it was concluded that oxidized Silicon NCs are very radiation resistant or the sam-ple is room temperature annealing the charge traps and thereby maintaining the same luminescence [36] even at very large irradiation doses. Our sample has absorbed a total dose of ∼270 000 Gy (absorbed by the SiO2) and still
shows no statistical significant decrease in luminescence, no change in the mean ON and OFF time constants or the ON percentages.
Similar x-ray experiments using CdSe NCs and CdS1−xSex NCs embedded in
borosilicate glass have been studied multiple times with absorbed doses of up to ∼3500 Gy showing mixed results. With some studies showing an almost immediate decrease in luminescence after doses as small as ∼200 Gy [37, 38, 39] and others are totally unaffected after a total dose of ∼3200 Gy [40]. This suggest that not only does the surrounding matrix material choice affect the NCs stability, but also how this material is grown. This is something which is reflected in silicon dioxide; depending on in what environment silicon dioxide is grown it has a higher or lower resistance to x-ray radiation. In MOS oxide gate studies it was concluded that growing silicon dioxide in a hydrogen free environment resulted in more radiation resistant oxide [20]. This could be used to further stabilize silicon dioxide or inversely grow the oxide in a more hydrogen rich environment to make the oxide less radiation resistant.
If further work on this sample is to be performed I would recommend two experiments.
• Firstly Irradiate the sample for several hours and then immediately take 120 second images at intervals and look for a slow increase in luminescence. This would indicate that the sample is room temperature annealing and put a time scale of this process.
Appendix
Experiment Schedule
The irradiation’s and measurements schedule is summarized in this table:
Dates Notes
2016-04-26 Main Sample PL Measurement 2016-04-29 Main Sample PL Measurement 2016-05-11 Control Sample PL Measurement 2016-05-13 Control Sample PL Measurement 2016-05-17 First Irradiation: ∼4 hours 2016-05-18 Main Sample PL Measurement 2016-05-19 Control Sample PL Measurement 2016-05-24 Second Irradiation: ∼4 hours 2016-05-25 Main Sample PL Measurement 2016-05-26 Control Sample PL Measurement 2016-05-31 Third Irradiation: ∼6 hours 2016-06-01 Main Sample PL Measurement 2016-06-02 Control Sample PL Measurement 2016-06-07 Fourth Irradiation: ∼8 hours 2016-06-08 Main Sample PL Measurement 2016-06-09 Control Sample PL Measurement 2016-06-13/14 Fifth Irradiation: ∼24 hours 2016-06-14 Control Sample PL Measurement 2016-06-15 Main Sample PL Measurement
Table 1: The dates and the number of hours the sample was irradiated in each step in bold and each scan on what sample i plain text.
Statistical Evaluation of Data
Descriptions of how these plugins and scripts work, the source code and how they were used will be explained in this section. Starting with an explanation of the processing chain and then followed by a more detailed explanation of how each function operates and its code.
Andor Solis
The program used to setup the camera for the PL measurements was "Andor Solis" and the standard output format of this program is .sif which contains all relevant data concerning the camera settings used in imaging. It can also output into the .tif format which only contains the image series collected. During our experiments we saved in both formats only keeping the .sif files for their stored information for future reference and used the .tif files in the processing.
ImageJ Data Processing
The tif. files generated by Andor Solis (the camera control software) were first processed in ImageJ (an open source program made for image processing). The first step in ImageJ was to correct the acquired series of images for drift (lateral movements between images) since the later steps would not work if there was any drift. This was done using a semi automatic plugin written by Kang Li [43]. This plugin attempts to find the images movements and moves each to match the previous image thus stabilizing the image stack. After this step the image stack was summed to one single image using the imageJ function “Z Project. . . ” (See Appendix) and all the bright spots above a set noise threshold (20 000 in this work) in that image were marked and saved using the built in ImageJ function "Find Maxima..." as a series of coordinates. These coordinates were then used by the custom ImageJ function "Dot Trace Extractor" (created as a part of this work) together with the .tif file from Andor Solis to get the signal traces of each individual NC in a given image sequence to be further processed in Matlab.
Matlab Data Processing
their extraction and properties as outputs. The properties of these fittings were used in the graphs of this report and the ON and OFF events were used as the input in the final processing script "Log Linear Fitting". As its name suggests it took these ON and OFF events and after placing the events in a histogram made a log linear fitting to it. This fittings values were output and used to calculate the average ON and OFF times constants, which were the final data points of this work.
ImageJ Methods Used
ImageJ version used was 1.50b and the functions mentioned below are those built into this version.
Image - Stacks - Z Project. . .
Figure 35: User interface of the ImageJ plugin "Z Project..." This function takes all Images in a stack
Process - Find Maxima. . .
Figure 36: User interface of the ImageJ plugin "Find Maxima..."
Custom ImageJ Plugins
Dot_Trace_Extractor.py
Figure 37: Setup screen layout of "Dot Trace Ex-tractor".
This plugin requires an already opened and se-lected image stack and asks the user to input a .txt file with coordinates (the coordinates of the QDs generated by the "Find Maxima" function in ImageJ or in the same format). After the .txt file has been selected a settings screen opens (see Fig.37) where the user select the options for the traces to be extracted. It lets the user choose the detection area (the area around each coordinate to use as the intensity of the NCs). This also sets the frame as a single pixel frame surrounding the detection area selected and can be subtracted from the detection Intensity to compensate for focus loss/gain during the measurements (loss/-gain of intensity will give a slope of the signal which would ruin it for the next steps). It then gives you the option to pick which series of coor-dinates given in the document to calculate, this is useful if you want to plot the result since if you have too many plots ImageJ will run out of memory and crash. This is followed by the “Plotting Parameters” here you choose if and or what you want to plot and the plot sizes to out-put (affects memory impact). This is followed by the options regarding the output table, where you choose whether to output the “Intensity”, “Frame” or “Intensity-Frame” or all three. This is outputted (after the program is run) to an
1 # W r i t t e n by Carl von T r e s k o w 2 # 2016
3 # Code b a s e d upon J a v a s c r i p t code w r i t t e n by B e n j a m i n
B r u h n and m o d i f i e d by F e d e r i c o P e v e r e
4
5 # This code o p e n s a . txt d o c u m e n t c o n t a i n i n g the
c o o r d i n a t e s of the QDs in a s t a c k and then uses this map to e x t r a c t the i n t e n s i t y of each QD in an i m a g e s t a c k to a r e s u l t s t a b l e and as m u l t i p l e p l o t s . 6 7 8 9 # I m p o r t s f u n c t i o n s from I m a g e J 10 from ij i m p o r t IJ , I m a g e P l u s , I m a g e S t a c k 11 from ij . p r o c e s s i m p o r t I m a g e P r o c e s s o r 12 from ij . io i m p o r t O p e n D i a l o g 13 from ij . m e a s u r e i m p o r t R e s u l t s T a b l e , C u r v e F i t t e r 14 from ij . gui i m p o r t Plot , G e n e r i c D i a l o g
15 # I m p o r t s f u n c t i o n s from J y t h o n 16 from sys i m p o r t exit 17 18 # C a l c u l a t e s the a v e r a g e and s t a n d a r d d e v i a t i o n of the i n p u t data 19 def S t a n d a r d D e v i a t i o n ( PlotData , L e n g t h ) : 20 S t a n d a r d _ D e v i a t i o n = 0 21 A v e r a g e = sum ( P l o t D a t a ) / len ( P l o t D a t a ) 22 for s in r a n g e (0 , L e n g t h ) : 23 S t a n d a r d _ D e v i a t i o n += ( P l o t D a t a [ s ] - A v e r a g e ) **2 24 S t a n d a r d _ D e v i a t i o n = ( S t a n d a r d _ D e v i a t i o n / L e n g t h ) * * 0 . 5 25 r e t u r n S t a n d a r d _ D e v i a t i o n , A v e r a g e ; 26 27 # D r a w s a plot of i n p u t data
28 def P l o t _ Q D ( Name , Time , PlotData , P l o t W i d t h , P l o t H e i g h t ,
30
31 P l o t T e m p = Plot ( Name ," Time ( s ) "," I n t e n s i t y ( arb . u ) ", Time , P l o t D a t a )
32 P l o t T e m p . s e t F r a m e S i z e ( int ( P l o t W i d t h ) , int (
P l o t H e i g h t ) )
33 P l o t T e m p . s e t L i m i t s (0 , Length , Avg - S t D e v *7 , Avg +
S t D e v *7) 34 35 r e t u r n P l o t T e m p ; 36 37 # I m p o r t i n g I m a g e o b j e c t from I m a g e J 38 Img = IJ . g e t I m a g e () 39 # I m p o r t i n g s t a c k of i m a g e s from I m a g e J 40 S t a c k = Img . g e t S t a c k () 41 # N u m b e r of i m a g e s in i m a g e s e q u e n c e 42 L e n g t h = S t a c k . g e t S i z e () 43 # H e i g h t of i m a g e s 44 H e i g h t = Img . g e t H e i g h t () 45 # W i d t h of i m a g e s 46 W i d t h = Img . g e t W i d t h () 47 # The n u m b e r of p i x e l s 48 D i m e n s i o n = ( W i d t h * H e i g h t )
49 # Pre - a l l o c a t e s a r r a y that will c o n t a i n the p i x e l s 50 P i x e l s = [ D i m e n s i o n ]
51 # I m a g e J t a b l e to c o n t a i n r e s u l t i n g data 52 R e s u l t s = R e s u l t s T a b l e ()
53 # The v a l u e s are i n t e g e r s so I set d e c i m a l p l a c e s to
zero in the r e s u l t s t a b l e 54 R e s u l t s . s e t P r e c i s i o n (0) 55 56 # Size of plot c r e a t e d by p l u g i n 57 P l o t W i d t h = 900 58 P l o t H e i g h t = 300 59
60 # Sets s t a n d a r d v a l u e s for the d i a l o g box 61 S t D e v = 0
64 P l o t N o i s e = F a l s e 65 P l o t C o m b = F a l s e 66
67 # O p e n s d i a l o g to find the . txt d o c u m e n t c o n t a i n i n g
the QD Map and r e a d s it
68 File = O p e n D i a l o g (" C h o o s e Dot Map ") 69
70 # C o u n t s the n u m b e r of l i n e s in the file s e l e c t e d for
use in the d i a l o g
71 L i n e s = len ( open ( File . g e t P a t h () ) . r e a d l i n e s ( ) ) -1 72
73 # C r e a t e s a D i a l o g used for s p e c i f y i n g P l o t t i n g and
93 S e t u p O p t i o n s . a d d M e s s a g e (" S e l e c t What Data to O u t p u t : ") 94 S e t u p O p t i o n s . a d d C h o i c e (" O u t p u t ",[" I n t e n s i t y ", " F r a m e ", " Int - F r a m e "] ," I n t e n s i t y ") 95 96 S e t u p O p t i o n s . a d d M e s s a g e (" O u t p u t All Data ") 97 S e t u p O p t i o n s . a d d C h e c k b o x (" Get All R e s u l t s ", A l l D a t a ) 98 S e t u p O p t i o n s . s h o w D i a l o g () 99 if S e t u p O p t i o n s . w a s C a n c e l e d () : 100 exit (" C l o s e d P r o p e r l y ") 101
102 # Gets the V a l u e s e n t e r e d into the d i a l o g box and
a l l o c a t e s m e m o r y b a s e d on the s e t t i n g s 103 Q D A r e a = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 104 Q D F r a m e = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 105 106 if ( Q D A r e a %2) == 1: 107 Q D A r e a = ( QDArea -1) /2 108 Q D F r a m e = ( QDFrame -1) /2 109 110 else: 111 Q D A r e a = Q D A r e a /2 112 Q D F r a m e = Q D F r a m e /2 113 114 S t a r t Q D = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 115 E n d Q D = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 116 P l o t W i d t h = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 117 P l o t H e i g h t = int ( S e t u p O p t i o n s . g e t N e x t N u m b e r () ) 118 O u t D a t a = S e t u p O p t i o n s . g e t N e x t C h o i c e () 119 120 if S t a r t Q D > E n d Q D :
121 exit (" The s t a r t i n g v a l u e must be s m a l l e r than the e n d i n g v a l u e ")
122
127 128 if P l o t I n t : 129 P l o t Q D D a t a = [ None ]* L e n g t h 130 P l o t Q D S t a c k = I m a g e S t a c k ( P l o t W i d t h +80 , P l o t H e i g h t +55) 131 132 if P l o t N o i s e : 133 P l o t N o i s e D a t a = [ None ]* L e n g t h 134 P l o t N o i s e S t a c k = I m a g e S t a c k ( P l o t W i d t h +80 , P l o t H e i g h t +55) 135 136 if P l o t C o m b : 137 P l o t Q D _ N o i s e D a t a = [ None ]* L e n g t h 138 P l o t Q D _ N o i s e S t a c k = I m a g e S t a c k ( P l o t W i d t h +80 , P l o t H e i g h t +55) 139 140 if P l o t I n t or P l o t N o i s e or P l o t C o m b : 141 Time = [] 142 for i in r a n g e (1 , L e n g t h +1) : 143 Time . a p p e n d ( i ) 144 145 % O p e n s the . txt d o c u m e n t to be read 146 file = open ( File . g e t P a t h () )
147 # R e a d s f i r s t line o u t s i d e of loop s i n c e it c o n t a i n s
no data
148 Line = file . r e a d l i n e () 149
150 % L o o p s past l i n e s that will not be used ( b a s e d on
user i n p u t in d i a l o g )
151 for i in r a n g e (1 , S t a r t Q D ) : 152 Line = file . r e a d l i n e () 153
154 # L o o p s t h r o u g h the rest of the . txt d o c u m e n t and
uses each line in it and the i m a g e s t a c k to c r e a t e QD B l i n k i n g T r a c e s for each dot
155 for i in r a n g e (0 , EndQD - S t a r t Q D +1) :
156 Line = file . r e a d l i n e ()
157 % S t o p s the loop is t h e r e is not i n f o r m a t i o n in
Line 158 if not Line : 159 b r e a k 160 V a l u e s = Line . s p l i t (" \ t ") 161 # C o n v e r t s the X C o o r d i n a t e v a l u e to int 162 X C o r d = int ( V a l u e s [1]) 163 # C o n v e r t s the Y C o o r d i n a t e v a l u e to int 164 Y C o r d = int ( V a l u e s [2]) 165
166 # W r i t e s t i t l e line to the r e s u l t s t a b l e in the
f o r m a t s p e c i f i e d by the user in the d i a l o g box
167 if A l l D a t a :
168 # One data type in one c o l u m n with QD ID , X
and Y C o o r d i n a t e s as the f i r s t t h r e e rows
169 R e s u l t s . s e t V a l u e ( i *3 ,0 , str ( S t a r t Q D + i ) ) 170 R e s u l t s . s e t V a l u e (1+ i *3 ,0 , str ( X C o r d ) ) 171 R e s u l t s . s e t V a l u e (2+ i *3 ,0 , str ( Y C o r d ) ) 172
173 else:
174 # All t h r e e data t y p e s in t h r e e c o l u m n s with
QD ID , X and Y C o o r d i n a t e s at the top if its own c o l u m n 175 R e s u l t s . s e t V a l u e ( i , 0 , S t a r t Q D + i ) 176 R e s u l t s . s e t V a l u e ( i , 1 , X C o r d ) 177 R e s u l t s . s e t V a l u e ( i , 2 , Y C o r d ) 178 179 # L o o p s t h r o u g h all i m a g e s to get i n t e n s i t y of each f r a m e 180 for j in r a n g e (1 , L e n g t h +1) : 181 # E x c t r a c t s v a l u e of all p i x e l s in i m a g e into a r r a y 182 P i x e l s = S t a c k . g e t P i x e l s ( j ) 183
a r o u n d that c o o r d i n a t e to i n c l u d e 185 I n t e n s i t y Q D = 0 186 for k in r a n g e ( - QDArea , Q D A r e a +1) : 187 for l in r a n g e ( - QDArea , Q D A r e a +1) : 188 I n t e n s i t y Q D += P i x e l s [ X C o r d + k +(( Y C o r d + l ) * W i d t h ) ] 189
190 # Gets the N o i s e of the dot s p e c i f i e d by the
c o o r d i n a t e s and the d i s t a n c e from the c o o r d i n a t e to c a l c u l a t e the n o i s e f r a m e 191 I n t e n s i t y N o i s e = 0 192 for k in r a n g e ( - QDFrame , Q D F r a m e +1) : 193 I n t e n s i t y N o i s e += \ 194 + P i x e l s [ X C o r d + k +( YCord - QDFrame -1) * W i d t h ] \ 195 + P i x e l s [ X C o r d + k +1+( Y C o r d + Q D F r a m e +1) * W i d t h ] \ 196 + P i x e l s [ XCord - QDFrame -1+( Y C o r d + k +1) * W i d t h ] \ 197 + P i x e l s [ X C o r d + Q D F r a m e +1+( Y C o r d + k ) * W i d t h ] 198 199 I n t e n s i t y N o i s e = ( f l o a t ( I n t e n s i t y N o i s e ) / ( ( ( ( ( Q D F r a m e ) *2) +1) *4) -4) ) *(( Q D A r e a *2) +1) *(( Q D A r e a *2) +1) 200
201 # Adds the data to r e s u l t s t a b l e with
208 R e s u l t s . s e t V a l u e ( i , j +2 , I n t e n s i t y Q D -I n t e n s i t y N o i s e ) 209 elif O u t D a t a == " I n t e n s i t y ": 210 R e s u l t s . s e t V a l u e ( i , j +2 , I n t e n s i t y Q D ) 211 else: 212 R e s u l t s . s e t V a l u e ( i , j +2 , I n t e n s i t y N o i s e ) 213
214 # Adds data to plot data a r r a y s if the p l o t s
were s e l e c t e d in the d i a l o g by the user
215 if P l o t I n t : 216 P l o t Q D D a t a [ j -1] = I n t e n s i t y Q D 217 if P l o t N o i s e : 218 P l o t N o i s e D a t a [ j -1] = I n t e n s i t y N o i s e 219 if P l o t C o m b : 220 P l o t Q D _ N o i s e D a t a [ j 1] = I n t e n s i t y Q D -I n t e n s i t y N o i s e 221
222 # D r a w s the p l o t s u s i n g the plot f u n c t i o n and add
each plot to its c o r r e s p o n d i n g plot s t a c k
234
235 # U p d a t e s the p r o g r e s s bar as the p r o g r a m l o o p s 236 IJ . s h o w P r o g r e s s ( i +1 , EndQD - S t a r t Q D ) 237 238 # Adds the I m a g e s t a c k s to I m a g e P l u s o b j e c t s to p r e p a r e them to be s h o w n 239 if P l o t I n t : 240 P l o t R e s u l t Q D = I m a g e P l u s (" QD I n t e n s i t y Plot ", P l o t Q D S t a c k ) 241 if P l o t N o i s e : 242 P l o t R e s u l t N o i s e = I m a g e P l u s (" N o i s e I n t e n s i t y Plot ", P l o t N o i s e S t a c k ) 243 if P l o t C o m b : 244 P l o t R e s u l t Q D N o i s e = I m a g e P l u s (" QD sub N o i s e I n t e n s i t y Plot ", P l o t Q D _ N o i s e S t a c k ) 245
Map_Translator.py
Figure 38: User interface of the ImageJ plugin "Map Translator" This plugin takes the coordinate points
1 # I m p o r t s f u n c t i o n s from I m a g e J
2 from ij i m p o r t IJ , I m a g e P l u s , I m a g e S t a c k 3 from ij . p r o c e s s i m p o r t I m a g e P r o c e s s o r
4 from ij . io i m p o r t O p e n D i a l o g
5 from ij . m e a s u r e i m p o r t R e s u l t s T a b l e , C u r v e F i t t e r 6 from ij . gui i m p o r t Plot , G e n e r i c D i a l o g ,
P o i n t R o i
7 # I m p o r t s f u n c t i o n s from J y t h o n 8 from sys i m p o r t exit 9 10 # I m p o r t s I m a g e o b j e c t from I m a g e J 11 Img = IJ . g e t I m a g e () 12 S t a c k = Img . g e t I m a g e S t a c k () 13 14 # Gets h e i g h t of i m a g e 15 H e i g h t = Img . g e t H e i g h t () 16 17 # Gets w i d t h of i m a g e 18 W i d t h = Img . g e t W i d t h () 19 20 # T o t a l N u m b e r of p i x e l s 21 D i m e n s i o n = ( W i d t h * H e i g h t ) 22 23 # C r e a t s an I m a g e J r e s u l t s t a b l e to c o n t a i n r e s u l t i n g data 24 R e s u l t s = R e s u l t s T a b l e () 25 R e s u l t s . s e t P r e c i s i o n (0) 26 X C o r d A r r a y = [] 27 Y C o r d A r r a y = [] 28 29 # O p e n s d i a l o g to find the . txt d o c u m e n t c o n t a i n i n g
the QD Map and r e a d s it
30 File = O p e n D i a l o g (" C h o o s e Dot Map ") 31
32 # C o u n t s l i n e s in d o c u m e n t
35 # P r e a l l o c a t e s the a r r a y s that will c o n t a i n the X and Y C o o r d i n a t e s 36 for L o o p 1 in r a n g e (1 , L i n e s +1) : 37 X C o r d A r r a y . a p p e n d (0) 38 Y C o r d A r r a y . a p p e n d (0) 39 40 # S t a r t v a l u e s of the d i a l o g box 41 F i n i s h e d = F a l s e 42 M o v e X = 0 43 M o v e Y = 0 44 45
46 # Also d i s p l a y s the map on the i m a g e a f t e r each
i t e r a t i o n of the d i a l o g box and s a v e s the c o o r d i n a t e s to the r e s u l t s t a b l e
47 w h i l e F i n i s h e d == F a l s e : 48
49 # G e n e r a t e s a d i a l o g box in this w h i l e loop that
is r e m a d e u n t i l the user c h e c k s the " Done ?" box and c l i c k the " ok " b u t t o n ( code p a u s e s at
62 # O p e n s the . txt file e v e r y t i m e to a l t e r the
c o o r d i n a t e s ( w h i c h m e a n s that the . txt file can be m a n u a l l y a l t e r e d in b e t w e e n i t e r a t i o n s
of the loop )
63 # It then gets all the c o o r d i n a t e s adds the X and
Y v a l u e set by the d i a l o g and adds / s u b t r a c s that v a l u e from all the c o o r d i n a t e p o i n t s
64 # and f i n a l l y adds them to the r e s u l t s t a b l e and
u p d a t e s the i m a g e with the new c o o r d i n a t e p o i n t s
65 file = open ( File . g e t P a t h () ) 66 Line = file . r e a d l i n e () 67 for L o o p 1 in r a n g e (0 , L i n e s ) : 68 Line = file . r e a d l i n e () 69 if not Line : 70 b r e a k 71 V a l u e s = Line . s p l i t (" \ t ") 72 X C o r d = int ( V a l u e s [1]) 73 X C o r d A r r a y [ L o o p 1 ] = X C o r d + M o v e X 74 Y C o r d = int ( V a l u e s [2]) 75 Y C o r d A r r a y [ L o o p 1 ] = Y C o r d + M o v e Y 76 77 R e s u l t s . s e t V a l u e (" X ", Loop1 , X C o r d + M o v e X ) 78 R e s u l t s . s e t V a l u e (" Y ", Loop1 , Y C o r d + M o v e Y ) 79 80 P o i n t s = P o i n t R o i ( X C o r d A r r a y , Y C o r d A r r a y ) 81 Img . s e t R o i ( P o i n t s ) 82
83 # D i s p a l y s the r e s u l t s t a b l e to the user so the user
can r e v i e w and then save it as a . txt file ( or . csv w h i c h is the s t a n d a r d but I used . txt with all my p r o g r a m s )
Custom Matlab Scripts
Blinking_Detector.m
1 f u n c t i o n B l i n k _ D e t e c t o r _ R e w r i t e
2 % O p e n s the file with the data to be read
3 [ FileName , P a t h N a m e ] = u i g e t f i l e(’ . txt ’,’ Get The QD Data ’) ; 4 if i s e q u a l ( FileName ,0) 5 disp(’ User C a n c e l e d P l u g i n ’) 6 r e t u r n 7 end 8 9 % O p e n s an i n p u t d i a l o g to i n p u t s e t t i n g s for the p l o t s and f i t t i n g s 10 p r o m p t = {’ Min V a l u e ’,’ Max V a l u e ’,’ E n t e r N u m b e r of Bins ’}; 11 d l g _ t i t l e = ’ I n p u t S e t t i n g s ’; 12 n u m _ l i n e s = 1; 13 d e f a u l t a n s = {’ 500 ’,’ 2500 ’,’ 200 ’}; 14 a n s w e r = i n p u t d l g ( prompt , d l g _ t i t l e , n u m _ l i n e s , d e f a u l t a n s ) ; 15
16 % E x t r a c t s data from d i a l o g box 17 M i n V a l u e = s t r 2 n u m( a n s w e r {1}) ; 18 M a x V a l u e = s t r 2 n u m( a n s w e r {2}) ;
19 Bins = s t r 2 n u m( a n s w e r {3}) ; % # ok <* ST2NM > 20
21 % E x t r a c t s the data from the txt file s e l e c t e d 22 disp(’ I m p o r t i n g Data T a b l e ’)
23 Temp = i m p o r t d a t a ( f u l l f i l e ( PathName , F i l e N a m e ) ) ; 24 if isa ( Temp ,’ s t r u c t ’)
25 Data = Temp . data ;
35 H e a d e r 2 = s t r c a t (n u m 2 s t r( H e a d e r 2 ) ,{’ X_ ’} ,n u m 2 s t r ( H e a d e r 3 ) ,{’ Y ’}) ; 36 H e a d e r 2 = r e g e x p r e p ( Header2 ,’ [^\ w ’ ’ ] ’,’ ’) ; 37 Data (1 ,:) =[]; 38 Data (1 ,:) =[]; 39 Data (1 ,:) =[]; 40 D a t a S i z e = size( Data ) ; 41
42 % D e c l a r e data v a l u e s used in c r e a t i n g the
h i s t o g r a m data and the h i s t o g r a m p l o t s
43 S t e p L e n g t h = ( MaxValue - M i n V a l u e ) / Bins ; 44 B i n B o u n d a r y V a l u e s = M i n V a l u e : S t e p L e n g t h : M a x V a l u e ; 45 B i n C e n t e r V a l u e s = M i n V a l u e +( S t e p L e n g t h /2) : S t e p L e n g t h : MaxValue -( S t e p L e n g t h /2) ; 46 H i s t D a t a = z e r o s( Bins , D a t a S i z e (2) ) ; 47 IsON = true ; 48 O N O F F R a t i o = 0; 49 S i g m a L i m = 3; 50
51 % L o o p s t h r o u g h the data and puts the data in
its c o r e s p o n d i n g bin for each i n d i v i d u a l c o l u m n 52 disp(’ C r e a t i n g H i s t o g r a m Data ’) 53 54 for i = 1: D a t a S i z e (2) 55 H i s t D a t a (: , i ) = h i s t c o u n t s ( Data (: , i ) , B i n B o u n d a r y V a l u e s ) ; 56 end 57 58 Area = sum( S t e p L e n g t h * H i s t D a t a ) ; % Area used for s c a l i n g the f i t t i n g plot to the h i s t o g r a m
59 Data ( Data > M a x V a l u e | Data < M i n V a l u e ) = NaN;
60 F i t t i n g D a t a = z e r o s(10 , D a t a S i z e (2) ) ;
%
P r e a l o c a t e s m e m o r y s p a c e to s p e e d up the loop
61
62 % L o o p s t h r o u g h each c o l u m n and fits its data
with two n o r m a l
63 % d i s t r i b u t i o n s and gets the f i t t i n g data 64 disp(’ F i t t i n g f u n c t i o n s to the data ’) 65 66 % un = 0; 67 for i = 1: D a t a S i z e (2) 68 F i t t i n g ( i ) 69 end 70 71 % P r e a l o c a t e s m e m o r y s p a c e to s p e e d up the loop 72 O N O F F T i m e s = z e r o s(ceil( D a t a S i z e (1) /2) ,(sum( F i t t i n g D a t a (7 ,:) > 0) *2) ) ; 73 D o t S p e c = {10 ,sum( F i t t i n g D a t a (7 ,:) >= 0) }; 74 B l i n k i n g D o t s = 0; 75 QDID = ’ ’; 76 D o t S p e c H e a d e r = char (9) ; 77 F o r m a t = ’ ’; 78 F o r m a t 2 = ’ ’; 79 F o r m a t 3 = ’ ’; 80 R o w N a m e s = {’ C o o r d i n a t e s ’,’ Mu ON ’,’ S i g m a ON ’,’ Mu OFF ’,’ S i g m a OFF ’,... 81 ’ P r o p o r t i o n ON ’,’ P r o p o r t i o n ON from B l i n k i n g ’,’ C e n t e r L i m i t ’,’ ON L i m i t ’,’ OFF L i m i t ’}; 82 B l i n k i n g = []; 83
84 % Uses the f i t t i n g data to get the O N O F F T i m e s
for each u s a b l e dot
85 disp(’ C a l c u l a t i n g ON OFF T i m e s ’) 86 for i = 1: D a t a S i z e (2)
87 if F i t t i n g D a t a (7 , i ) <= 0 88 c o n t i n u e
91 QDID = s t r c a t ( QDID , H e a d e r 1 ( i ) ,’ _ON ’,{ char (9) } , H e a d e r 1 ( i ) ,’ _OFF ’,{ char (9) }) ; 92 D o t S p e c H e a d e r = s t r c a t ( D o t S p e c H e a d e r , H e a d e r 1 ( i ) ,{ char (9) }) ; 93 F o r m a t = [ F o r m a t ’ % d \ t % d \ t ’]; % # ok < AGROW > 94 F o r m a t 2 = [ F o r m a t 2 ’ % s \ t ’]; % # ok < AGROW > 95 F o r m a t 3 = [ F o r m a t 3 ’ % d \ t ’]; % # ok < AGROW > 96 97 B l i n k i n g D o t s = B l i n k i n g D o t s + 1; 98 G e t O N O F F ( i , B l i n k i n g D o t s ) 99 D o t O u t p u t ( i , B l i n k i n g D o t s ) 100 end 101 F o r m a t = [ F o r m a t ’ \ n ’]; 102 F o r m a t 2 = [ F o r m a t 2 ’ \ n ’]; 103 F o r m a t 3 = [ F o r m a t 3 ’ \ n ’]; 104 O N O F F T i m e s ( O N O F F T i m e s == 0) = NaN; 105 106 disp(’ W r i t i n g O u t p u t Data ’)
107 % C r e a t e s a t a b l e from the O N O F F Data and
o u t p u t s that as a . txt file 108 temp = s t r s p l i t ( QDID {1} ,’ \ t ’) ; 109 a s s i g n i n (’ base ’,’ O N O F F _ D a t a ’, c e l l 2 t a b l e ( n u m 2 c e l l ( O N O F F T i m e s ) ,... 110 ’ V a r i a b l e N a m e s ’, temp (1:end-1) ) ) 111 temp = s t r s p l i t ( D o t S p e c H e a d e r {1} ,’ \ t ’) ; 112 a s s i g n i n (’ base ’,’ D o t _ D a t a ’, c e l l 2 t a b l e ( n u m 2 c e l l ( D o t S p e c ) ,... 113 ’ V a r i a b l e N a m e s ’, temp (1:end-1) ,’ R o w N a m e s ’, R o w N a m e s ) ) 114 w r i t e t x t ;
115 % End of c a l c u l a t i o n s rest of code is s i m p l y
used to draw p l o t s to
116 % r e v i e w the r e s u l t s v i s u a l l y
117 % -118
119 % C r e a t e s and d i s p l a y s a h i s t o g r a m and its
120 % lets the user s c r o l l t h r o u g h the dots and says
w h e t e r it is u s a b l e or
121 % not
145 N u m F i e l d = u i c o n t r o l(’ P a r e n t ’,d ,’ S t y l e ’,’ edit ’ ,... 146 ’ S t r i n g ’,’ I n s e r t QD N u m b e r ’,’ P o s i t i o n ’,[270 50 165 25]) ; 147 148 d . V i s i b l e = ’ on ’; 149 R e D r a w 150 disp(’ Done ’) 151 152 f u n c t i o n R e F i t ( source , c a l l b a c k d a t a ) 153 F i t t i n g ( Q D N u m ) 154 R e D r a w 155 156 if F i t t i n g D a t a (7 , Q D N u m ) < 0 157 disp([’ QD ’ n u m 2 s t r( Q D N u m ) ’ : Non - U s a b l e Fit ’]) 158 r e t u r n 159 end 160 E x i s t s = f a l s e ; 161 p a u s e( 0 . 1 )
162 for c = 1:size( Blinking ,2) 163 if B l i n k i n g ( c ) == Q D N u m 164 G e t O N O F F ( QDNum ,( c +1) /2) 165 D o t O u t p u t ( QDNum ,( c +1) /2) 166 E x i s t s = true ; 167 disp([’ QD ’ n u m 2 s t r( Q D N u m ) ’ : A l r e a d y exists , r e p l a c e d in o u t p u t ’]) 168 b r e a k 169 end 170 end 171 172 if E x i s t s == f a l s e 173 B l i n k i n g = [ B l i n k i n g Q D N u m ];
174 QDID = s t r c a t ( QDID , H e a d e r 1 ( Q D N u m ) ,’ _ON ’
,{ char (9) } , H e a d e r 1 ( Q D N u m ) ,’ _OFF ’,{ char (9) }) ;
176 % p a u s e ( 0 . 1 ) % Do not r e m o v e f i x e s QDID
e r r o r
177 B l i n k i n g D o t s = B l i n k i n g D o t s + 1; 178 G e t O N O F F ( QDNum , B l i n k i n g D o t s ) 179 D o t O u t p u t ( QDNum , B l i n k i n g D o t s )
180 disp([’ QD ’ n u m 2 s t r( Q D N u m ) ’ : Does not exist , a d d e d to t a b l e ’]) 181 end 182 temp = s t r s p l i t ( QDID {1} ,’ \ t ’) ; 183 a s s i g n i n (’ base ’,’ O N O F F _ D a t a ’, c e l l 2 t a b l e ( n u m 2 c e l l ( O N O F F T i m e s ) ,... 184 ’ V a r i a b l e N a m e s ’, temp (1:end-1) ) ) 185 temp = s t r s p l i t ( D o t S p e c H e a d e r {1} ,’ \ t ’) ; 186 a s s i g n i n (’ base ’,’ D o t _ D a t a ’, c e l l 2 t a b l e ( n u m 2 c e l l ( D o t S p e c ) ,... 187 ’ V a r i a b l e N a m e s ’, temp (1:end-1) ,’ R o w N a m e s ’, R o w N a m e s ) ) 188 w r i t e t x t ; 189 end 190
191 % This f u n c t i o n is c a l l e d when you p r e s s the "
Jump To " b u t t o n .
192 % It sets the v a l u e of Q D N u m to the v a l u e e n t e r e d
in the text f i e l d next
193 % to it and then c a l l s the r e d r a w f u n c t i o n 194 f u n c t i o n Jump ( source , c a l l b a c k d a t a )
207 R e D r a w
208 end
209
210 % This f u n c t i o n is c a l l e d when you p r e s s the
" - - - >" b u t t o n .
211 % It i n c r e a s e s the v a l u e of Q D N u m by one and then
c a l l s the r e d r a w 212 % f u n c t i o n . 213 f u n c t i o n R e p l o t N e x t ( source , c a l l b a c k d a t a ) 214 if Q D N u m == D a t a S i z e (2) 215 Q D N u m = D a t a S i z e (2) -1; 216 end 217 Q D N u m = Q D N u m + 1; 218 R e D r a w 219 end 220 221 f u n c t i o n R e p l o t P r e v i o u s ( source , c a l l b a c k d a t a ) 222 if Q D N u m == 1 223 Q D N u m = 2; 224 end 225 Q D N u m = Q D N u m - 1; 226 R e D r a w 227 end 228
229 % D r a w s the p l o t s for the c u r r e n t l y s e l e c t e d dot
254 x l a b e l(’ I n t e n s i t y ’) 255 y l a b e l(’ C o u n t s ’) 256 257 s u b p l o t(3 ,1 ,2) 258 plot( Data (: , Q D N u m ) ) 259 hold on 260 261 if T o u c h i n g == true 262 line( xlim ,[ F i t t i n g D a t a (8 , Q D N u m ) F i t t i n g D a t a (8 , Q D N u m ) ] ,’ L i n e W i d t h ’,1 ,’ c o l o r ’,’ r ’) 263 else 264 line( xlim ,[(( F i t t i n g D a t a (9 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2) (( F i t t i n g D a t a (9 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2) ] ,’ L i n e W i d t h ’,1 ,’ c o l o r ’,’ r ’ ) 265 line( xlim ,[(( F i t t i n g D a t a (10 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2) (( F i t t i n g D a t a (10 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2) ] ,’ L i n e W i d t h ’,1 ,’ c o l o r ’,’ r ’ ) 266 end 267 268 hold off 269 x l a b e l(’ Time ’) 270 y l a b e l(’ I n t e n s i t y ’) 271 272 set( txt ,’ S t r i n g ’,[’ QD : ’ n u m 2 s t r( Q D N u m ) ’ out of ’ n u m 2 s t r( D a t a S i z e (2) ) ]) 273 if F i t t i n g D a t a (7 , Q D N u m ) >= 0 274 set( check ,’ S t r i n g ’,’ U s a b l e QD ’) 275 else
276 set( check ,’ S t r i n g ’,’ Non - U s a b l e QD ’)
277 end
278 end
280 % Uses the the i n p u t e d n u m b e r r e f e r i n g to a
c o l u m n of data and u p p e r
281 % and l o w e r t h r e s h o l d to g e n e r a t e b l i n k i n g
s t a t i s t i c s for that p a r t i c u l a r
282 % data set and then w r i t e s this data down in two
310 e l s e i f T o u c h i n g == f a l s e 311 L o w e r L i m = ( F i t t i n g D a t a (10 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2; 312 H i g h e r L i m = ( F i t t i n g D a t a (9 , Q D N u m ) + F i t t i n g D a t a (8 , Q D N u m ) ) /2; 313 end 314 315 for c2 = 2: D a t a S i z e (1)
316 if Data ( c2 , Q D N u m ) > L o w e r L i m && IsON ==
339 O N O F F R a t i o = (sum( O N O F F T i m e s (: ,( C o l u m n T a b l e *2) -1) ) ) ./ D a t a S i z e (1) ; 340 end 341 342 if L i n e O N == true 343 O N O F F T i m e s (1:end-1 ,( C o l u m n T a b l e *2) -1) = O N O F F T i m e s (2:end, C o l u m n T a b l e *2 -1) ; 344 O N O F F T i m e s (end, C o l u m n T a b l e *2 -1) = NaN; 345 else 346 O N O F F T i m e s (1:end-1 , C o l u m n T a b l e *2) = O N O F F T i m e s (2:end, C o l u m n T a b l e *2) ; 347 O N O F F T i m e s (end, C o l u m n T a b l e *2) = NaN; 348 end 349 end 350
351 % Fits two n o r m a l d i s t r i b u t i o n s to the i n p u t e d
data and then w r i t e s down
352 % all the r e l e v a n t data from that f i t t i n g into
the m a t r i x " F i t t i n g D a t a "
353 % V a l u e s like , each d i s t r i b u t i o n s mu , sigma ,
p r o p o r t i o n , if the d i s t r i b u t i o n s
354 % are o v e r l a p i n g to a c r i t i c a l degree , the
m i d d l e p o i n t b e t w e e n the
355 % d i s t r i b u t i o n s and the u p p e r and l o w e r l i m i t s to
be used in the
356 % " O N O F F T i m e s " f u n c t i o n 357 f u n c t i o n F i t t i n g ( Line ) 358 w a r n i n g (’ off ’,’ all ’)
359 try
360 obj = f i t g m d i s t ( Data (: , Line ) ,2 ,’ s t a r t ’,’ plus ’) ;
361 c a t c h
362 disp( s t r c a t ( H e a d e r 1 ( Line ) ,’ : F a i l e d to fit r e t r y with R e F i t if the set l o o k s
good ’) )
363 r e t u r n
366 if obj . mu (1) > obj . mu (2) 367 F i t t i n g D a t a (1 , Line ) = obj . mu (1) ; 368 F i t t i n g D a t a (2 , Line ) = obj . S i g m a (1) ; 369 F i t t i n g D a t a (3 , Line ) = obj . C o m p o n e n t P r o p o r t i o n (1) ; 370 F i t t i n g D a t a (4 , Line ) = obj . mu (2) ; 371 F i t t i n g D a t a (5 , Line ) = obj . S i g m a (2) ; 372 F i t t i n g D a t a (6 , Line ) = obj . C o m p o n e n t P r o p o r t i o n (2) ; 373 else 374 F i t t i n g D a t a (1 , Line ) = obj . mu (2) ; 375 F i t t i n g D a t a (2 , Line ) = obj . S i g m a (2) ; 376 F i t t i n g D a t a (3 , Line ) = obj . C o m p o n e n t P r o p o r t i o n (2) ; 377 F i t t i n g D a t a (4 , Line ) = obj . mu (1) ; 378 F i t t i n g D a t a (5 , Line ) = obj . S i g m a (1) ; 379 F i t t i n g D a t a (6 , Line ) = obj . C o m p o n e n t P r o p o r t i o n (1) ; 380 end 381
382 F i t t i n g D a t a (7 , Line ) = abs( F i t t i n g D a t a (1 , Line )
- F i t t i n g D a t a (4 , Line ) ) ... 383 - (sqrt( F i t t i n g D a t a (2 , Line ) ) + sqrt( F i t t i n g D a t a (5 , Line ) ) ) ; 384 385 L e n g t h = ( F i t t i n g D a t a (4 , Line ) :1: F i t t i n g D a t a (1 , Line ) ) ’; 386 387 D i s t 1 = obj . C o m p o n e n t P r o p o r t i o n (1) .* pdf (’ N o r m a l ’, Length , obj . mu (1) ,sqrt( obj . S i g m a (1) ) ) ;
388 D i s t 2 = obj . C o m p o n e n t P r o p o r t i o n (2) .* pdf (’ N o r m a l ’, Length , obj . mu (2) ,sqrt( obj . S i g m a (2) ) ) ;
389 [ nu , pos ] = min(abs( Dist1 - D i s t 2 ) ) ; % # ok < ASGLU
>
391 F i t t i n g D a t a (8 , Line ) = F i t t i n g D a t a (4 , Line ) + pos ; 392 F i t t i n g D a t a (9 , Line ) = ( F i t t i n g D a t a (4 , Line ) + S i g m a L i m *sqrt( F i t t i n g D a t a (5 , Line ) ) ) ; % OFF Dist L i m i t 393 F i t t i n g D a t a (10 , Line ) = ( F i t t i n g D a t a (1 , Line ) -S i g m a L i m *sqrt( F i t t i n g D a t a (2 , Line ) ) ) ; % ON Dist L i m i t 394 395 end 396
397 % w r i t e s the data to be o u t p u t e d as " Dot Data ..."
Log_Linear_Fitting.m
This scripts takes a delimited .txt file formatted in the "Blinking Detector" output format; each column has a single title row and the columns alternate between ON and OFF in pairs with the data in variable length columns beneath their corresponding title rows. The script does a linear fitting to the logarithm of the histogram counts and then outputs this fitting and its parameters into a UI (as seen in Fig.41) so this fitting can be optimized by the user.
1 f u n c t i o n L o g _ L i n e a r _ F i t
2 % O p e n s the file with the data to be read
3 [ FileName , P a t h N a m e ] = u i g e t f i l e(’ . txt ’,’ Get The ON / OFF Data ’) ; 4 if i s e q u a l ( FileName ,0) 5 disp(’ User C a n c e l e d P l u g i n ’) 6 r e t u r n 7 end 8 9 % O p e n s an i n p u t d i a l o g to i n p u t s e t t i n g s for the p l o t s and f i t t i n g s 10 p r o m p t = {’ Min V a l u e ’,’ Step L e n g t h ’}; 11 d l g _ t i t l e = ’ I n p u t S e t t i n g s ’; 12 n u m _ l i n e s = 1; 13 d e f a u l t a n s = {’ 0.5 ’,’ 1 ’}; 14 a n s w e r = i n p u t d l g ( prompt , d l g _ t i t l e , n u m _ l i n e s , d e f a u l t a n s ) ; 15
16 % E x t r a c t s data from d i a l o g box 17 M i n V a l u e = s t r 2 n u m( a n s w e r {1}) ; 18 S t e p L e n g t h = s t r 2 n u m( a n s w e r {2}) ; 19
20 % E x t r a c t s the data from the txt file s e l e c t e d 21 disp(’ I m p o r t i n g Data T a b l e ’)
22 Temp = i m p o r t d a t a ( f u l l f i l e ( PathName , F i l e N a m e ) ) ; 23 Data = Temp . data ;
24 H e a d e r = Temp . t e x t d a t a ; 25 H e a d e r P = r e g e x p r e p ( Header ,’ _ ’,’ ’) ; 26 D a t a S i z e = size( Data ) ; 27 F i t t i n g D a t a = z e r o s(10 , D a t a S i z e (2) ) ; 28 29 disp(’ C r e a t i n g H i s t o g r a m Data ’) 30 H i s t D a t a = cell (1 , D a t a S i z e (2) ) ; 31 B i n C e n t e r V a l u e s = cell (1 , D a t a S i z e (2) ) ; 32 B i n B o u n d a r y V a l u e s = cell (1 , D a t a S i z e (2) ) ; 33 M a x V a l u e = ceil(max( Data ) ) +1;
36 B i n C e n t e r V a l u e s ( i ) = { M i n V a l u e +( S t e p L e n g t h /2) : S t e p L e n g t h : M a x V a l u e ( i ) -( S t e p L e n g t h /2) }; 37 B i n B o u n d a r y V a l u e s ( i ) = { M i n V a l u e : S t e p L e n g t h : M a x V a l u e ( i ) }; 38 end 39 40 for i = 1: D a t a S i z e (2) 41 H i s t D a t a { i } = z e r o s(1 ,size( B i n C e n t e r V a l u e s { i } ,2) ) ; 42 for j = 1: D a t a S i z e (1) 43 if i s n a n( Data ( j , i ) ) 44 b r e a k 45 end 46 for k = 1:size( B i n C e n t e r V a l u e s { i } ,2) 47 if Data ( j , i ) < B i n B o u n d a r y V a l u e s { i }( k +1) && Data ( j , i ) >= B i n B o u n d a r y V a l u e s { i }( k ) 48 H i s t D a t a { i }( k ) = H i s t D a t a { i }( k ) + 1; 49 b r e a k 50 end 51 end 52 end 53 end 54 55 H i s t N a N = cell (1 , D a t a S i z e (2) ) ; 56 for i = 1: D a t a S i z e (2) 57 H i s t D a t a { i }( H i s t D a t a { i } == 0) = NaN; 58 H i s t N a N { i } = i s n a n( H i s t D a t a { i }) ; 59 end 60
61 disp(’ F i t t i n g f u n c t i o n s to the data ’) 62 for i = 1: D a t a S i z e (2)
66 try 67 obj = f i t l m ( X , Y ,’ l i n e a r ’) ; 68 c a t c h 69 disp([’ E r r o r in F i t t i n g : ’ n u m 2 s t r( i ) ]) 70 end 71 w a r n i n g (’ on ’,’ s t a t s : L i n e a r M o d e l : R a n k D e f D e s i g n M a t ’) 72 Info = t a b l e 2 a r r a y ( obj . C o e f f i c i e n t s ) ; 73 F i t t i n g D a t a (1 , i ) = Info (1 ,1) ; 74 F i t t i n g D a t a (2 , i ) = Info (2 ,1) ; 75 F i t t i n g D a t a (3 , i ) = Info (1 ,2) ; 76 F i t t i n g D a t a (4 , i ) = Info (2 ,2) ; 77 end 78 F i t t i n g D a t a (5 ,:) = M i n V a l u e ; 79 F i t t i n g D a t a (6 ,:) = M a x V a l u e ; 80 F i t t i n g D a t a (7 ,:) = S t e p L e n g t h ; 81 F i t t i n g D a t a (8 ,:) = -1./ F i t t i n g D a t a (2 ,:) ; 82 83 for i = 1: D a t a S i z e (2) 84 Yint = - F i t t i n g D a t a (1 , i ) / F i t t i n g D a t a (2 , i ) ; 85 R a n g e = 0 . 2 5 : 0 . 5 : 1 0 * Yint ;
86 Area = sum( 0 . 5 *exp( F i t t i n g D a t a (1 , i ) + R a n g e *
95 F i t t i n g D a t a (10 , i ) = NaN;
96 end
97 end
98
99 disp(’ W r i t i n g O u t p u t Data ’)
100 % C r e a t e s a t a b l e from the O N O F F Data and
o u t p u t s that as a . txt file
101 R o w N a m e s = {’ I n t e r c e p t ’,’ S l o p e ’,’ Std E r r o r Int ’, ’ Std E r r o r S l o p e ’,’ Min V a l u e ’,’ Max V a l u e ’,’ Bin W i d t h ’,’ Avg Time from S l o p e ’,’ Avg Time from Int ’,’ P r o p o r t i o n ON ’}; 102 O u t p u t = c e l l 2 t a b l e ( n u m 2 c e l l ( F i t t i n g D a t a ) ,’ V a r i a b l e N a m e s ’, H e a d e r (1:end-1) ,’ R o w N a m e s ’, R o w N a m e s ) ; 103 a s s i g n i n (’ base ’,’ L o g _ L i n e a r _ F i t t i n g _ D a t a ’, O u t p u t ) 104 w r i t e t x t ; 105
106 % End of c a l c u l a t i o n s rest of code is s i m p l y
used to draw p l o t s to
107 % r e v i e w the r e s u l t s v i s u a l l y
108 %
-109 %
110
111 % C r e a t e s and d i s p l a y s a h i s t o g r a m and its
c o r r e s p o n d i n g f i t t i n g and
112 % lets the user s c r o l l t h r o u g h the dots and says
w h e t e r it is u s a b l e or
113 % not
121 plot([0 - F i t t i n g D a t a (1 ,1) / F i t t i n g D a t a (2 ,1) ] ,exp(
F i t t i n g D a t a (1 ,1) +[0 - F i t t i n g D a t a (1 ,1) / F i t t i n g D a t a (2 ,1) ]* F i t t i n g D a t a (2 ,1) ) ,’ L i n e W i d t h ’,2 ,’ C o l o r ’,’ r ’) ;
184 ’ P o s i t i o n ’,[365 80 70 25]) ; 185 186 S t e p F i e l d = u i c o n t r o l(’ P a r e n t ’,d ,... 187 ’ S t y l e ’,’ edit ’,... 188 ’ S t r i n g ’,n u m 2 s t r( F i t t i n g D a t a (7 ,1) ) ,... 189 ’ P o s i t i o n ’,[450 80 70 25]) ; 190 191 d . V i s i b l e = ’ on ’; 192 disp(’ Done ’) 193 194 f u n c t i o n Jump ( source , c a l l b a c k d a t a ) 195 Line = get( Choice , ’ V a l u e ’) ; 196 R e D r a w
197 end
198
199 f u n c t i o n R e F i t ( source , c a l l b a c k d a t a ) 200 % C h e c k if i n p u t is c o r r e c t
201 temp = s t r 2 n u m(get( MinField ,’ S t r i n g ’) ) ; 202 if i s e m p t y( temp ) 203 set( NumField ,’ s t r i n g ’,n u m 2 s t r( F i t t i n g D a t a (5 , Line ) ) ) ; 204 w a r n d l g (’ Min I n p u t not n u m e r i c a l ’) ; 205 r e t u r n 206 end 207 F i t t i n g D a t a (5 , Line ) = temp ; 208 R e M i n V a l u e = temp ; 209