<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts | Ray Garner</title><link>https://astronoraygarner.com/blog/</link><atom:link href="https://astronoraygarner.com/blog/index.xml" rel="self" type="application/rss+xml"/><description>Posts</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><image><url>https://astronoraygarner.com/media/icon_hu_eee4a95885829ab2.png</url><title>Posts</title><link>https://astronoraygarner.com/blog/</link></image><item><title>The Helix Nebula as seen by the Local Volume Mapper</title><link>https://astronoraygarner.com/blog/lvm_helixnebula/</link><pubDate>Thu, 21 May 2026 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/lvm_helixnebula/</guid><description>&lt;p&gt;One of the big surveys in astronomy is the
. Although it&amp;rsquo;s &amp;ldquo;old&amp;rdquo; by today&amp;rsquo;s standards, having started data collection in the far-off year of 2000, this survey was groundbreaking. It would survey the sky and take pictures in several different filters, resulting in the imaging of billions of objects. They also followed up with spectroscopy, taking the light from a distant object and splitting it up along wavelength to produce spectra; they did this for several million objects. And the science folks have done with this data is astounding, from looking at distant quasars in the early universe, the cosmological distribution of galaxies and large scale structure, to the properties of stars in our own Galaxy. SDSS was truly revolutionary.&lt;/p&gt;
&lt;p&gt;Every few years, SDSS gets upgraded. Maybe a specialized set of targets, maybe a new set of filters, maybe a new instrument. For instance, in 2005, SDSS started the
aimed at spectroscopy of stars in our Galaxy to make a 3D map. In 2014, SDSS started the
survey, a two-dimensional spectroscopy survey of nearly 10,000 nearby galaxies to study their star-forming regions. Most recently, SDSS was upgraded again, this time with the
(see also
), another two-dimensional spectroscopic survey to target nearby galaxies to study their star-forming regions in detail.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s where I come in. I study emission lines for a living, particularly those produced in star-forming regions in other galaxies. Briefly, take the Orion Nebula for example, a star-forming region in our own Galaxy. It once was just a cloud of gas and dust, but eventually it collapsed under its own weight to form a new generation of stars. Of those newly formed stars, the hottest and most massive stars emit a lot of ultraviolet light that radiates outwards. Those photons of light hit any gas that has not yet formed stars, heating it up, exciting it, which causes the gas to emit its own light. We see that light as emission lines, lots of light at very particular wavelengths. For example, hydrogen has a series of emission lines in the optical called the Balmer lines: the brightest is called Hα (H-alpha), emitting at a wavelength of 6562 Å. The next brightest is Hβ (H-beta), emitting at a wavelength of 4861 Å. Other elements emit at other wavelengths dependent on their atomic structure. Singly-ionized oxygen (that is, oxygen with one electron removed) emits a lot of light at 3727 Å. Doubly-ionized oxygen (that is, oxygen with two electrons removed) emits two bright emission lines at 4959 Å and 5007 Å.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="./BalmerLines.jpg" /&gt;
&lt;figcaption&gt;The visible hydrogen emission lines. H&amp;alpha; is the red line at the right, H&amp;beta; is the cyan line in the middle, H&amp;gamma; is the next blue line, etc.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;From these emission lines and their relative strengths (how bright they are compared with one another), we can learn a lot about the gas emitting them. We can learn about the abundance of elements in the gas, how highly ionized the gas is, the density of the gas, the temperature of the gas, so many things!&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s the point of me telling you all of this? Although the LVM has started to collect data, they&amp;rsquo;ve only
so far: the Helix Nebula (NGC 7293; see
). Unlike what I study, star-forming regions, the Helix Nebula is a planetary nebula in our own Galaxy. Planetary nebulae (which have nothing to do with planets or planet formation) are the sites of dead stars. When a star about the mass of our Sun dies, it will shed off the outer layers of its atmosphere, exposing its central hot core. We call that core a white dwarf. The white dwarf is very very very hot and emits a lot of ionizing light. That light will ionize what once was the star&amp;rsquo;s atmosphere and cause it to emit its own light, which we see as the nebula. Here&amp;rsquo;s the fun part: since there&amp;rsquo;s really only one star doing the ionizing, we&amp;rsquo;ll get a stratification of ionization: the highly ionized atoms and their light will be concentrated towards the center, with less ionized atoms and their light further out.&lt;/p&gt;
&lt;p&gt;Alright, that&amp;rsquo;s enough introduction. Let&amp;rsquo;s see some data!&lt;/p&gt;
&lt;h2 id="the-local-volume-mapper"&gt;The Local Volume Mapper&lt;/h2&gt;
&lt;p&gt;The Local Volume Mapper instrument is what&amp;rsquo;s called an &amp;ldquo;integral field spectrograph&amp;rdquo; or IFS. These are fiber-fed instruments where each optic fiber collects light from a particular part of the sky. You can imagine it this way: for a given object, cover that object in small circles. Each circle is a fiber that is collecting the light only in that circle. The collection of those circles is the spectrograph and together we have not only spectroscopic information in single fibers, but spectroscopic information across a two-dimensional area. The plot below shows the fiber layout for this data of the Helix Nebula.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./FiberMap.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;All of those circles are the individual fibers! Now, there are some holes. As the title of the plot suggests, I&amp;rsquo;ve only shown the &amp;ldquo;good&amp;rdquo; science fibers. The holes might be fibers that didn&amp;rsquo;t collect data, collected &amp;ldquo;bad&amp;rdquo; data (such as a star), or something was just wrong with the mechanical operation of that fiber. No worries, we&amp;rsquo;ve still got a lot of good fibers with good data.&lt;/p&gt;
&lt;p&gt;Speaking of data, we can use this to extract spectral information about the Helix Nebula. For instance, if we select the region around the Hα line, we can make an &amp;ldquo;image&amp;rdquo; of the nebula at this wavelength.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./HalphaWindow.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Ta-da! The Helix Nebula! Compare this plot to the image at the beginning of this post from the Hubble Space Telescope. Can you see the similar structures?&lt;/p&gt;
&lt;h2 id="integrated-spectrum"&gt;Integrated Spectrum&lt;/h2&gt;
&lt;p&gt;One of the simplest things to do with an integral field spectrograph is to ignore the two-dimensional information and just add together the light from every fiber. This produces an &amp;ldquo;integrated&amp;rdquo; spectrum: the spectrum of the entire object. There&amp;rsquo;s a statistical benefit to doing this as well: since we&amp;rsquo;re adding up the light from a lot of fibers (1,754 fibers to be exact), the uncertainty in our measurements goes down. We&amp;rsquo;ll also be able to more clearly see faint emission lines, many of which are important to determine the physical quantities of the nebula. And we can see a lot of the lines! Not only are these observations from the LVM deep (meaning they stare at the object for a while), they sample a long wavelength range from the very blue optical light into the near-infrared (3600 - 9800 Å, in case you&amp;rsquo;re curious).&lt;/p&gt;
&lt;p&gt;A quick note about emission line labeling. There are two types of emission line labeling, permitted and forbidden lines. Permitted lines are called permitted because they easily happen in labs here on Earth. In the plot below, these are lines without square brackets around them, such as the hydrogen lines Hα, Hβ, Hγ, etc. Forbidden lines are called forbidden because they don&amp;rsquo;t happen easily in labs on Earth; they require the extremely low densities of outer space to happen. In the plot below, these are the lines with square brackets around them. Take [O III] for instance. The &amp;ldquo;O&amp;rdquo; is the chemical symbol for that atom, in this case oxygen. But what are those Roman numerals doing there? That indicates the degree of ionization, i.e., how many electrons are missing. We call neutral &amp;ldquo;I&amp;rdquo;, so singly-ionized is &amp;ldquo;II&amp;rdquo;, doubly-ionized is &amp;ldquo;III&amp;rdquo;, triply-ionized is &amp;ldquo;IV&amp;rdquo;, etc. So &amp;ldquo;[O III]&amp;rdquo; tells us that this is a forbidden line of doubly-ionized oxygen! Similarly &amp;ldquo;[S II]&amp;rdquo; tells us that we have a forbidden line of singly-ionized sulfur. Finally, when referring to an emission line without the aid of a plot, we often write the wavelength of the line. So we might say &amp;ldquo;[O III]λ5007&amp;rdquo; to say that the wavelength of this line is at 5007 Å to distinguish it from another [O III] emission line.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./IntSpec_Labeled.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Looking at the plot above, we see numerous strong and weak lines. (Note that I&amp;rsquo;ve cut off the $y$-axes; the strong lines extend above the plot.) Some of the strongest lines in nebulae are those of oxygen, hydrogen, nitrogen, and sulfur, such as [O II]λ3727, [O III]λλ4959,5007, Hβ, Hα, [N II]λλ6548,6584, and [S II]λλ6717,6731. See if you can identify them on the plot!&lt;/p&gt;
&lt;p&gt;There are also a lot of faint lines. Some of these are very important for determining physical properties. Take for instance the faint [O III]λ4363 line right next to Hγ. It turns out that the ratio of this line to the stronger [O III]λ5007 line is completely dependent on the temperature of the highly-ionized gas, so if you can measure this ratio, then you know the temperature. There are other line ratios that help determine temperature too: for less ionized gas, you want to measure perhaps the ratio of the very blue [O II]λ3727 line and the very red [O II]λλ7320,7330 lines; or maybe the ratio of the strong [N II]λ6584 line to the weaker [N II]λ5755 line. All of these help determine the temperature of the gas.&lt;/p&gt;
&lt;p&gt;Similarly, there are other lines that can measure the density of the gas. The sulfur lines are the most commonly used, [S II]λ6731/λ6717, since they are easily observable. Less-commonly used are the oxygen lines at 3727 Å. I&amp;rsquo;ve been labeling them as one line, but it&amp;rsquo;s actually a tightly-spaced doublet: one line at 3726 Å and another at 3729 Å. You need really finely-sampled measurements to resolve the individual lines. Thankfully, the LVM data is finely-sampled and we can resolve them!&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./TemDen_LineRatios.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;However, it&amp;rsquo;s usually not as simple as measuring these line fluxes and dividing them. These two quantities, density and temperature, can depend on each other. So we have to use equations and techniques that take them both into account at the same time. For instance, let&amp;rsquo;s look at the [O III]λ5007/λ4363 line ratio. In the left plot, I&amp;rsquo;ve set the density to be 100 atoms/cm&lt;sup&gt;3&lt;/sup&gt;, while in the right plot, I&amp;rsquo;ve set the temperature to be 10,000 K. But what happens when both vary together? We get something that looks like this:&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./O3_TemDen.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Here, we&amp;rsquo;ve got two varying quantities: temperature on the vertical axis and density on the horizontal axis. Each of the colored lines and associated numbers are these values for a given line ratio. So when [O III]λ5007/λ4363 equals 3.4, you get the yellow line, for instance. Higher flux ratios are yellower colors, while lower flux rations are more purple colors. If you just look at the values at low densities (towards the left), the lines are flat. That means there&amp;rsquo;s no density-dependence, but as you go up the colors (i.e., the line ratios) change, indicating that there is a temperature-dependence. That&amp;rsquo;s exactly what we saw in the previous set of plots! However, as we go towards higher densities, the lines start to curve and even start to become vertical. We lose our temperature-dependence and start to gain a very strong density-dependence. How do we know which part of this plot our nebula is in?&lt;/p&gt;
&lt;p&gt;Thankfully, each individual atom and their ions have their own versions of this complex plot. By detecting multiple emission lines, each with their own temperature- and density-dependence, we can narrow down on the exact temperature and density our nebula has! This is why we want tons of emission lines.&lt;/p&gt;
&lt;h2 id="measuring-emission-lines"&gt;Measuring Emission Lines&lt;/h2&gt;
&lt;p&gt;But first, we have to measure the fluxes of these emission lines! To do that, we fit simple Gaussian functions to each of the emission lines. There are some technical details here that I&amp;rsquo;m not going to go into that are in the Notebook tutorial. I will mention one important thing: since we&amp;rsquo;re trying to fit multiple weak emission lines, in order to improve the fit we want to tie their wavelengths to how much they are separated from a strong line, like Hα. That&amp;rsquo;s exactly what I do in the Notebook tutorial. This drastically improves the fit and gives us very accurate fluxes. As an example, below is a fit to a strong set of lines, Hα+[N II]λλ6548,6584, and a weaker set of lines, Hγ+[O III]λ4363.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Ha_N2.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./O3_auroral.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;One final thing we have to do is correct our measured line fluxes for interstellar extinction. Space is full of dust. And that dust has two annoying effects: reddening and extinction. First, it generally dims light, and the light that it dims the most is blue light. You&amp;rsquo;re probably familiar with this if you&amp;rsquo;ve ever had the unfortunate experience of being near a wildfire and looked up at the Sun. Through the smoke, the Sun will appear dimmer and redder than it normally is. Thankfully, lots of very smart people have studied the extinction effects of dust in space and it is relatively simple nowadays to correct for this.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./SmokySun.jpeg" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The most basic way to correct for dust is to look at the ratio of the hydrogen emission lines, usually Hα/Hβ. Quantum mechanics says that the ratio of these two lines should be equal to 2.86. This ratio does not have a strong dependence on temperature or density, so if our measured ratio is different from this, then it must be caused by interstellar dust. It turns out our measured value is about 2.94, so there does exist some dust but not a lot. We&amp;rsquo;ll calculate the amount of extinction happening and correct every line for it.&lt;/p&gt;
&lt;h2 id="estimating-physical-properties"&gt;Estimating Physical Properties&lt;/h2&gt;
&lt;p&gt;Alright, &lt;em&gt;now&lt;/em&gt; we can estimate some physical properties of our integrated spectrum! Our basic steps are to calculate the density first, then estimate some temperatures. Since we&amp;rsquo;re working with a planetary nebula and we expect some sort of stratification of ionization, we&amp;rsquo;ll need to calculate two different temperatures, one of the low-ionization ions and another for the high-ionization ions. Namely, we&amp;rsquo;ll use [S II]λλ6717,6731 to estimate densities, then use [O III]λλ4363,5007 for the high-ionization temperature and [O II]λλλ3727,7320,7330 for the low-ionization temperature.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Electron Density&lt;/td&gt;
&lt;td&gt;45 cm&lt;sup&gt;-3&lt;/sup&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low-Ionization Temperature&lt;/td&gt;
&lt;td&gt;13300 K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-Ionization Temperature&lt;/td&gt;
&lt;td&gt;9640 K&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Looking at this table, these are pretty standard values for ionized gas. These agree with previous measurements as well:
measure a density less than 100 cm&lt;sup&gt;-3&lt;/sup&gt;, a low-ionization temperature of 10,900 K, and a high-ionization temperature of 9,300 K. Our measurements are slighly higher for the temperatures, but this could be due to different measurement techniques and assumptions.&lt;/p&gt;
&lt;p&gt;From those temperatures and densities, we can calculate the &lt;em&gt;ionic abundance&lt;/em&gt; of each ion. This is the amount of each ion relative to hydrogen there are in the nebula. For historic reasons, we always set the amount of hydrogen equal to 10&lt;sup&gt;12&lt;/sup&gt; (or 12 if we&amp;rsquo;re taking the logarithm), so every other ion will be less than this.&lt;/p&gt;
&lt;p&gt;This will give us the abundances for the ions we observe, but what about the ions we don&amp;rsquo;t observe? For example, we observed [Ne III], but should we have observed [Ne II] or [Ne IV]? How much of these other ions should be present? Again, some really smart people have come up with equations called &lt;em&gt;ionization correction factors&lt;/em&gt; or ICFs. These take our ionic abundances and correct them for the unseen ions so that we can calculate &lt;em&gt;total abundances&lt;/em&gt; for each element, rather ionic abundances for each ion. Once we&amp;rsquo;ve picked a particular set of ICFs, we simply apply these and get back a total abundance for each element. Based on the emission lines we&amp;rsquo;ve detected, we&amp;rsquo;ll get total abundances for helium, oxygen, nitrogen, sulfur, argon, and neon.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Solar Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Helium Abundance&lt;/td&gt;
&lt;td&gt;11.16&lt;/td&gt;
&lt;td&gt;10.93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oxygen Abundance&lt;/td&gt;
&lt;td&gt;8.67&lt;/td&gt;
&lt;td&gt;8.69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nitrogen Abundance&lt;/td&gt;
&lt;td&gt;8.45&lt;/td&gt;
&lt;td&gt;7.83&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sulfur Abundance&lt;/td&gt;
&lt;td&gt;6.23&lt;/td&gt;
&lt;td&gt;7.12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Neon Abundance&lt;/td&gt;
&lt;td&gt;8.38&lt;/td&gt;
&lt;td&gt;7.93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Argon Abundance&lt;/td&gt;
&lt;td&gt;6.37&lt;/td&gt;
&lt;td&gt;6.40&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Here, I&amp;rsquo;m reporting abundances in that logarithmic form, where hydrogen is defined to have an abundance of 12; all other elements should ideally have an abundance less than 12. Looking at our table, the most abundant element is helium. That makes sense: helium is
and stars will have produced a lot of helium in their lifetimes. After that comes oxygen, which also makes sense: oxygen is the third-most abundant element in the universe. Then we get the remaining elements, nitrogen, neon, argon, and sulfur, in order of decreasing abundance. Now we disagree with the universal abundances! What could be going on?&lt;/p&gt;
&lt;p&gt;We have to remember that the elemental abundances here are the direct result of a star&amp;rsquo;s death, and
. They are constantly changing light elements, like hydrogen and helium, into heavier elements through nuclear fusion. This could also explain the difference we see between the abundances of the Helix Nebula and the abundances found in the Sun. The Sun is only halfway through its evolution, and depending on the initial mass of the progenitor star of the Helix, it could have been massive enough to fuse heavier elements than the Sun will be able to. Indeed, those planetary nebulae with high abundances of helium and nitrogen are usually associated with high-mass progenitor stars. Granted, there are people who spend their whole careers studying these questions, but hopefully this gives you a little insight into why the Helix might have these abundances.&lt;/p&gt;
&lt;h2 id="two-dimensional-spectra"&gt;Two-Dimensional Spectra&lt;/h2&gt;
&lt;p&gt;All of that analysis was only for the integrated spectrum! However, we have a whole spatial dimension we haven&amp;rsquo;t done anything with yet. Now let&amp;rsquo;s make some maps of the different emission lines and estimate physical properties across the Helix Nebula. Thankfully, we&amp;rsquo;ve done most of the work already, we just have to apply our techniques to every individual fiber instead of the integrated spectrum. Of course, we&amp;rsquo;ll only want to plot fibers there is actual science data for, so we&amp;rsquo;ll ignore fibers that are staring at the background sky instead of the nebula.&lt;/p&gt;
&lt;p&gt;One of our first outputs will be flux maps. These show the relative strengths of the different emission lines in each individual fiber. I&amp;rsquo;ve broken the images into the strong and weak lines.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./StrongLines.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./WeakLines.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Here we see different ionization morphologies, different shapes depending on the emission line. This is that idea of ionization stratification. The hydrogen lines, Hα and Hβ, essentially show the full extent of the ionized gas. The [O III]λ5007 emission line (labeled F_O3_5007 in the plot) is highly concentrated towards the center of the main ring. This is because it takes a lot of energy to doubly-ionize oxygen, so we need to be close to the central white dwarf to do that. We see similar, but fainter, concentration in some of the other doubly-ionized lines, like [S III]λλ9059,9531. The helium ion He IIλ4686 requires much more energy to be ionized, so it is much more centrally concentrated. In contrast, emission lines like [O II]λ3727, [N II]λλ6548,6584, and [S II]λλ6717,6731 highlight the low-ionization features, such as the faint outer &amp;ldquo;arm&amp;rdquo; that lies beyond the main ring.&lt;/p&gt;
&lt;p&gt;Taken together, we have this picture that near the central white dwarf are very highly ionized ions like He II. As we move further away, we lose those highly energetic photons as they&amp;rsquo;re absorbed, resulting in this stratification. We go from He II, to [O III] and [S III], to [N II], [S II], and [O II], decreasing in ionization as we go. And even though they&amp;rsquo;re fainter, the weaker lines show this same stratification: [O III] at the center, then [Ne III] and [Ar III], then further out ions like [O II] and [N II].&lt;/p&gt;
&lt;p&gt;Finally, we can make maps of the physical properties. I&amp;rsquo;ll focus on two maps, the density and the oxygen abundance.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./ne_S2.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./12logOH.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The electron density map shows essentially the same purplish color throughout, indicating that most of the nebula is at the same density, approximately 100 atoms per cm&lt;sup&gt;3&lt;/sup&gt;. Again, just like in our integrated case, this is pretty standard for ionized gas. The oxygen abundance map shows more interesting behavior. It looks like near the central star, there are lower abundances which then increase as we go further out. Is this a result of the changing temperatures across the region? Is there just less oxygen towards the center? Is it a mixture of both? I don&amp;rsquo;t really know. Just like before, there are many people who spend a lot of time thinking about these questions. I&amp;rsquo;ll point interested readers to the latter sections of
for a good discussion.&lt;/p&gt;
&lt;h2 id="the-end"&gt;The End&lt;/h2&gt;
&lt;p&gt;Well, that&amp;rsquo;s the end of this little project! I&amp;rsquo;ve learned a lot about planetary nebulae and direct-method measurements of elemental abundances. As part of this project, I&amp;rsquo;ve written a tutorial Notebook in case anyone wants to see what I&amp;rsquo;ve done. I did a lot more than what I&amp;rsquo;ve talked about here in this blog post. I&amp;rsquo;ve put that Notebook as well as a bunch more plots on my GitHub, which you can access using the link at the top of the page. As far as I know, the LVM team has only released one paper on the Helix Nebula as a proof of concept. Hopefully a future paper will be written doing a more in-depth and careful analysis of its abundances than I have done here. I&amp;rsquo;ll keep an eye out for it, and I&amp;rsquo;ll update this post with more info and comparisons. Hope you&amp;rsquo;ve enjoyed this detour into planetary nebulae abundances as much as I have!&lt;/p&gt;</description></item><item><title>Postdocs are Resilient</title><link>https://astronoraygarner.com/blog/pda_generalassembly/</link><pubDate>Thu, 07 May 2026 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/pda_generalassembly/</guid><description>&lt;p&gt;Good afternoon, everyone, and thank you for being here. My name is Ray Garner, and I am a postdoc in the Department of Physics &amp;amp; Astronomy in the College of Arts &amp;amp; Sciences and the President and Communications Officer of the Texas A&amp;amp;M University Postdoctoral Association.&lt;/p&gt;
&lt;p&gt;Our annual General Assembly is, in many ways, our version of a State of the Union. It is a chance to reflect on where we are as a postdoctoral community, to celebrate what we have accomplished together over the past year, and to speak honestly about both the opportunities and challenges that lie ahead.&lt;/p&gt;
&lt;p&gt;And if there is one word I hope defines this year, it is resilience.&lt;/p&gt;
&lt;p&gt;This has not been an easy year. And yet, this community has endured. More than that, it has continued to grow, to contribute, and to show up for one another. That is resilience. Not pretending things are easy, but continuing forward together even when they are not.&lt;/p&gt;
&lt;p&gt;So, if I may borrow the language of the actual State of the Union, I am proud to say this: the state of the postdoctoral community at Texas A&amp;amp;M is strong. Strong not because we have been spared challenges, but because we have met them with resilience, commitment, and community.&lt;/p&gt;
&lt;h2 id="community-growth"&gt;Community Growth&lt;/h2&gt;
&lt;p&gt;In fact, our community has grown. There are currently 674 postdocs at Texas A&amp;amp;M University, representing a 15% increase from last year. That is a remarkable number, and it speaks to both the scale and importance of the postdoctoral community here. Our postdocs are distributed approximately equally across four major sectors of the university: the College of Engineering, the College of Agriculture and Life Sciences, the College of Arts and Sciences, and the combined communities of Texas A&amp;amp;M Health and the School of Veterinary Medicine and Biomedical Sciences, and in smaller amounts in several other Colleges.&lt;/p&gt;
&lt;head&gt;
&lt;style&gt;
.column {
float: left;
width: 50%;
padding: 5px;
}
.row::after {
content: "";
clear: both;
display: table;
}
.img-with-text {
text-align: right;
width: [width of img];
}
.img-with-text img {
display: block;
margin: 0 auto;
}
.image-wrapper{
display: inline-block;
text-align: center;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;div class="row"&gt;
&lt;div class="column"&gt;
&lt;img src="./communitygrowth.png" style="background-color:#500000; width:100%; aspect-ratio:1"&gt;
&lt;/div&gt;
&lt;div class="column"&gt;
&lt;img src="./pie_chart.png" style="background-color:#500000; width:100%; "&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And while many of us are here in Bryan/College Station, our postdoctoral community extends far beyond this campus. We are spread across 13 additional satellite campuses, from nearby Houston all the way to El Paso and Amarillo. That geographic reach is important. It reminds us that the PDA is not simply an organization for one building, one department, or even one campus. It is an organization for postdocs across Texas A&amp;amp;M University, wherever they may be.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./texaspostdocs.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;That growth and breadth make our mission even more important: to build community, create visibility, advocate for postdocs, and make sure that no one in this career stage feels invisible or unsupported.&lt;/p&gt;
&lt;p&gt;Over the past year, I believe we have made real progress on that mission.&lt;/p&gt;
&lt;p&gt;One of the clearest examples was our 9th Annual Postdoctoral Research Symposium, which was the most highly attended symposium we have ever had. We welcomed 235 attendees, an increase of 43% over last year. We had 62 postdoc presenters and recognized 6 awardees, showcasing the talent, creativity, and scholarly excellence of postdocs across the university.&lt;/p&gt;
&lt;div class="row"&gt;
&lt;div class="column"&gt;
&lt;div class="image-wrapper"&gt;
&lt;img src="./7738F.jpg" style="width:100%;"&gt;
&lt;figcaption&gt;Postdocs presenting their research.&lt;/figcaption&gt;
&lt;/div&gt;
&lt;div class="image-wrapper"&gt;
&lt;img src="./7819F.jpg" style="width:100%;"&gt;
&lt;figcaption&gt;The awardees of the Faculty Excellence in Postdoc Mentoring Awards.&lt;/figcaption&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="column"&gt;
&lt;div class="image-wrapper"&gt;
&lt;img src="./7794F.jpg" style="background-color:#500000; width:100%; "&gt;
&lt;figcaption&gt; Dr. George Ligler delivering his keynote address.&lt;/figcaption&gt;
&lt;/div&gt;
&lt;div class="image-wrapper"&gt;
&lt;img src="./7828F(1).jpg" style="width:100%;"&gt;
&lt;figcaption&gt;The volunteers that made the Symposium happen.&lt;/figcaption&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Those numbers matter. They do not just represent attendance. They represent visibility. They represent engagement. They represent a community that is resilient enough, even in a difficult year, to come together and celebrate outstanding scholarship.&lt;/p&gt;
&lt;p&gt;This year’s symposium also marked an important new step for us. For the first time, we recognized five faculty members with our Faculty Excellence in Postdoc Mentoring Awards. I am especially proud of that addition. Good mentoring can shape the entire trajectory of a postdoc’s experience. It can be the difference between merely getting through a position and truly growing in it. By recognizing excellent mentors, we are also reinforcing the kind of culture we want to build here: one that values not only research excellence, but also thoughtful guidance, professional development, and genuine support for early-career scholars.&lt;/p&gt;
&lt;p&gt;We were also fortunate to hear an excellent keynote address from
, Professor of Multidisciplinary Engineering, who reminded us of something many postdocs know deeply: that it is okay to be interdisciplinary, and more than that, that building the ability to work across boundaries is a skill we will need. That message resonated with me, and I suspect it resonated with many of you as well. Many postdocs already live in those in-between spaces, between disciplines, between methods, and between traditional academic categories. Learning to thrive there is part of the resilience this career stage demands.&lt;/p&gt;
&lt;p&gt;Of course, the symposium was only one part of a much larger year.&lt;/p&gt;
&lt;img src="./eventgrowth.png" style="background-color:#500000; width:100%;"&gt;
&lt;p&gt;Over the last year, the PDA, often in collaboration with the Office of Postdoctoral Affairs, helped host 32 events with a total attendance of 1,657 people, an increase of 24%. That number reflects not only the work of the PDA, but the strength of our partnership with the Office of Postdoctoral Affairs and our shared commitment to creating meaningful opportunities for postdocs across campus.&lt;/p&gt;
&lt;p&gt;Our highest attendance came from career development workshops, especially programming focused on Individual Development Plans, or IDPs. That tells me something important: postdocs want space not only to do their current work, but to think intentionally about their futures. They want guidance. They want professional development. They want tools to help them navigate a career stage that is often exciting, but also uncertain.&lt;/p&gt;
&lt;p&gt;We also continued another round of the Postdoctoral Mentoring Academy, in collaboration with the Center for Teaching Excellence and the Office of Postdoctoral Affairs. I want to note here that I participated in the academy myself, and I found it genuinely valuable. I learned new approaches to mentoring, and I was introduced to practical resources like the mentor-mentee compact, which has already improved how I think about working with students and setting expectations in mentoring relationships. It helped me become more intentional, more communicative, and, I hope, a better mentor. I imagine many others who participated found the same. Programs like that matter because they help us grow not only as researchers, but as leaders, teachers, and mentors.&lt;/p&gt;
&lt;h2 id="social-events"&gt;Social Events&lt;/h2&gt;
&lt;p&gt;But it has not all been work, and I am glad of that.&lt;/p&gt;
&lt;p&gt;Resilience does not come only from pushing harder. It also comes from connection, rest, and community. It comes from knowing the people around you. It comes from feeling that you belong somewhere.&lt;/p&gt;
&lt;p&gt;We continued to host our semesterly Spring and Fall Picnics, and I want to give a huge shoutout to our Event Coordinator, Dr. Delaney Clouse, for organizing those, including arranging the food and reserving the park. Those events may seem simple on paper, but they matter enormously. They create space for postdocs and their families to gather, relax, and build the kinds of relationships that make a large university feel smaller and more human.&lt;/p&gt;
&lt;div class="row"&gt;
&lt;div class="column"&gt;
&lt;img src="./picnic1.jpg" style="width:100%;"&gt;
&lt;/div&gt;
&lt;div class="column"&gt;
&lt;img src="./picnic2.jpg" style="background-color:#500000; width:100%; "&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="column"&gt;
&lt;img src="./picnic3.jpg" style="width:100%;"&gt;
&lt;/div&gt;
&lt;div class="column"&gt;
&lt;img src="./meetgreet.jpg" style="background-color:#500000; width:100%; "&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This year we also piloted Meet &amp;amp; Greet events, informal lunchtime gatherings where postdocs can not only meet members of the Executive Committee, but also step away from the lab, office, or classroom and meet other postdocs they may not otherwise encounter. We hosted several of these, including two specifically for Engineering and Arts and Sciences, and we intend to continue them. Sometimes resilience begins in small ways: a conversation over lunch, a new connection, the realization that someone else understands exactly what you are navigating.&lt;/p&gt;
&lt;h2 id="social-media"&gt;Social Media&lt;/h2&gt;
&lt;p&gt;We have also continued to strengthen our visibility through social media. Across Instagram, Facebook, and LinkedIn, our total number of followers has increased significantly on each platform. But more important than the growth itself is what we have chosen to do with those platforms.&lt;/p&gt;
&lt;p&gt;Last year, we expanded our Executive Committee Spotlight into a broader effort to recognize postdocs more widely. What began as the Satellite Campus Spotlight Series, highlighting postdocs who are often overlooked at our satellite campuses, evolved into our Where Are They Now? series, where we feature former postdocs and the ways they used both their research experience and their professional development to build successful careers.&lt;/p&gt;
&lt;p&gt;I care deeply about these spotlight series because they do more than fill a social media calendar. They tell stories. They give visibility to postdocs who might otherwise go unseen. They remind current postdocs that their work matters and that there are many possible futures ahead of them. We absolutely plan to continue recognizing the amazing work postdocs do across this university in new forms going forward.&lt;/p&gt;
&lt;h2 id="advocacy"&gt;Advocacy&lt;/h2&gt;
&lt;p&gt;Of course, visibility is only one part of what the PDA does. Another major part is advocacy.&lt;/p&gt;
&lt;p&gt;We are making sure that postdocs have a seat at the table on campus. The PDA serves on several administrative bodies as the postdoc voice, including the University Staff Council, the Council of Principal Investigators, and the Center for Teaching Excellence Faculty and Student Advisory Board. We are regular voices in those spaces, making sure that the needs, concerns, and perspectives of postdocs are not forgotten.&lt;/p&gt;
&lt;p&gt;We also have biannual meetings with the Associate Vice President for Research,
, who has consistently been willing to listen to our concerns. That matters. Advocacy is not always loud. Sometimes it is steady, persistent, relationship-based work: showing up, speaking clearly, raising issues early, and making sure postdocs remain visible in institutional conversations. Resilience is easier to sustain when people know they are heard, and advocacy is one of the ways we help make that possible.&lt;/p&gt;
&lt;p&gt;Our engagement beyond campus is also going strong.&lt;/p&gt;
&lt;p&gt;Texas A&amp;amp;M remains an institutional member of the
, which means that our postdocs, faculty, staff, and students can become affiliate members and gain access to a wide range of NPA resources, including the Career Center and their monthly Smart Skills workshops. About 150 postdocs have already taken advantage of that opportunity, and I would encourage even more to do so.&lt;/p&gt;
&lt;p&gt;And the NPA knows who we are, too.&lt;/p&gt;
&lt;p&gt;We were honored in the
, which highlighted the work we did as part of National Postdoctoral Appreciation Week. One of our own Executive Committee members, Dr. Dylan Pham, has been serving as the Chair of the Social and Networking Subcommittee of the NPA Meetings Committee. And I had the privilege of attending the NPA Annual Conference in San Francisco this past March, where I was delighted to learn that a Texas A&amp;amp;M alum,
, now Research Faculty at Florida State University, served as the organizing chair of the event.&lt;/p&gt;
&lt;p&gt;One of the biggest things I took away from that conference, after speaking with postdoc leaders from around the country, was this: we are doing really well here.&lt;/p&gt;
&lt;p&gt;Truly.&lt;/p&gt;
&lt;p&gt;While many universities are still trying to figure out how best to support their postdocs, I came away feeling confident that Texas A&amp;amp;M is ahead in many important ways. We have experience. We have leadership. We have strong partnerships. We have meaningful programming. And perhaps most importantly, we have engagement from you. The numbers support that feeling, yes, but so does the culture we are continuing to build.&lt;/p&gt;
&lt;h2 id="challenges-ahead"&gt;Challenges Ahead&lt;/h2&gt;
&lt;p&gt;That said, resilience does not mean pretending everything is fine.&lt;/p&gt;
&lt;p&gt;There is still much work to do.&lt;/p&gt;
&lt;p&gt;For all of our record-breaking attendance and growing engagement, we are still only reaching about half of the postdocs on campus. That is not a failure, but it is a challenge, and one we take seriously. I know that postdocs are busy by nature. You are busy doing research, mentoring students, writing papers, teaching courses, applying for jobs, building your lives, and in many cases raising families. It is not always easy to step away and attend one more workshop, one more social event, one more meeting.&lt;/p&gt;
&lt;p&gt;But we want every postdoc to know that these resources exist for them.&lt;/p&gt;
&lt;p&gt;That is why, every two weeks, we receive an updated list from HR of all postdocs on campus, and new postdocs receive a welcome email with a collection of resources, including our
, a
, and a
. We also hold both spring and fall New Postdoc Orientations, where offices from around campus introduce postdocs to the many resources available to them.&lt;/p&gt;
&lt;p&gt;And I would encourage postdocs to attend one even if they are not brand new to campus. In my role on the Executive Committee, I have attended these four or five times, and while I would not necessarily recommend doing that, I can say that attending even once is incredibly valuable. It is a chance to learn not only what resources the university offers, but also how those resources can strengthen your research, your professional development, and your overall experience here. Reaching every postdoc will continue to be one of our priorities, because support only matters if people know it exists.&lt;/p&gt;
&lt;p&gt;And of course, some of the biggest challenges facing postdocs are not local at all. They are national, and in some cases global.&lt;/p&gt;
&lt;p&gt;Postdocs continue to face growing pressures from federal funding cuts, which are already affecting people in tangible ways. The job market is difficult. I say that not only as an observer, but personally: I am on the job market right now, so I know very well how heavy that uncertainty can feel.&lt;/p&gt;
&lt;p&gt;I wish I could stand here and say that we could fix all of this instantly. I cannot. I do not have a magic wand, and neither does the PDA.&lt;/p&gt;
&lt;p&gt;But what we can do is continue to support one another. We can continue raising concerns to university leadership. We can continue building relationships with administrators who understand these challenges. And we can continue listening. Resilience is not an individual burden; it is something communities build together.&lt;/p&gt;
&lt;h2 id="community-input"&gt;Community Input&lt;/h2&gt;
&lt;p&gt;We need to hear from you.&lt;/p&gt;
&lt;p&gt;We need to know what issues you are facing, whether they are large-scale structural concerns or smaller day-to-day obstacles. Sometimes the biggest problems are national. Sometimes they are surprisingly local. Either way, our ability to advocate depends on knowing what this community is experiencing. You can always reach us at our email pda at tamu.edu or you can reach out to the Office of Postdoctoral Affairs at opa at tamu.edu. We are here to help, to listen, and to advocate for you.&lt;/p&gt;
&lt;p&gt;I also want to take a moment to note that we are still accepting applications for several open positions on the Executive Committee: Vice President, Event Coordinator, Treasurer, Communications Officer, and Satellite Campus Officer. There are three days remaining until the application deadline, so if you have been inspired by what you have heard today and want to help shape what the PDA does next, I would strongly encourage you to apply. Serving on the Executive Committee has been one of the most meaningful parts of my time at Texas A&amp;amp;M, and it is a wonderful way to support your fellow postdocs while also growing as a leader yourself.&lt;/p&gt;
&lt;p&gt;If you have already submitted an application, thank you; we are grateful for your willingness to serve. And after the meeting, my fellow officers and I will be happy to stay and chat with anyone who wants to learn more about these roles.&lt;/p&gt;
&lt;p&gt;Before I close, I want to take time to thank the people who have made this year possible.&lt;/p&gt;
&lt;p&gt;First, I want to thank the Executive Committee members I have had the privilege of serving with this year:
, our former Vice President and now Assistant Professor of Agronomy at New Mexico State University; Dr. Delaney Clouse, our outgoing Event Coordinator and soon-to-be Assistant Professor of Chemistry at UNC Pembroke; Dr. Dylan Pham, our current Treasurer and incoming President; Dr. Sam Stroupe, our current Recording Secretary; and Dr. Bibek Acharya, our former Satellite Campus Officer.&lt;/p&gt;
&lt;p&gt;They have been outstanding leaders, thoughtful colleagues, and tireless advocates for postdocs at Texas A&amp;amp;M. None of these accomplishments would have been possible without them.&lt;/p&gt;
&lt;p&gt;I also want to thank
, the director of the Office of Postdoctoral Affairs. She has invested tremendous time, care, and effort into building up an office that is still only four years old. She cares deeply about postdocs and the challenges we face, and she has fought tirelessly to make sure we are recognized, supported, and valued on this campus. As important as the PDA is, the truth is that without Andreea, much of this infrastructure would not exist. I also want to thank Shannon Eyre, whose work behind the scenes keeps so much of this effort organized and moving forward.&lt;/p&gt;
&lt;p&gt;I want to thank Dr. Gerianne Alexander, Associate Vice President for Research, for her encouragement, her steady support, and her willingness to listen. And I want to offer a warm welcome to Dr. Angela Wilson, our new Vice President for Research. I hope she will continue to support postdocs and I wish her every success in her new role.&lt;/p&gt;
&lt;h2 id="the-joy-of-serving"&gt;The Joy of Serving&lt;/h2&gt;
&lt;p&gt;And if I may, I would like to make a personal note.&lt;/p&gt;
&lt;p&gt;I have had the distinct pleasure of serving on the Executive Committee for the past two and a half years, all of that time as Communications Officer, and for the past year also as President. It has been one of the great privileges of my postdoctoral experience to work with you and for you. Getting to know so many remarkable postdocs from around campus has made my time here richer, more meaningful, and more joyful. Serving in this role has taught me a great deal, not only about leadership and advocacy, but about community. Thank you for allowing me to learn and grow in this position.&lt;/p&gt;
&lt;h2 id="ten-years-of-postdocs"&gt;Ten Years of Postdocs&lt;/h2&gt;
&lt;p&gt;And finally, I want to end by looking ahead.&lt;/p&gt;
&lt;p&gt;This upcoming academic year will mark the 10th anniversary of the Texas A&amp;amp;M Postdoctoral Association.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./pdaanniversary.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Ten years of building community.
Ten years of advocacy.
Ten years of creating spaces for postdocs to be seen, heard, and supported.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./postdocanniversary.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;That milestone also happens to coincide with another remarkable anniversary: the 150th anniversary of the first postdoc in America, at Johns Hopkins. I love that coincidence because it reminds us of two things at once. First, the postdoctoral role has a long history in American higher education. But second, the work of truly recognizing postdocs as a community worthy of support, visibility, and advocacy is still ongoing.&lt;/p&gt;
&lt;p&gt;Organizations like the PDA matter because they help ensure that postdocs are not invisible in the academic system. They help turn what can otherwise feel like a temporary, isolating career stage into a real community with a voice.&lt;/p&gt;
&lt;p&gt;That is what we have been building. And that is what we must continue to build.&lt;/p&gt;
&lt;p&gt;So yes, there are challenges ahead. There are real concerns, real uncertainties, and real work still to be done. But there is also much to be proud of. This community is growing. It is engaged. It is talented. It is resilient. And it is worth investing in.&lt;/p&gt;
&lt;p&gt;So once again, I will say it:&lt;/p&gt;
&lt;p&gt;The state of the postdoctoral community at Texas A&amp;amp;M is strong.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;</description></item><item><title>The Peculiar "Bulge" of NGC 5474</title><link>https://astronoraygarner.com/blog/5474_bulge/</link><pubDate>Mon, 03 Mar 2025 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/5474_bulge/</guid><description>&lt;h2 id="the-mystery"&gt;The Mystery&lt;/h2&gt;
&lt;p&gt;Almost two years ago when I was writing up
, I needed to write up a &amp;ldquo;Conclusions and Future Work&amp;rdquo; chapter. The conclusions were straightforward, but coming up with an idea of things I can do in the far off future was hard. I think any scientist would tell you that doing the science is usually the easy part; coming up with the idea in the first place is the hard part!&lt;/p&gt;
&lt;p&gt;But throughout my thesis which focused primarily on the nearby giant spiral galaxy M101, known as the Pinwheel Galaxy, I kept turning my attention to its companion dwarf galaxies. The biggest of these doesn&amp;rsquo;t have a cute name, but is intead known by its catalog number, NGC 5474. And just like M101, NGC 5474 is peculiar! Optically, it looks like a typical dwarf spiral galaxy with loose spiral arms and numerous sites of star formation. That is, except for its central bulge being offset to the north!&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./m101_group.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;This galaxy really caught my attention, but sadly, I didn&amp;rsquo;t have time for it in my thesis to do a deep dive on it as much as I had M101. This was a perfect candidate for some of that &amp;ldquo;future work,&amp;rdquo; to figure out what&amp;rsquo;s going on with that offset bulge. Recently, a
performed some photometry of the bulge to look at resolve stellar populations, basically seeing what types of stars were in the bulge and the surrounding disk of NGC 5474. Based on that data, they proposed that the bulge of NGC 5474 could actually be a dwarf elliptical galaxy orbiting around the disk of NGC 5474 instead of being a bulge in the plane of the disk as is the case for normal galaxies.&lt;/p&gt;
&lt;h3 id="how-can-we-figure-out-the-puzzle"&gt;How Can We Figure Out the Puzzle?&lt;/h3&gt;
&lt;p&gt;How can you tell that for sure? Well, you&amp;rsquo;d need spectroscopy. Spectroscopy is a tool that allows you to see how much light of each individual wavelength there is in an object called a spectrum. Astronomers (and physicists and chemists) have put a lot of work into understanding spectra and what sorts of objects produce the different wavelengths of light. For example, star-forming regions that are full of gas ionized by hot, young stars produce &amp;ldquo;emission lines&amp;rdquo;, things like ionized hydrogen, oxygen, nitrogen, sulfur, etc. Meanwhile, stars have elements in their stellar atmospheres that absorb light before it can leave the star, so stars have &amp;ldquo;absorption lines&amp;rdquo;, like hydrogen, magnesium, iron, calcium, etc.&lt;/p&gt;
&lt;p&gt;So for our case of NGC 5474, if we can take the spectrum of the bulge area, we&amp;rsquo;ll see a spectrum likely composed of both emission lines and absorption lines. Thankfully, we&amp;rsquo;re not the first people to do this in general, so we know that the disks of galaxies are where the star-forming regions lie that produce the emission lines. Meanwhile, elliptical galaxies which don&amp;rsquo;t tend to have any ionized gas should produce mostly the absorption lines produced by populations of stars.&lt;/p&gt;
&lt;p&gt;One more thing to consider. If an object is moving away from us, its light will be at wavelengths shifted from what we measure here on Earth in our labs. This is the well-known
that you probably have lots of experience when an emergency vehicle passes you on the road. As it approaches you, the sounds waves coming from its sirens are squished together and you hear a higher pitch. As it races away from you, the sound waves are spread apart and you hear a lower pitch. Light waves do this too and we call this being blueshifted and redshifted, respectively.&lt;/p&gt;
&lt;p&gt;What does that mean for our spectroscopy of the bulge and disk of NGC 5474? Well, if there is a wavelength offset between the absorption lines in the bulge and the emission lines in the disk, then that indicates a velocity offset as well. A velocity offset would be a strong indication that the bulge and disk are two separate objects!&lt;/p&gt;
&lt;p&gt;All of this was proposed by that group of Italian astronomers in
. Sadly, I did not have any spectroscopy of NGC 5474. There was one collaboration called
&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; that would have covered NGC 5474 in their spectroscopic survey, but they hadn&amp;rsquo;t released the data for this galaxy yet. Oh well. I&amp;rsquo;d have to go out and collect this spectroscopy at some far off date. Who knows when that&amp;rsquo;ll be? I wrote it up this idea and got to work defending my thesis.&lt;/p&gt;
&lt;p&gt;
&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id="the-pings-data"&gt;The PINGS Data&lt;/h2&gt;
&lt;p&gt;Barely a year after my thesis, and after I had picked up everything to start my new postdoc position at Texas A&amp;amp;M, I figured I could try and answer this question. So I worked up the courage to cold email the head of the PINGS collaboration and see if they were planning on doing anything with their spectroscopic data of NGC 5474. Thankfully, the head, Fabián Rosales-Ortega was more than happy to share the data with me! Yes! I could now try and figure out what the nature of this peculiar offset bulge is.&lt;/p&gt;
&lt;p&gt;What did this data look like? Well it&amp;rsquo;s a special kind of spectroscopic dataset called &amp;ldquo;integral field spectroscopy&amp;rdquo; or IFS. Basically, instead of throwing down a thin slit on a galaxy and being able to only collect the light in that slit, IFS is like taking a larger picture of a galaxy at each wavelength of light. The result is a &amp;ldquo;data cube&amp;rdquo;, a 2D picture of the galaxy with a spectrum in each pixel. That means that not only do we have spectral information, we could also see how the spectra vary across the galaxy!&lt;/p&gt;
&lt;p&gt;Or at least, that&amp;rsquo;s the idea in theory. In practice, things can go wrong. The PINGS survey collected IFS data on many galaxies, but out of all of them NGC 5474 was the only one who&amp;rsquo;s data collection was compromised. This galaxy&amp;rsquo;s data was collected not by Fabián, but by the folks who manage the observatory. Due to no fault of their own, this meant that the accuracy of the data was not up to par across the entire galaxy. But! The region around the bulge was of good quality and that&amp;rsquo;s all we needed for this project.&lt;/p&gt;
&lt;h3 id="circular-apertures"&gt;Circular Apertures&lt;/h3&gt;
&lt;p&gt;Now, how do we actually extract the spectra and measure their (potentially offset) wavelengths? There were two basic methods that we tried. The first is to just sum up all of the light in some circular apertures centered on the bulge. This has the benefit of increasing the signal-to-noise ratio of the data. The second method is to use the entire 2D dataset to produce velocity maps, so we can more easily see where velocities are different and where they&amp;rsquo;re the same.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not going to go into all of the details of how we actually do this (that&amp;rsquo;s what
is for!), but I&amp;rsquo;ll show you some interesting results.&lt;/p&gt;
&lt;p&gt;First up are the circular apertures. We did this in a series of circular apertures ranging from relatively small that encompassed only a fraction of the bulge up to a large aperture that gets the entire bulge. We did this because the smaller aperture minimizes &amp;ldquo;contamination&amp;rdquo; from the underlying disk while the largest aperture maximizes the signal-to-noise at the expense of containing more of the underlying disk. Below, you can see the spectra for each aperture in varying shades of blue and green.&lt;/p&gt;
&lt;p&gt;
&lt;figure id="figure-the-spectra-of-circular-apertures-centered-on-the-bulge-of-ngc-5474-the-top-panel-shows-the-spectra-for-the-four-apertures-used-with-their-radii-indicated-in-the-legend-the-middle-panel-shows-an-example-of-the-absorption-spectrum-overlayed-in-black-for-one-of-the-apertures-the-bottom-panel-shows-the-emission-line-spectrum-produced-after-subtracting-the-absorption-line-spectrum"&gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./circular_ap_spectra.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;figcaption&gt;
The spectra of circular apertures centered on the bulge of NGC 5474. The top panel shows the spectra for the four apertures used with their radii indicated in the legend. The middle panel shows an example of the absorption spectrum overlayed in black for one of the apertures. The bottom panel shows the emission line spectrum produced after subtracting the absorption line spectrum.
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;In each spectra, you can see both absorption and emission lines. If we focus on the largest aperture which is shown by itself in the middle panel, you can more clearly see these two features. The black line is a fit to the stellar population and its absorption lines, those parts that have lower fluxes at a particular wavelength. You can also see the emission lines sitting on top of the absorption line spectrum. Subtracting away the absorption line spectrum gives you just the emission lines in the bottom panel. These lines are very familiar to astronomers who study star-forming regions. We see lines of ionized hydrogen, oxygen, nitrogen, sulfur, and even ionized neon!&lt;/p&gt;
&lt;p&gt;Now we just need to estimate the velocity offset for the emission and absorption lines separately. Remember, the absorption lines are likely being produced by stars in the bulge, while the emission lines are being produced by star-forming regions in the disk. When we estimate the velocity of the absorption lines, we get approximately 230 km/s. Doing the same for the emission lines gives a velocity of approximately 255 km/s. That&amp;rsquo;s a velocity difference of 25 km/s!&lt;/p&gt;
&lt;h3 id="spatially-resolved-velocities"&gt;Spatially Resolved Velocities&lt;/h3&gt;
&lt;p&gt;Alright, but that&amp;rsquo;s just for some circular apertures. If we use each pixel in the data, each containing its own spectrum, what do we get for the velocities across the entire datacube? I won&amp;rsquo;t bore you with the details, but we can produce velocity &lt;em&gt;maps&lt;/em&gt; that show how the velocities in the absorption lines and emission lines change across the entire dataset.&lt;/p&gt;
&lt;p&gt;
&lt;figure id="figure-from-left-to-right-the-stellar-velocities-gas-velocities-and-velocity-differences-across-ngc-5474-the-top-row-of-panels-shows-the-velocities-while-the-bottom-row-shows-their-associated-uncertainties-the-red-circle-outlines-the-position-of-the-bulge-in-each-map"&gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./velocity_maps.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;figcaption&gt;
From left to right: the stellar velocities, gas velocities, and velocity differences across NGC 5474. The top row of panels shows the velocities, while the bottom row shows their associated uncertainties. The red circle outlines the position of the bulge in each map.
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;In the above figure, we&amp;rsquo;ll focus on the top row (the bottom row contains the uncertainties on the velocity measurements). In all of the plots, the red circle is the position and size of the bulge. The left plot is the velocity of the stars, i.e., measured from the absorption lines. You can see that the bulge is pretty coherent, all around the same velocity of about 230 km/s. The middle plot shows the velocity of the ionized gas, i.e., measured from the emission lines. There&amp;rsquo;s a much larger area that is of the same velocity, but importantly this area contains the bulge at a velocity of about 250 km/s. Finally, the right plot shows the velocity difference and the bulge stands out clearly! Spatially resolved, the bulge has a velocity difference between 20 and 40 km/s, very similar to the result from the circular apertures!&lt;/p&gt;
&lt;h2 id="is-this-the-only-answer"&gt;Is This The Only Answer?&lt;/h2&gt;
&lt;p&gt;Now, just because we&amp;rsquo;ve measured a velocity difference of about 25 km/s, doesn&amp;rsquo;t mean these two objects are separate. We need to put this measurement in the context of similar measurements and see if any other explanation is plausible.&lt;/p&gt;
&lt;p&gt;First, the gas and stars in normal galaxies don&amp;rsquo;t have a large velocity difference. For example, in
of 30 isolated spiral galaxies, a velocity difference of only 2 km/s was found, ten times lower than what we&amp;rsquo;ve measured in NGC 5474.&lt;/p&gt;
&lt;p&gt;
&lt;figure id="figure-the-cigar-galaxy-m82-credits-nasaesahubble-heritage-teamj-gallagherm-mountainp-puxley"&gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./M82.jpg" alt="jpg" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;figcaption&gt;
The Cigar Galaxy, M82. Credits: NASA/ESA/Hubble Heritage Team/J. Gallagher/M. Mountain/P. Puxley
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Maybe we&amp;rsquo;re measuring some sort of gaseous outflow from the disk? If you look at galaxies that have intense rates of star formation, like the Cigar Galaxy (M82), you see that gas is being pushed out perpendicular to the plane of the disk by rapid star formation and all those strong stellar winds. Since NGC 5474 is face-on and not edge-on like M82, maybe we&amp;rsquo;re just looking straight down the barrel of this funnel of gas. Well, NGC 5474 is not a starbursting galaxy. It has a meager star formation rate, and it doesn&amp;rsquo;t have an active supermassive black hole at the center that could push gas out either.&lt;/p&gt;
&lt;p&gt;It does look like this velocity difference between the bulge (absorption lines) and disk (emission lines) is real and isn&amp;rsquo;t caused by some of the more common explanations. This galaxy, which has been seen as just one peculiar galaxy, looks like it is instead a superposition of two galaxies! The fact that we don&amp;rsquo;t see any debris from an interaction (no long streams of stars, no huge burst of star formation, no wildly distorted velocity maps) likely says that these two objects are in the process of weakly interacting with each other.&lt;/p&gt;
&lt;video controls &gt;
&lt;source src="https://astronoraygarner.com/blog/5474_bulge/interaction.mp4" type="video/mp4"&gt;
&lt;/video&gt;
&lt;p&gt;The larger question remains: how does this all connect to M101? I&amp;rsquo;ve buried the lede, but approximately 300 million years ago,
. NGC 5474 swung by M101, close enough to distort M101 and create that &amp;ldquo;big wonky arm&amp;rdquo; as I have grown to call it. We thought that the interaction also might have shifted the bulge of NGC 5474 north, but our new results seem to indicate otherwise. Clearly that close passage with M101 didn&amp;rsquo;t unbind the bulge-disk pair of NGC 5474, or maybe the bulge is a more recent addition? Honestly, we don&amp;rsquo;t know for sure. All I know is that someone needs to do some dynamical modeling of this three-body interaction, something that is famously difficult.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all I&amp;rsquo;ve got for you! I am very happy that I got to put some words down about this project and even happier that I got to investigate this peculiar little galaxy. This only goes to show that even the smallest galaxies are curiosities unto themselves!&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;PINGS stands for the PPak IFS Nearby Galaxies Survey, an acronym that contains &lt;em&gt;two acronyms&lt;/em&gt; in it!&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Yep, I really did include this line as the opening quote to the final chapter of my thesis!&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Charting the Heavens</title><link>https://astronoraygarner.com/blog/constellations/</link><pubDate>Fri, 21 Jul 2023 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/constellations/</guid><description>&lt;p&gt;Over the last several years, whenever I had some spare time, I worked on a little project to chart the 88 constellations in &lt;code&gt;Python&lt;/code&gt;. I was heavily inspired by several different people online. Most of the impetus came from the work of two different people:
and
. Those two existing projects (the latter being on an indefinite hiatus) really helped me out, both with their code and their knowledge of existing databases. &amp;ndash;&amp;gt;&lt;/p&gt;
&lt;p&gt;I have also always been interested in the mythology and history of the constellations, and I wanted some way to incorporate that. I decided that these charts could be the impetus for writing up an &amp;ldquo;Observer&amp;rsquo;s Guide&amp;rdquo; to the constellations, complete with information about the history/mythos, meteor showers, stars, and deep sky objects for each constellation. This part of the project probably took the longest, but eventually I got it done!&lt;/p&gt;
&lt;p&gt;Below is a small gallery of a few constellations so you can get an idea of what the charts look like. I tried to emulate the Sky &amp;amp; Telescope charts that are found on the Wikipedia pages for each constellation. The full &lt;code&gt;Python&lt;/code&gt; code, databases used, and all the discussion can be found on
. The &amp;ldquo;Observer&amp;rsquo;s Guide&amp;rdquo; can also be found there as a PDF. Let me know if you have any questions or suggestions!&lt;/p&gt;</description></item><item><title>Farewell Letter - Saying Goodbye After Two Years</title><link>https://astronoraygarner.com/blog/gcas_farewell/</link><pubDate>Mon, 15 May 2023 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/gcas_farewell/</guid><description>&lt;p&gt;Our fellow graduate students,&lt;/p&gt;
&lt;p&gt;The Graduate Council of Arts &amp;amp; Sciences has come a long way in the two years that we have been Co-Presidents. We have accomplished a lot together to better support and enrich the lives of graduate students in the College of Arts &amp;amp; Sciences. We survived the onslaught of the pandemic and the uncertain times the pandemic brought with it. We kept our students socially engaged through several “Paint &amp;amp; Sips” at the Jolly Scholar. And we implemented professional development events throughout the year, including the first ever Graduate Student Scholarship &amp;amp; Creative Endeavors grant.&lt;/p&gt;
&lt;p&gt;But most importantly, we started to build a sense of community in the College. When Ray joined the GCAS in the spring of 2020, and Cameron a year later, graduate students in the College often worked separately from each other’s departments, often not knowing other students in different disciplines. But through the hard work of the GCAS, we have started to bridge those gaps and create a sense of unity throughout the College. This can be seen in the growing number of people attending our events, from the paltry ten or fifteen people in the first few years to the hundred people who attended our recent Professional Development Week in April. We were shocked that we had a waiting list for the Paint &amp;amp; Sip social event at the end of that week!&lt;/p&gt;
&lt;p&gt;We have also started to make progress tackling some of the big issues that face graduate students on campus. These issues range from stipend support to abysmal health insurance, security concerns, and harassment from professors. The Dean’s Office has been supportive in listening and addressing some of these concerns, notably working hard to increase student stipends to be more in line with inflation and rising housing costs. And through initiatives like the Presidents’ Roundtable, a group of graduate student presidents from across the University, we have started to band together and push the University administration to deal with these issues as well.&lt;/p&gt;
&lt;p&gt;There is still a lot of work to be done. The University administration is often adversarial and slow to respond. The raises by the Dean, while appreciated, are still not enough to survive on. But if there is one thing that we have learned during our two-year term as your Co-Presidents, it is that we have power in our numbers. When we band together, working with graduate students in different disciplines and different schools, we are a force to be reckoned with. Just look at what universities like the University of California system, Boston University, and Duke University have been able to accomplish in recent years. By continuing to build a community, by continuing to support each other, by continuing to fight for better living conditions, we will make the College and Case Western as a whole a better place to work and learn and grow.&lt;/p&gt;
&lt;p&gt;We have every belief that the next group of officers, led by Michelle Gotto, will continue to represent you and fight for what is in the best interest of all graduate students in the College. We ask that you help them continue this mission of growing a community of graduate students as we can only do that if we work together. And finally, we thank you for letting us lead the charge these past two years. We hope we have made an impact on your lives. Working with the GCAS has certainly made an impact on our lives.&lt;/p&gt;
&lt;p&gt;Thank you and best of luck,&lt;br&gt;
Ray Garner &amp;amp; Cameron Griffith&lt;/p&gt;</description></item><item><title>Fixing Academia as a Grad Student</title><link>https://astronoraygarner.com/blog/fixing_academia/</link><pubDate>Sun, 05 Feb 2023 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/fixing_academia/</guid><description>&lt;p&gt;I hope that everyone is aware of how broken academia is. Graduate students are often the ones who are most aware of how academia is broken. We’re paid less but expected to do more, we typically have worse health insurance than our professors, we face harassment and discrimination often without recourse to resolve those issues, just to name a few.&lt;/p&gt;
&lt;p&gt;This creates a culture that often diminishes a student’s will to remain in academia.
that although 80% of science students start their PhD with the intention to pursue a career in science, by the time of their graduation, only 55% plan to continue in academia. And even for those 55%, not all of them will achieve the dream they were told they could reach;
, only seven will get a permanent academic job and only one will become a professor.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Careers.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Figure 1.6 in
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;It is this version of academia that graduate students see and have to live in. And for the past three years, I have been trying to fix it and make the lives of graduate students here at Case Western marginally better. However recently, that betterment seems to be becoming more marginal and marginal.&lt;/p&gt;
&lt;p&gt;For three years now, I have been an officer of the Graduate Council of Arts &amp;amp; Sciences (GCAS), the governing body for all graduate and professional students in Case Western’s College of Arts &amp;amp; Sciences (CAS). I joined GCAS in the winter of 2020 as its treasurer, right before the onset of the COVID-19 pandemic, eager to meet new students and help them navigate graduate student life.&lt;/p&gt;
&lt;p&gt;When the pandemic hit and everything moved virtually to Zoom, we still thrived because everyone wanted to maintain some social connections. Just like everyone else, we were limited in what we could do (no in-person Friendsgiving dinner, but we’ll email you a gift card to local eatery), but that didn’t really slow our roll immediately. We had a few small issues contacting some departments, but otherwise GCAS was operating well given the circumstances.&lt;/p&gt;
&lt;p&gt;At the end of Spring 2021, I was elected Co-President alongside my friend Cameron from the Chemistry Department. As pandemic restrictions lifted (for better or worse), we transitioned back to in-person meetings and in-person events. But suddenly, no one was showing up to our meetings except the officers, and no one was showing up to the few events we had planned. What was the cause of this?&lt;/p&gt;
&lt;p&gt;Originally, I’m sorry to admit, I blamed it on my fellow students. For some reason, they didn’t seem to care anymore. I got fed up with it. Here I was, giving up some of my time to help graduate students who couldn’t even be bothered to show up to meetings. I was ready to be done with it. But when Spring 2022 came around, and no one really wanted to take the role of President, Cameron and I (after some pleading from our liaison in the CAS administration) agreed to stay on as Co-Presidents for another year.&lt;/p&gt;
&lt;p&gt;This time, Cameron and I knew that we couldn’t do all the work for GCAS like we had been doing. We were both planning on graduating come the end of the academic year. We have very involved officers who share our commitment to doing better by our graduate students. Suddenly we had committees looking at how graduate students are being paid across CAS, where the payment discrepancies are, which departments are getting more money than others, etc. We have a committee organizing a revamped professional development week with input from alumni who are successful in their fields! Everything seemed to be going great!&lt;/p&gt;
&lt;p&gt;One thing that was still suffering however was our communication. There are 21 departments in CAS and we had representatives from maybe 5 of them (not counting officers representing their own departments) and not all of them came to our meetings. I made it my personal goal this semester to have individual meetings with every department: the ones we have representatives for, the ones we know exist, and the ones we didn’t know if they existed. I wanted to impress on them the importance of GCAS and ask how we can help them.&lt;/p&gt;
&lt;p&gt;And that’s when I realized that my blaming the students for not showing up to meetings was very wrong. They’re not showing up because they are burnt out and not receiving enough support. They’re not showing up because there’s not enough of them. They’re not showing up because they don’t know how they can fix any of this.&lt;/p&gt;
&lt;p&gt;After being shocked at how many departments have single digit populations of graduate students (the Modern Languages department has &lt;em&gt;zero&lt;/em&gt; graduate students, Cognitive Science, Classics, and Religious Studies all have one student, Astronomy has two students, etc.), I was reminded that despite all of our vastly different disciplines, we’re all facing very similar issues. Despite a minimum 5% pay increase we got last academic year&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, we’re all still struggling with making ends meet. Our health insurance leaves much to be desired and often leaves us with very large medical bills. With the overturning of &lt;em&gt;Roe v. Wade&lt;/em&gt;, while Case Western has launched a
, the resolutions it has passed has mostly helped the undergraduate students, leaving the graduate students to figure it out on their own.&lt;/p&gt;
&lt;p&gt;Furthermore, our departments are in crisis. There is a long-standing history (and a recent history) of CAS not getting as many funds as, say, the School of Medicine, School of Law, School of Engineering, etc., get. This severely limits the sizes of our departments, and the hiring freeze put on us as a consequence of the pandemic hasn’t helped the situation. As a result, we don’t have enough professors to mentor graduate students, let alone teach undergraduate classes. That means the graduate students who remain are being asked to pick up more and more work alongside their normal responsibilities.&lt;/p&gt;
&lt;p&gt;I try. I try really hard to fix these issues. Some of them, like health insurance, are mostly out of my hands. I can really only make the administration aware of the issue and poke them occasionally to remind them. Others, like our salaries, I can collect numbers and data on and show the administration who is being shafted and who needs more money. But most of the time, all I feel like I’m doing is talking. That’s not bad in and of itself, but it pales in comparison to action.&lt;/p&gt;
&lt;p&gt;Recently, after dealing with a particularly angering issue, Cameron joked with me and asked, “So, when are elections?” I laughed and honestly couldn’t agree more. I hate it that I’ve become the stereotypical, grizzled fifth-year student, but that’s what’s happened. I’m going to keep trying while I’m here at Case Western, and I’ll continue to fight for graduate students (and postdocs too!) even when I’m not one at whatever institution hires me. But I have to admit that some of the light has gone out of my tired eyes.&lt;/p&gt;
&lt;p&gt;Maybe it’s time for a new person to take up the fight here at Case Western. I wish them all the luck in the world.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I tried to find a reference to this on CAS&amp;rsquo;s website, but alas, I couldn&amp;rsquo;t find anything besides an email in my inbox from the Dean herself. That should tell you something.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Calculating Uncertainties on Strong-line Abundances</title><link>https://astronoraygarner.com/blog/moustakas_method/</link><pubDate>Tue, 02 Nov 2021 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/moustakas_method/</guid><description>&lt;h2 id="background---strong-line-abundances"&gt;Background - Strong Line Abundances&lt;/h2&gt;
&lt;p&gt;When determining the oxygen abundance of an H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; region or a star-forming galaxy as a whole, the most direct and physically motivated method is to measure the electron temperature ($T_e$) of the ionized gas using the intensity of one or more temperature-sensitive auroral lines such as [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λ4363, [N &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λ5755, [S &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λ6312, and [O &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λ7325 (
;
;
). Unfortunately, these auroral lines are intrinsically faint, especially in metal-rich galaxies and star-forming regions. Therefore, when these lines are undetectable or not measured, &lt;em&gt;strong-line&lt;/em&gt; abundance calibrations are used to estimate the metallicity of the ionized gas.&lt;/p&gt;
&lt;p&gt;Strong-line abundance calibrations essentially relate the oxygen abundance to one or more line ratios involving the strongest recombination and collisionally excited (forbidden) lines (e.g., [O &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λ3727, Hα, Hβ, [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λλ4959,5007, [N &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λλ6548,6584, and [S &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λλ6716,6731). Strong-line methods are &lt;em&gt;indirect&lt;/em&gt; and usually model dependent.&lt;/p&gt;
&lt;p&gt;Over the last four decades, numerous strong-line calibrations have been developed, but in general they fall into one of three categories: semi-empirical, empirical, and theoretical. The older, &lt;em&gt;semi-empirical&lt;/em&gt; calibrations were generally tied to electron temperature measurements at low metallicites and photoionization models at high metallicities (e.g.,
;
;
). These hybrid calibrations were born from the observational difficulty of measuring the electron temperature of metal-rich H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions. In contrast, the &lt;em&gt;empirical&lt;/em&gt; methods are calibrated against high-quality observations of individual H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions with measured direct (i.e., $T_e$-based) oxygen abundances (e.g.,
,
;
;
). One of the limitations of the empirical calibrations, especially in the metal-rich regime, is that they are based on observations of relatively small samples of high-excitation H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions, whereas most integrated spectra of galaxies exhibit softer ionizing radiation fields. Finally, the class of &lt;em&gt;theoretical&lt;/em&gt; abundance calibrations is based on ab initio photoionization model calculations, in which various nebular emission line ratios are tracked as a function of the input metallicity and ionization parameter (e.g.,
;
).&lt;/p&gt;
&lt;p&gt;The individual problems with these various calibrations is compounded by the fact that there exist large, poorly understood systematic discrepancies, in the sense that empirical calibrations generally yield oxygen abundances that are factors of 1.5-5 &lt;em&gt;lower&lt;/em&gt; than abundances derived using theoretical calibrations (
). Unfortunately, the physical origin of this systematic discrepancy remains unsolved.&lt;/p&gt;
&lt;p&gt;Some of the more common strong-line calibrations rely on the metallicity-sensitive $R_{23}$ parameter (
):&lt;/p&gt;
$$R_{23} = \frac{\text{[OII]}\lambda3727 + \text{[OIII]}\lambda\lambda4959,5007}{\text{H}\beta}.$$&lt;p&gt;The advantage of $R_{23}$ as an oxygen abundance diagnostic is that it is directly proportional to both principal ionization states of oxygen, unlike other diagnostics that have a second-order dependence on the abundance of other elements like nitrogen or sulfur. The disadvantages of $R_{23}$ are that it is sensitive to AGN contamination, and it must be corrected for stellar absorption and dust attenuation.&lt;/p&gt;
&lt;p&gt;An additional complication is that the relation between $R_{23}$ and metallicity is famously double-valued. For example, using the calibration of
, we can see the issue.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;astropy.table&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Table&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;astropy.io&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;fits&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scipy.stats&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;matplotlib&lt;/span&gt; &lt;span class="n"&gt;inline&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rcParams&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;font.size&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;xtick.minor.visible&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;ytick.minor.visible&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5749&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;2.939&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.237&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.305&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0283&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0047&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0221&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.102&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0817&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.00717&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;4.944&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.767&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.602&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.29&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.332&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.331&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;111&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;z_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt;&lt;span class="p"&gt;,[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;--&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argwhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(R_&lt;/span&gt;&lt;span class="si"&gt;{23}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm&lt;/span&gt;&lt;span class="si"&gt;{O}&lt;/span&gt;&lt;span class="s1"&gt;/\mathrm&lt;/span&gt;&lt;span class="si"&gt;{H}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_3_1.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;In the above figure, we have the $R_{23}$ parameter on the $x$-axis and the oxygen abundance on the $y$-axis. The M91 calibration accounts for the ionization parameter in the form of $\log(\text{O}_{32})$, where $\text{O}_{32}$ is&lt;/p&gt;
$$\text{O}_{32} = \frac{\text{[OIII]}\lambda\lambda4959,5007}{\text{[OII]}\lambda3727},$$&lt;p&gt;and this characterizes the hardness of the ionizing radiation field; the styled lines indicate different blanket values of this O&lt;sub&gt;32&lt;/sub&gt; parameter. However, we can see the broader issue. Metal-rich objects lie on the &lt;em&gt;upper&lt;/em&gt; $R$&lt;sub&gt;23&lt;/sub&gt; branch, while metal-poor galaxies and H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions lie on the &lt;em&gt;lower&lt;/em&gt; branch; the transition between the upper and lower $R$&lt;sub&gt;23&lt;/sub&gt; branches is called the &lt;em&gt;turn-around&lt;/em&gt; region. This non-monotonic relation between $R_{23}$ and $12+\log(\text{O}/\text{H})$ arises because in metal-rich star-forming regions, $R_{23}$ decreases with increasing metallicity as the far-infrared fine-structure lines (predominantly [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λ52μm and [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λ88μm) increasingly dominate the nebular cooling. At low metallicity, on the other hand, the optical transitions dominate the nebular cooling, and so $R_{23}$ decreases in tandem with decreasing metallicity because its strength is directly proportional to the abundance of oxygen atoms.&lt;/p&gt;
&lt;p&gt;Because the $R$&lt;sub&gt;23&lt;/sub&gt;-metallicity relation is double-valued, we must take special care when computing the oxygen abundances of objects near the turn-around region, where the upper and lower branches intercept. In particular, objects that are statistically consistent with being on &lt;em&gt;either&lt;/em&gt; the upper branch &lt;em&gt;or&lt;/em&gt; the lower branch must have correspondingly large abundance errors. In addition, measurement uncertainties or residual AGN contamination occasionally result in an $R$&lt;sub&gt;23&lt;/sub&gt; parameter that is larger than $\sim$10, the approximate theoretical limit for photoionization by massive stars (
). Although these objects formally lie &amp;ldquo;off&amp;rdquo; the $R$&lt;sub&gt;23&lt;/sub&gt; calibration, rather than rejecting them outright, which is typically what is done in the literature, it is better to asses whether they are statistically consistent with being &lt;em&gt;on&lt;/em&gt; the $R$&lt;sub&gt;23&lt;/sub&gt; calibration under consideration.&lt;/p&gt;
&lt;p&gt;Here, I am going to illustrate and provide example code for utilizing the method outlined in
to determine the oxygen abundance of star-forming regions in the spiral galaxy M101 and their associated uncertainties.&lt;/p&gt;
&lt;h2 id="background---monte-carlo"&gt;Background - Monte Carlo&lt;/h2&gt;
&lt;p&gt;I will refer any interested reader to the detailed example provided by Will Clarkson at the University of Michigan, which you can read by clicking
. However, I will summarize a few brief points.&lt;/p&gt;
&lt;p&gt;One of the most important pieces of model-fitting is to determine the &amp;ldquo;uncertainty&amp;rdquo; in the value of some parameter in the model. You might have fit some value of your model parameter to data, and it may even go through most of the datapoints and be consistent with your prior expectation on the parameter values. But unless you know what range of values of this parameter are consistent with the data, you really don&amp;rsquo;t know if your model fits at all.&lt;/p&gt;
&lt;p&gt;First, a note and some assumptions.&lt;/p&gt;
&lt;p&gt;It is common in the literature to condense the information contained in the deviations from the &amp;ldquo;best-fit&amp;rdquo; value to report the &amp;ldquo;1-sigma&amp;rdquo; range, often reported as $a \pm s$, where $s$ is the &amp;ldquo;1-sigma&amp;rdquo; range. In most cases, this means the range of values that bound 68 percent of the measured values under a large number of experiments. Formally, this practice throws away most of the information the reader might want to know: even under Gaussian measurement errors the posterior distribution of the best-fit parameter can be highly asymmetric and non-Gaussian. Simply reporting one number throws away the true distribution and is not good practice. However, it&amp;rsquo;s the practice most people go with, so we&amp;rsquo;ll try and take the baby before we throw out the bathwater.&lt;/p&gt;
&lt;p&gt;I will additionally make the same assumptions that Will Clarkson made, namely that&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;our model $f(x)$ really does describe the behavior we are measuring, and&lt;/li&gt;
&lt;li&gt;any deviations between the perfect underlying pattern predicted by $f(x)$ and those we measure, $y(x)$, are due only to measurement error that we can parameterize.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If we were to conduct a large number of identical experiments, then the &amp;ldquo;true&amp;rdquo; parameters of our model $f(x)$ would not change, but those are inaccessible to us; the parameters that best describe the data would change a little between experiments because we don&amp;rsquo;t measure exactly the underlying behavior. &lt;strong&gt;The range of best-fit values returned across the set of experiments is then a reasonable estimate for the range in the parameter values allowed by the data.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since we cannot do an infinite number of repeat experiments, we need another way to predict what range of parameter values would be returned if we could do them. One way is the formal error-estimate: &lt;em&gt;if&lt;/em&gt; the measurement errors all follow the same distribution, and if they are &amp;ldquo;small enough,&amp;rdquo; then you can use standard error propagation to take the measurement error and propagate it through to get a formal prediction on the error of the parameter. &lt;em&gt;But&lt;/em&gt; there&amp;rsquo;s no guarantee that this will work in all cases. What you need in the real world is a method that will empirically find the range of parameters that fit the model to some level of &amp;ldquo;confidence&amp;rdquo; without actually doing ten thousand re-runs of the experiment to determine this range.&lt;/p&gt;
&lt;p&gt;This is what Monte Carlo does in this context: &lt;strong&gt;&lt;em&gt;simulate a large number of fake datasets and find the best-fit parameters using exactly the same method that you&amp;rsquo;re using to fit your real data.&lt;/em&gt;&lt;/strong&gt; The range of returned parameters under these fake experiments is then a reasonable approximation to the true underlying error in the best-fit parameters.&lt;/p&gt;
&lt;h2 id="an-example-with-real-data"&gt;An Example with Real Data&lt;/h2&gt;
&lt;p&gt;I have at my disposal emission line data for M101 taken from narrowband images of the M101 Group targeting the emission lines of Hα, Hβ, [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;]λλ4959,5007, and [O &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λ3727. The images were collected using Case Western Reserve University&amp;rsquo;s 24/36-in Burrell Schmidt telescope in Kitt Peak, Arizona. See
and
for an overview of some of the narrowband images and
for an overview of our broadband capabilities.&lt;/p&gt;
&lt;p&gt;Here, the data has been fully cleaned: Galactic extinction and interstellar reddening have been corrected, and line emission has been corrected for stellar Balmer absorption and contamination from [N &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λλ6548,6584 and [S &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;]λλ6716,6731 emission.&lt;/p&gt;
&lt;p&gt;First, we load in the data, calculate the $R_{23}$ and O$_{32}$ line ratios, and their associated errors.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hdul&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fits&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;M101_H&amp;amp;nbsp;&amp;lt;span style=&amp;#39;&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="n"&gt;em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;gt;II&amp;lt;/span&amp;gt;_regions_corrected_photometry.fits.gz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hdul&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s take a look at the distribution of the data:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fig2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot_mosaic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; abc
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; def
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ax&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Ha&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;c&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;e&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;f&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(&lt;/span&gt;&lt;span class="si"&gt;{0}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$N$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(\mathrm{{&lt;/span&gt;&lt;span class="si"&gt;{0}&lt;/span&gt;&lt;span class="s1"&gt;}})$ [erg s$^{{-1}}$ cm$^{{-2}}$]&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$N$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_11_1.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;We see that our line fluxes are across the same range and are somewhat Gaussian. For context, the Hα flux tapers off at around $10^{-15}$ erg s$^{-1}$ cm$^{-2}$ which corresponds to a star formation rate of $3 \times 10^{-5}$ M$_\odot$ yr$^{-1}$ (
;
).&lt;/p&gt;
&lt;p&gt;We can also do the same for the associated uncertainties:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fig3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot_mosaic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; abc
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; def
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ax&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Ha&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;c&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;e&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;f&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(&lt;/span&gt;&lt;span class="si"&gt;{0}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$N$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(\mathrm{{&lt;/span&gt;&lt;span class="si"&gt;{0}&lt;/span&gt;&lt;span class="s1"&gt;}})$ [erg s$^{{-1}}$ cm$^{{-2}}$]&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax3&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$N$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_13_1.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;We see that our O3 and O2 errors are roughly Gaussian, while our Hα and Hβ error distributions might be Lorentzian in nature. Notably, the $R_{23}$ and O$_{32}$ errors do appear to be broadly Gaussian in nature. This is all good!&lt;/p&gt;
&lt;p&gt;Now we can plot our $R_{23}$ values against the $R_{23}$-metallicity relation. However, to do that, we need some way of picking which branch a particular H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; region lies on. The current recommendations for assigning branches to H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions is to utilize line ratios with [N &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;] (
;
). In that case, a region is assigned to the lower branch if $\log(\text{[NII]}/\text{H}\alpha) &lt; -1$ and $\log(\text{[NII]}/\text{[OII]}) &lt; -1.05$, while regions are assigned to the upper branch if $\log(\text{[NII]}/\text{H}\alpha) &gt; -1$ and $\log(\text{[NII]}/\text{[OII]}) &gt; -0.8$.&lt;/p&gt;
&lt;p&gt;However, due to the placement of our narrowband filters, we have no way of measuring the [N &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;] line emission. Therefore, at the suggestion of
, we use the calibration of
, which does not require an upper/lower branch distinction to be made, to calculate an initial guess of the metallicity. This step is problematic for many reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the Z94 calibration is itself an average of three older theoretical calibrations and will suffer from the same uncertainties in those calibrations;&lt;/li&gt;
&lt;li&gt;the Z94 calibration will be very inaccurate at low abundances ($\log(\text{O/H}) + 12 &lt; 8.5$), causing metallicities to be overestimated by a factor of up to 0.5 dex in this range; and&lt;/li&gt;
&lt;li&gt;the Z94 calibration will preferentially assign most of the $\log(R_{23})$ parameter space to the upper branch, causing spurious artifacts to remain, such as a plateau in the radial abundance gradient (see
for a discussion).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These problems notwithstanding, we will go ahead and use the Z94 calibration to make our initial guesses as to which branch each H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; region belongs.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;zaritsky94&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_R23&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;9.265&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.33&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;log_R23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.202&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;log_R23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.207&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;log_R23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.333&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;log_R23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mcgaugh91&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Z_guess&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;Z_guess&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;8.4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;4.944&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.767&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.602&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.29&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.332&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.331&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;Z_guess&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;8.4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;2.939&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.237&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.305&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0283&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;logO32&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0047&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0221&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.102&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.0817&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.00717&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;logR23&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Z_guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;zaritsky94&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Z_real&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O32&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;Z_guess&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Z_real&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Z_real&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;111&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;z_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt;&lt;span class="p"&gt;,[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;--&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argwhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;Z_real&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;C0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;markersize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;None&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(R_&lt;/span&gt;&lt;span class="si"&gt;{23}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{O/H})_{\mathrm&lt;/span&gt;&lt;span class="si"&gt;{M91}&lt;/span&gt;&lt;span class="s1"&gt;}$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;8.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_15_2.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Once again, we have the $R_{23}$ parameter on the $x$-axis and the metallicity on the $y$-axis. The styled lines are the M91 calibration for particular O$_{32}$ values and the blue points are the H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; regions in M101. Most of the regions fall on the $R_{23}$ calibration, but there are many regions with $\log(R_{23}) &gt; 1.0$ that fall off of the calibration. Since the calibration is just an equation, it will spit out a number regardless of how unphysical that number is; in this case, the M91 calibration becomes unphysical for $\log(R_{23}) &gt; 1.0$.&lt;/p&gt;
&lt;p&gt;Normally, we would toss these high $R_{23}$-valued regions, and most of the literature does just that. However, you can imagine that if we were to plot the $R_{23}$ error bars as well, some of those &amp;ldquo;unphysical&amp;rdquo; regions could conceivable lie on the calibration given the full range of their uncertainties. This is where the Monte Carlo method devised by
comes in.&lt;/p&gt;
&lt;p&gt;We need to set up a few things first: the number of trials and the combined set of best-fit parameters for all the model parameters (initially empty).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([])&lt;/span&gt; &lt;span class="c1"&gt;# an array for the upper branch metallicities&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([])&lt;/span&gt; &lt;span class="c1"&gt;# an array for the lower (down) branch metallicities&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we do the simulations. Each time we need to generate the data as well as pass it through the calibrations, one solution for the upper branch and one solution for the lower branch.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Hb_trial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hb_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;O2_trial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O2_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;O3_trial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;O3_nored_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;O32_trial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;O3_trial&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;O2_trial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;R23_trial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;O3_trial&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;O2_trial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Hb_trial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# We use a try/except clause to catch weird regions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;up&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_trial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;O32_trial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dumdum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_trial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;O32_trial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dumdum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Stack the trial onto the running sample&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m101_z_up&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m101_z_up&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vstack&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m101_z_dw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m101_z_dw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vstack&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dw&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A few points to note:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The routine might not always work. A more sophisticated analysis would catch those errors. Here, I&amp;rsquo;m using Python&amp;rsquo;s &amp;ldquo;try/except&amp;rdquo; clause to ignore the bad cases.&lt;/li&gt;
&lt;li&gt;In this example, I am starting with an empty array and then stacking on the fit-values only if the fitting routine ran without failing. The &amp;ldquo;continue&amp;rdquo; statement stops the routine from dumbly stacking on the last fit-value if the fit failed. I do things this way so that the fitpars array is always the correct size to match the number of correctly-run trials.&lt;/li&gt;
&lt;li&gt;I am picking random values surrounding each region&amp;rsquo;s values within its uncertainties, assuming a Gaussian distribution within those uncertainties. That may not necessarily be the case, but it will work for our purposes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Having done all that, let&amp;rsquo;s look at the size of the set of trials:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;(500, 849)
(500, 849)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This shows that all of our 500 trials were successful! Now let&amp;rsquo;s take a look at the distribution:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Upper Branch Metallicity: &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; +/- &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Lower Branch Metallicity: &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; +/- &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Upper Branch Metallicity: 8.54 +/- 1.35
Lower Branch Metallicity: 8.15 +/- 0.55
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now comes the method outlined by Moustakas et al. (2010). You can imagine that there are three possible cases when you look at a particular H &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt; region&amp;rsquo;s upper and lower branch solutions. In the first case, the upper and lower branch solutions are distinct and well-separated, i.e., they are outside of each other&amp;rsquo;s uncertainties. Once the appropriate branch has been chosen, the corresponding metallicity follows. This is easily seen in the left-hand plot below: the upper branch solution (red circle) is above and well-separated from the lower branch solution (blue triangle). The right-hand plot below shows the Monte Carlo distribution of $12 + \log(\text{O/H})$ values corresponding to the solution on the upper (solid red histogram) and lower branch (dashed blue histogram) assuming Gaussian errors on the [O &lt;span style='font-size: 0.8em;'&gt;II&lt;/span&gt;], [O &lt;span style='font-size: 0.8em;'&gt;III&lt;/span&gt;], and Hβ line flux after 500 trials. Assuming this object belongs on the upper branch, the $1\sigma$ uncertainty on $12 + \log(\text{O/H})$ is given by the width of the solid red histogram.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fig5&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot_mosaic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; ab
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Plot the M91 calibration for particular O32 values&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;z_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt;&lt;span class="p"&gt;,[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;--&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argwhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Plot the upper branch solution&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;errorbar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xerr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.434&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;yerr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;mec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mfc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;o&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;markersize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ecolor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;elinewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;capsize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mew&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Plot the lower branch solution&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;errorbar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xerr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.434&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;yerr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;mec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mfc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;^&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;markersize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ecolor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;elinewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;capsize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mew&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Plot the upper and lower branch histograms&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;histtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;step&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;bins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;histtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;step&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;--&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set plot kwargs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(R_&lt;/span&gt;&lt;span class="si"&gt;{23}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm&lt;/span&gt;&lt;span class="si"&gt;{O}&lt;/span&gt;&lt;span class="s1"&gt;/\mathrm&lt;/span&gt;&lt;span class="si"&gt;{H}&lt;/span&gt;&lt;span class="s1"&gt;)_{\mathrm&lt;/span&gt;&lt;span class="si"&gt;{M91}&lt;/span&gt;&lt;span class="s1"&gt;}$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm&lt;/span&gt;&lt;span class="si"&gt;{O}&lt;/span&gt;&lt;span class="s1"&gt;/\mathrm&lt;/span&gt;&lt;span class="si"&gt;{H}&lt;/span&gt;&lt;span class="s1"&gt;)_{\mathrm&lt;/span&gt;&lt;span class="si"&gt;{M91}&lt;/span&gt;&lt;span class="s1"&gt;}$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$N$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# If upper branch solution is above lower branch solution&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If they aren&amp;#39;t well-separated, i.e., within each other&amp;#39;s 1*sigma&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmean&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axvline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{{O}}/\mathrm{{H}}) = &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; \pm &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;best&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If they are well-separated, let the initial guess decide which branch to use&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;Z_guess&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;8.4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axvline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{{O}}/\mathrm{{H}}) = &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; \pm &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;best&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axvline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{{O}}/\mathrm{{H}}) = &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; \pm &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;best&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# If upper branch solution is below lower branch solution&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If they aren&amp;#39;t well-separated, i.e., within each other&amp;#39;s 1*sigma&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmean&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axvline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{{O}}/\mathrm{{H}}) = &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt; \pm &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s1"&gt;$&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;best&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If they are well-separated, mark it as indeterminant&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;No determination possible&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ha&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;left&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;va&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;center&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ax5&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transAxes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_25_0.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;In the second case, the formal solution on the lower branch is larger than the solution on the upper branch (note that the blue triangle is now above the red circle in the plot on the left below). In the right plot below, the overlapping region of the histograms corresponds to values of $R_{23}$ and O$_{32}$ that lie &lt;em&gt;on&lt;/em&gt; the M91 calibration, that is, where $(\text{O/H})_{\text{upper}} &gt; (\text{O/H})_{\text{lower}}$. If the central values of the two distributions are within $1\sigma$ of each other, as measured by the width of the overlapping region, we adopt the average of the two solutions as the oxygen abundance, and the width of the overlapping region as the $1\sigma$ uncertainty. In practice, these types of regions all have M91 abundances equal to the abundance around the turn-around region, $\approx 8.4$ dex; however, they also have large abundance errors, which reflects this ambiguity in picking a branch.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_27_0.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Finally, the third case is where no oxygen abundance measurement is possible using the M91 calibration. Here, the upper and lower branch solutions are statistically inconsistent with each other, given the measurement uncertainties; therefore no solution exists, and these objects must be rejected.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_29_0.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Now, we can write a code that doesn&amp;rsquo;t just plot this, but saves the determined (or undetermined) value for each region as a new column in our DataFrame.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Z_guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;zaritsky94&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmean&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;Z_guess&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;8.4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isnan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmean&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanmedian&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_up&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nanstd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m101_z_dw&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M91_err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;M91&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;M91&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;M91_err&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;M91_err&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s take a look at the $R_{23}$-metallicity relation once more to see how we&amp;rsquo;ve faired.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;fig4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;constrained_layout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;111&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;z_vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;O32_vals&lt;/span&gt;&lt;span class="p"&gt;,[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;--&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argwhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;mcgaugh91_dw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R23_vals&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R23_vals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;k&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;R23&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;M101Data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;M91&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;C0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;markersize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;None&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$\log(R_&lt;/span&gt;&lt;span class="si"&gt;{23}&lt;/span&gt;&lt;span class="s1"&gt;)$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$12 + \log(\mathrm{O/H})_{\mathrm&lt;/span&gt;&lt;span class="si"&gt;{M91}&lt;/span&gt;&lt;span class="s1"&gt;}$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_xlim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ax4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_ylim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;8.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="./Moustakas_Method_33_2.png" alt="png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Comparing this plot to the one we made before, we have now removed the &amp;ldquo;unphysical&amp;rdquo; regions that did not fall on the calibration even within their uncertainties. There are four outliers which will require further investigation to determine whether they are realistic or not. Another feature we notice now is a line of points at about $12 + \log(\text{O/H}) \sim 8.4$. These are points in the turn-around region that have been &amp;ldquo;pushed&amp;rdquo; to the turn-around region metallicity. While this appears bad and might be a downside to the calibration procedure, remember that those points will have relatively higher uncertainties associated with them. When plotting a radial gradient, for instance, any line fitter that can take into account uncertainties should not be weighed heavily by these points.&lt;/p&gt;
&lt;h2 id="conclusions"&gt;Conclusions&lt;/h2&gt;
&lt;p&gt;Using Monte Carlo and the methodology outlined by Moustakas et al. (2010), I have hopefully illustrated its usefulness in robustly determining metallicities. This method allows for a straightforward calculation of realistic uncertainties on the abundance as determined by strong-line methods. Obviously, this method will still suffer from the known problems associated with strong-line abundance determinations, but we will be able to state our uncertainties in a more statistical sense. Additionally, although not illustrated here, this can be applied to any strong-line calibration using the $R_{23}$ parameter, not just M91.&lt;/p&gt;
&lt;p&gt;As always, let me know if you spot any errors in my code or the logic behind this method!&lt;/p&gt;</description></item><item><title>An Astronomer's Perspective</title><link>https://astronoraygarner.com/blog/perspective/</link><pubDate>Tue, 21 Sep 2021 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/perspective/</guid><description>&lt;p&gt;&lt;em&gt;&lt;span style="font-size: 0.75em;"&gt;This post was the script to the final talk in my Astronomy 101 lecture series originally presented on September 12, 2021. Although there is no video of thet alk and I don&amp;rsquo;t plan on making one available, here is the script that I put together for that night. Parts of it were heavily borrowed from Neil deGrasse Tyson&amp;rsquo;s &amp;ldquo;Cosmos: A Spacetime Odyssey&amp;rdquo; and I acknowledge that here. I claim no rights to those parts.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Over these past few weeks, we have discussed some big ideas. We’ve explored to the furthest reaches of the Universe and through the vast eons of time. That often leaves people feeling tiny and insignificant, even small. Well, in the context of the cosmos, we are small!&lt;/p&gt;
&lt;p&gt;But the thing is, we may just be little guys living on a speck of dust, afloat in a staggering immensity, but we sure don’t think small. In all our lives, there comes a time when we first realize that we aren’t the center of the Universe, that we belong to something much greater than ourselves. It’s part of growing up. And as it happens to each of us, so it began to happen to our civilization in the sixteenth century.&lt;/p&gt;
&lt;p&gt;Imagine a world before telescopes, when the Universe was only what you could see with the naked eye. It was obvious that the Earth was motionless and that everything in the heavens—the Sun, the Moon, the planets, the stars—revolved around us. But then a Polish astronomer and priest named Nicolaus Copernicus made a radical proposal: the Earth was not at the center. It was just one of the planets, and, like them, it revolved around the Sun.&lt;/p&gt;
&lt;p&gt;Many religious figures, like the Protestant reformer Martin Luther, took this idea as a scandalous affront to Scripture. They were horrified! But for one man, Copernicus didn’t go far enough. His name was Giordano Bruno. He longed to bust out of that cramped little universe. Even as a young Dominican monk in Naples, he was a rebel. Bruno hungered to know everything about God’s creation. He dared to read books banned by the Church and that was his undoing. In one of them, an ancient Roman, a man already dead for more than 1500 years, whispered to him of a universe far greater, one as boundless as his idea of God.&lt;/p&gt;
&lt;p&gt;Lucretius, in his book &amp;ldquo;On the Nature of Things,&amp;rdquo; asked the reader to imagine standing at the edge of the universe and shooting an arrow outward. If the arrow keeps going, then clearly the universe extends beyond what you thought was the edge. But if the arrow doesn’t keep going and hits a wall instead, then that wall must lie beyond what you thought was the edge of the universe. Now if you stand on &lt;em&gt;that&lt;/em&gt; wall and shoot another arrow, there are only the same two possible outcomes: it either flies forever out into space or it hits some boundary where you can just stand and shoot yet another arrow.&lt;/p&gt;
&lt;p&gt;Either way, the Universe is unbounded. The cosmos must be infinite. This made perfect sense to Bruno. The God he worshiped was infinite, so how, he reasoned, could Creation be anything less? These heretical ideas were his undoing. When he learned an indictment was being prepared against him by his monastery in Naples, he fled the city. That would be the last steady job he ever had.&lt;/p&gt;
&lt;p&gt;And then, when he was only 30, he had the vision that sealed his fate. In his dream, he awakened to a world enclosed inside a confining bowl of stars. This was the cosmos of Bruno’s time. As he walked to the edge of this universe, Bruno experienced a sickening moment of fear, as if the bottom of everything was falling away beneath his feet.&lt;/p&gt;
&lt;p&gt;But he summoned up his courage.&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&amp;ldquo;I cleave the heavens and soar to the infinite.
And while I rise from my own globe to others
And penetrate ever further through the eternal field,
That which others saw from afar, I leave far behind me.&amp;quot;&lt;br&gt;
&amp;ndash;Giordano Bruno, &lt;em&gt;&amp;ldquo;On the Infinite Universe and Worlds&amp;rdquo;&lt;/em&gt;, 1584&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
&lt;img src="Flammarion.jpg" alt="A woodcut from &lt;em&gt;L'Atmosphere: M&amp;eacute;t&amp;eacute;orologie Populaire&lt;/em&gt; by Camille Flammarion. The illustration is of a dome of stars with a landscape underneath it. A man has his head stuck out of the dome looking up at the universe beyond." style="width:350px;height:auto"/&gt;
&lt;figcaption&gt;Camille Flammarion, &lt;em&gt;L'Atmosphere: M&amp;eacute;t&amp;eacute;orologie Populaire&lt;/em&gt; (Paris, 1888), p. 163. Colorized by Susanna J. Magruder. Courtesy History of Science Collections, University of Oklahoma Libraries.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The revelation of this immensity was like falling in love. Bruno became an evangelist, spreading the gospel of infinity throughout Europe. He assumed that other lovers of God would naturally embrace this grander and more glorious view of Creation.&lt;/p&gt;
&lt;p&gt;Instead, he was excommunicated by the Roman Catholic Church in his homeland, expelled by the Calvinists in Switzerland and by the Lutherans in Germany. Eventually, Bruno found a brief lectureship at Oxford University where he could freely spread his view on infinity. However, even there his views were controversial. George Abbot, then Vice-Chancellor of the University and later Archbishop of Canterbury, mocked Bruno for supporting &amp;ldquo;the opinion of Copernicus that the Earth did go round, and the heavens did stand still; whereas in truth it was his own head which rather did run round, and his brains did not stand still.&amp;rdquo; A wiser man would have learned his lesson, but Bruno was not such a man.&lt;/p&gt;
&lt;p&gt;He couldn’t keep his soaring vision of the cosmos to himself, despite the fact that the penalty for doing so in his world was the most vicious form of cruel and unusual punishment. Giordano Bruno lived at a time when there was no such thing as the separation of church and state or the notion that freedom of speech was a sacred right of every individual.&lt;/p&gt;
&lt;p&gt;Recklessly, Bruno returned to Italy. Maybe he was homesick, but still, he must have known that his homeland was one of the most dangerous places in Europe he could possibly go. It wasn’t long before Bruno fell into the clutches of the Catholic Church. This wanderer, who worshiped an infinite universe, languished in confinement for eight years. Through relentless interrogations, he stubbornly refused to renounce his views.&lt;/p&gt;
&lt;p&gt;Why was the Church willing to go to such lengths to torment Bruno? What were they afraid of? If Bruno was right, then the sacred books and the authority of the Church would be open to question.&lt;/p&gt;
&lt;p&gt;Finally, the charges were brought. Among them were: holding opinions contrary to the Catholic faith about the Trinity and divinity of Christ; regarding the virginity of Mary, mother of Jesus; pertaining to Jesus as Christ; and claiming the existence of a plurality of worlds and their eternity. Once again, Bruno refused to recant his claims.&lt;/p&gt;
&lt;p&gt;On January 20, 1600, Pope Clement VIII declared Bruno a heretic and the Inquisition sentenced him to death. &amp;ldquo;Perhaps you pronounce this sentence against me with greater fear than I receive it,&amp;rdquo; Bruno responded.&lt;/p&gt;
&lt;p&gt;Ten years after Bruno’s martyrdom, Galileo first looked through a telescope, realizing that Bruno had been right all along. The Milky Way was made of countless stars invisible to the naked eye, and some of those lights in the sky were actually other worlds.&lt;/p&gt;
&lt;p&gt;Bruno was no scientist. His vision of the cosmos was a lucky guess because he had no evidence to support it. Like most guesses, it would well have turned out to be wrong. But once the idea was in the air, it gave others a target to aim at.&lt;/p&gt;
&lt;p&gt;And over the past several weeks, we too have soared through the infinite. We have left the Earth for the furthest reaches of space. Our nearest neighbor, the Moon, has no sky, no ocean, no life. Just the scars of cosmic impacts. Our star, the Sun, powers all the wind, waves, and life on the surface of our little world. It also holds all the worlds of the solar system in its gravitational embrace, starting with hot and fast-footed Mercury to cloud-covered Venus, where a runaway greenhouse effect has turned it into a kind of hell.&lt;/p&gt;
&lt;p&gt;The red planet Mars is a world that has interested humanity for centuries. And despite it being the most explored planet, it still holds mysteries for us. A belt of rocky asteroids circles the Sun between the orbits of Mars and Jupiter. It is also host to the dwarf planet Ceres, the only spherical body in the belt, but still only 7% the size of Earth.&lt;/p&gt;
&lt;p&gt;With its four giant moons and dozens of smaller ones, Jupiter is like its own little solar system. Its Great Red Spot is a hurricane three times the size of our whole planet that’s been raging for centuries. The crown jewel of the solar system, Saturn, is ringed by freeways of countless orbiting and slowly tumbling snowballs. Uranus and Neptune, the outermost planets, were unknown to the ancients and only discovered &lt;em&gt;after&lt;/em&gt; the invention of the telescope. Beyond the outermost planet, there is a swarm of tens of thousands of frozen worlds, and Pluto is one of them.&lt;/p&gt;
&lt;p&gt;The deepest waters of the vast cosmic ocean and their numberless worlds lie ahead. From out here, the Sun may look like just another star. &lt;em&gt;How many stars? How many worlds?&lt;/em&gt; We live in the Milky Way Galaxy in a trailing outer arm about 30,000 lightyears from the center of our grand spiral. Our galaxy is part of a few dozen in our Local Group, including our nearest neighbor the Andromeda Galaxy. But even then, we are just one of thousands of galaxies in the Virgo supercluster. Each galaxy contains billions of suns and countless worlds. Yet the entire Virgo superlcuster itself forms a tiny fraction of our Universe.&lt;/p&gt;
&lt;p&gt;But the Universe is not only immense in size, it is also staggeringly immense in time. How can we humans, who rarely live as long as a century, hope to grasp the 13.8 billion year history of the cosmos?&lt;/p&gt;
&lt;p&gt;Let’s compress it into a single calendar year. The Cosmic Calendar begins on January 1st with the birth of our Universe and ends with the present day on December 31st. On this scale every month represents about a billion years and every day about 40 million years.&lt;/p&gt;
&lt;p&gt;Let’s go to January 1st, the Big Bang. Our entire Universe came into being from a point smaller than a single atom. Space itself exploded in a cosmic fire, launching the expansion of the Universe and giving birth to all the matter and energy we know today. Recently, I showed you the strong observational evidence to support the Big Bang: the amount of helium and deuterium in the cosmos and the glow of the cosmic microwave background radiation.&lt;/p&gt;
&lt;p&gt;As it expanded, the Universe cooled, and there was darkness for about 200 million years. Gravity was pulling together clumps of gas and heating them until the first stars burst into light on January 10th. On January 13th, these stars coalesced into the first small galaxies. These galaxies merged to form still larger ones, including our own Milky Way, which formed about 11 billion years ago on March 15th of the cosmic year.&lt;/p&gt;
&lt;p&gt;As these galaxies formed, stars flashed each time they ran out of fuel in a supernova. These supernovae would disturb nearby clouds of gas and star would start condensing out of them like raindrops. Stars get so hot that the nuclei of atoms fuse together deep within them to make the oxygen we breathe, the carbon in our muscles, the calcium in our bones, and iron in our blood; all of it was cooked in the fiery hearts of long-vanished stars. You, me, everyone and everything, is made of star stuff. This star stuff is recycled and enriched, again and again, through succeeding generations of stars.&lt;/p&gt;
&lt;p&gt;How much longer until the birth of the Sun? A long time. It won’t begin to shine for another six billion years. Our Sun’s birthday is August 31st on the Cosmic Calendar, about 4.5 billion years ago. As with the other worlds of the solar system, Earth was formed from a disk of gas and dust orbiting the newborn Sun. Repeated collisions produced a growing ball of debris. The Earth took one hell of a beating in its first billion years. Fragments of orbiting debris collided and coalesced until they snowballed to form the Moon; a souvenir of that violent epoch.&lt;/p&gt;
&lt;p&gt;As the Earth cooled, seas began to form. Life began here, on September 21st, 3.5 billion years ago on our little world. We still don’t know how life got stared. The origin of life is one of the greatest unsolved mysteries of science. Regardless of how it started, on November 9th, life was breathing, moving, eating, responding to its environment.&lt;/p&gt;
&lt;p&gt;December 17th was quite a day. Life in the sea really took off, exploding with a diversity of larger plants and animals. Forests, dinosaurs, birds, insects, they all evolved in the final week of December. The first flower bloomed on December 28th. As these ancient forests grew and died and sank beneath the surface, their remains transformed into coal, which we use to power and imperil our civilization.&lt;/p&gt;
&lt;p&gt;Then at 6:24 AM on December 30th, an asteroid collided with what would later be Mexico and wiped out the dinosaurs, the lords of the Earth. Still no signs of us.&lt;/p&gt;
&lt;p&gt;In the vast ocean of time that this calendar represents, we humans have only evolved within the last hour of the last day of the cosmic year. All of recorded history occupies only the last 14 seconds, and every person you’ve ever heard of lived somewhere in there. All those kings and battles, migrations and inventions, wars and loves, everything in the history books happened here.&lt;/p&gt;
&lt;p&gt;It’s 9:45 on New Year’s Eve. Three and half million years ago, our ancestors stood up on two feet and suddenly our eyes were no longer fixed on the ground. Now we were free to look up and wonder. We’re so young on the timescale of the Universe that we didn’t start painting our first pictures until the last 60 seconds of the cosmic year, a mere 30,000 years ago. This is when we invented astronomy. In fact, we’re all descended from astronomers. Our survival depended on knowing how to read the stars in order to predict the coming of the winter and the migration of the wild beasts.&lt;/p&gt;
&lt;p&gt;And then, around 10,000 years ago, there began a revolution in the way we lived. Our ancestors learned how to shape their environment, taming wild plants and animals, cultivating land and settling down.&lt;/p&gt;
&lt;p&gt;This changed &lt;em&gt;everything&lt;/em&gt;. For the first time in history, we had more stuff than we could carry. We needed a way to keep track of it. At 14 seconds to midnight, or about 6,000 years ago, we invented writing. Writing allowed us to save our thoughts and send them much further in space and time. Tiny markings on a clay tablet became a means for us to vanquish mortality. It shook the world.&lt;/p&gt;
&lt;p&gt;Moses was born 7 seconds ago; Buddha, 6 seconds ago; Jesus, 5 seconds ago; Mohammad, 3 seconds ago. It was not even 2 seconds ago that, for better or worse, the two halves of the Earth discovered each other. And it was only in the very last second of the Cosmic Calendar that we began to use science to reveal nature’s secrets and her laws. The scientific method is so powerful that in a mere four centuries, it has taken us from Galileo’s first look through a telescope at another world to leaving our footprints on the Moon. It allowed us to look out across space and time to discover where and when we are in the cosmos. &lt;em&gt;We are a way for the cosmos to know itself.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And we have come to know it well not only as a scientific endeavor, but as a human endeavor too. A long time ago, in a world lit only by fire, our relationship with the stars was far more personal. Night after night, we watched the stars. In a time when our imaginations were the only stage where stories came to life, before there were movies or TVs or electronic devices of any kind, every human culture connected the dots to form their own pictures.&lt;/p&gt;
&lt;p&gt;These images became the illustrations of a storybook that, on a deeper level, was also a survival manual. The names and personalities of the gods, heroes, farm animals, or familiar objects varied from culture to culture. But there was one particularly gorgeous group of stars known to the ancient Greeks and to us today as the Pleiades, a star cluster that formed about 100 million years ago (2.5 days on the Cosmic Calendar). Each of the stars in the Pleiades is some 40 times brighter than our Sun, and the brightest, Alcyone, outshines our Sun 1,000 times.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="pleiades.jpg" alt="An image of the Pleiades, a loose group of seven bright stars and a smattering of other stars. Each star is a bright blue, and between the stars are wispy tendrils of nebulosity."/&gt;
&lt;figcaption&gt;The Pleiades in Taurus&lt;br&gt;Digitized Sky Survey, 2004&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;For ages, the Pleiades have been used as an eye test for people all over the world. If you could see six of them, you were considered normal. If you saw more than seven, you were an ideal candidate for a warrior or scout.&lt;/p&gt;
&lt;p&gt;Among the ancient Celts and druids of the British Isles, the Pleiades were believed to have a haunting significance. On the night of the year that they reach the highest point in the sky at midnight, the spirits of the dead were thought to wander the Earth. This is believed to be the origin of the holiday once known as Samhain, now called Halloween.&lt;/p&gt;
&lt;p&gt;All over the Earth, our ancestors told wonderful stories to explain how the Pleiades came to be in the sky. For the Kiowa people of North America, it happened something like this.&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;Long, long ago, some young women snuck away from camp one night to dance freely beneath the stars. It wasn’t long before some bears discovered them and chased them through the wilderness. Eventually, the girls found a tall rock and climbed it. The girls begged the spirits in the rock to save them. The rock heard their cries and grew taller until it became what is today known as Devils Tower. The maidens were transformed into the stars of the Pleiades, which may be seen hanging above the tower in mid-winter.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The ancient Greeks also saw those seven jewels as seven maidens, the seven daughters of Atlas, pursued not by bears, but by Orion the hunter, who spied them while out walking one day. Orion became mad with desire and chased them relentlessly. Exhausted, the maidens prayed to Zeus for deliverance. Zeus felt sorry for them and transformed those seven maidens into the Pleiades. But the gods are, if anything, capricious. When Orion was killed by the sting of a scorpion, Zeus placed him the sky where he could resume his pursuit of the seven gorgeous sisters.&lt;/p&gt;
&lt;p&gt;Our ancestors wove brilliantly imaginative stories, but they can bring us no closer to the stars than our dreams. It took yet another few thousand years until three scientists unlocked the true lives of stars.&lt;/p&gt;
&lt;p&gt;In 1901, Harvard University was a man’s world, but astronomer Edward Pickering broke that rule. He assembled a team of women to map and classify the types of stars. One of them provided the key to our understanding of the substance of the stars. And another devised a way for us to calculate the size of the Universe. Outside of these talks, you’ve probably never heard of them. Wonder why.&lt;/p&gt;
&lt;p&gt;The leader of the team was Annie Jump Cannon. Before she was through, she cataloged a quarter of a million stars. Cannon was also deaf; she lost her hearing during a bout of scarlet fever when she was a young woman. Another teammate was Henrietta Swan Leavitt who was also deaf. She discovered a law we’ve talked about that astronomers still use more than a century later to measure the distances to the stars and the size of the cosmos itself.&lt;/p&gt;
&lt;p&gt;Annie Jump Cannon sent out a Christmas card in 1915 explaining what she and her teammates were doing:&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&amp;ldquo;The light from the star is allowed to fall through a prism placed in the telescope and, thus magnified, is split up into a band showing its component colors, the red rays going to one end, and the violet to the other. This is the spectrum of the star. The photograph does not show the colors, but, what is more important, it does show the presence of fine dark lines, few in some spectra and numerous in others. These wonderful dark lines have become a veritable happy hunting ground for the modern astronomer. By comparing them with lines given by glowing substances in his own laboratory, he can also determine that the same elements familiar to us on the earth also exist in the outermost star.&amp;rdquo; &lt;br&gt;&amp;ndash;Annie Jump Cannon, 1915&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It took Cannon decades to classify the spectral character of hundreds of thousands of stars according to the scheme that she devised. Cannon discovered that the stars fell into a continuous sequence of seven broad categories according to their spectral line patterns, OBAFGKM. But the spectral lines of two stars in the same class could differ in subtle ways, minute variations that Cannon learned to recognize from memory. To distinguish these spectra from one another, she assigned ten numerical subcategories for each class, 0-9. Our Sun is a G2 star. Annie Jump Cannon organized the stars, but it would fall to another scientist to decipher the hidden meaning of her work.&lt;/p&gt;
&lt;p&gt;In the England of 1923, women were forbidden from pursuing advanced degrees in science. But Cecilia Payne had attended a lecture in London by the astronomer Sir Arthur Eddington, the first scientist to provide evidence that Einstein’s Theory of General Relativity was correct. From that moment on, she knew that nothing would deter her from pursuing her big dreams. She resolved to emigrate to America where women had already gained the freedom to study the stars. Payne applied to and was accepted to Harvard. What she would discover there would challenge one of the central beliefs of astronomy and be the start of modern astrophysics.&lt;/p&gt;
&lt;p&gt;As the decades passed, Annie Jump Cannon and her team kept sifting the stars, checking each one’s spectral signature with a fleeting glance and then dropping them into one of several categories. They became hundreds of thousands of dots in a larger picture which no one could understand.&lt;/p&gt;
&lt;p&gt;Into this community of women came Cecilia Payne and she experienced kindness in a setting that is often unkind to women. The sisterhood generously shared the fruits of their labor with her, and she turned their observations into a radical new understanding of the stars. Cannon taught Payne everything she had learned about stellar spectra, and Payne began to analyze Cannon’s data to see if she could determine the actual chemical and physical state of the stars. She brought to this work her expertise in theoretical and atomic physics.&lt;/p&gt;
&lt;p&gt;The most prominent features in the spectra of stars showed the presence of heavy elements such as calcium and iron, which are among the most abundant elements in the Earth. Astronomers naturally concluded that the stars were made of the same elements as the Earth and in roughly the same proportions. Among these astronomers was Henry Norris Russell who was also Payne’s thesis advisor.&lt;/p&gt;
&lt;p&gt;When Payne was working on her thesis, she realized that Cannon’s classification scheme was actually telling her what temperature the star is. Furthermore, she discovered that stars are made almost entirely of hydrogen and helium. There’s a million times more hydrogen and helium than the metals in the stars. Payne said as much in her thesis which she handed in to Russell.&lt;/p&gt;
&lt;p&gt;Russell felt sorry for Payne. Her thesis appeared to him to be fundamentally flawed. It is &lt;em&gt;clearly&lt;/em&gt; impossible that hydrogen should be a million times more abundance than the metals. Her carefully gathered evidence flew in the face of conventional scientific wisdom. Despite her confidence in the quality of her research, she caved and added a sentence to her thesis that undermined its greatest insight:&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&amp;ldquo;The outstanding discrepancies between the astrophysical and terrestrial abundances are displayed for hydrogen and helium. The enormous abundance derived for these elements in the stellar atmosphere &lt;em&gt;is almost certainly not real.&lt;/em&gt;&amp;rdquo; &lt;br&gt;&amp;ndash;Cecilia Payne, &lt;em&gt;&amp;ldquo;Stellar Atmospheres,&amp;rdquo;&lt;/em&gt; 1925&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It would be four years before Russell realized that Payne was right. To his credit, as soon as he did, he acknowledged that it was her discovery. Payne’s thesis is widely regarded as the most brilliant PhD thesis ever written in astronomy. It became the standard text in its field. Cecilia Payne’s interpretation of Annie Jump Cannon’s sequence of stellar spectra made it possible for us to read the life stories of the stars and to trace the story of life itself back to its beginnings in their fiery deaths.&lt;/p&gt;
&lt;p&gt;Now, I tell you that story because I want to illustrate my view of the Universe, what I see when I look up into the night sky. There’s that semi-famous quote from Neil deGrasse Tyson, “I look up at the night sky, and I know that, yes, we are part of this Universe, we are in this Universe, but perhaps more important than both of those facts is that the Universe is in us. When I reflect on that fact, I look up—many people feel small, because they’re small and the Universe is big, but I feel big, because my atoms came from those stars.” That is a great thought to have and it certainly helps with settling some existential fears people might have.&lt;/p&gt;
&lt;p&gt;However, I take a different approach, a more humanistic approach. When I look up at the night sky, I see the constellations, the planets, the stars, but I also see the many men and women who have worked to uncover the truths of those objects. I see Annie Jump Cannon at her desk at Harvard pouring over thousands of photographic plates to bring a sense of order to the countless stars. I see Cecilia Payne tirelessly working on a thesis she knows is right but one that flies in the face of conventional wisdom.&lt;/p&gt;
&lt;p&gt;And I didn’t have to tell you their stories tonight. There are hundreds of other stories like theirs that I see. I see Ptolemy working in vain to make the planets orbit on perfect circles. I see Kepler figuring out for the first time that those orbits are actually ellipses. I see Shapley and Curtis arguing over the nature of spiral nebulae and Hubble coming along and telling us that not only is the Universe bigger than we believed, it is weirder than we believed. I see Vera Rubin discovering dark matter, I see Jocelyn Bell Burnell discovering pulsars. Einstein, Newton, Galileo, Halley, Chandrasekhar, Eddington, Herschel, Leavitt, and countless nameless others. “If I have seen further it is by standing on the shoulders of giants.”&lt;/p&gt;
&lt;p&gt;I can see further because these people, each with their own stories, have longed to make sense of the Universe, to make sense of objects they can never touch, taste, smell, or hear but only look up at and dream. And in return, they have given us their knowledge, yes, but have also given us their dreams and stories. So when I look up at the night sky, I feel big because I see the countless thousands of people who have come before me and wondered the very same things than I wonder.&lt;/p&gt;
&lt;p&gt;And although we have been concerned with the science these past several weeks, I hope that I have instilled in each of you that astronomy isn’t just a branch of science, it is also a way to tell the human story.&lt;/p&gt;
&lt;p&gt;Tonight, I want to end by telling you one last story. The longest odyssey of all history was launched back in 1977, NASA’s &lt;em&gt;Voyager 1&lt;/em&gt; and &lt;em&gt;2&lt;/em&gt; missions. They gave us our first close-up look at Jupiter’s Great Red Spot, and discovered the first active volcano on another world, on the moon Io, and an ocean beneath the icy surface of the moon Europa with at least twice as much water as we have here on Earth. The &lt;em&gt;Voyagers&lt;/em&gt; dared to fly across Saturn’s rings and revealed that they were made of hundreds of thin bands of orbiting snowballs. &lt;em&gt;Voyager 2&lt;/em&gt; gave us our first portrait of the outermost planet, Neptune, where winds roar at 1000 miles per hour. &lt;em&gt;Voyager&lt;/em&gt; successfully completed its mission of discovery to the outer planets, but its odyssey was just beginning as they breached the uncharted waters of interstellar space.&lt;/p&gt;
&lt;p&gt;Twenty-six centuries ago, the Assyrian king Esarhaddon wrote&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&amp;ldquo;I had monuments made of bronze and inscriptions of baked clay.
I left them in the foundations for future times.&amp;rdquo; &lt;br&gt;&amp;ndash;Esarhaddon, 7th century BCE&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Carl Sagan similarly recognized that the &lt;em&gt;Voyager&lt;/em&gt; mission offered two free tickets to something approaching eternity. He assembled a small team to create a message to any civilization that might, one day, encounter the derelict spacecraft.&lt;/p&gt;
&lt;p&gt;And what did they come up with? A golden record with a projected shelf life of a billion years. Become an extraterrestrial archaeologist for a few moments. An artifact has been fished out of the interstellar ocean. It was made by beings that lived about a billion years ago. What would you make of them and their world? They’ve sent us their music and greetings in 59 human languages. And one whale language. And a sound essay that includes a Saturn V rocket launch, a mother’s first words to her newborn baby, and the sound of a pulsar.&lt;/p&gt;
&lt;p&gt;In and amongst the usual suspects of Bach, Beethoven, and Mozart is an odd little tune, recorded in 1927 by a Texan preacher and street-corner blues singer, Blind Willie Johnson. Born in 1897, he knew from a young age that he wanted to be a preacher. He did not falter in his devotion to God and what he felt was his calling, despite being blinded when his stepmother threw lye in his face for his father’s infidelities.&lt;/p&gt;
&lt;p&gt;Johnson made money playing music on the street and was eventually found by a field unit of Columbia Records. Between 1927 and 1930, Johnson recorded 30 titles for Columbia for which he was probably paid $25-$30 per song. Although he was successful for a time, when the Great Depression hit, Johnson found himself playing music on the street for money again. He did in 1945 at the age of 48 from pneumonia which he got from sleeping in the wet remains of his burned down home.&lt;/p&gt;
&lt;p&gt;That song that Sagan and his team picked? A hymn,
a wordless melody consisting only of Johnson’s slide guitar and his resonant, gospelly, moaning hum. Sagan picked it because “Johnson’s song concerns a situation he, and humanity, have faced many times: nightfall with no place to sleep.”&lt;/p&gt;
&lt;p&gt;What can we say about the far off future the &lt;em&gt;Voyager&lt;/em&gt; spacecraft will find themselves in? The only thing we can say is that something of who we were and the music that represents us, that we made in that long ago spring, will live on. And the human story will live on through the song of a blind man who could only dream of laying down at night and looking up at the stars.&lt;/p&gt;</description></item><item><title>Life on Venus?</title><link>https://astronoraygarner.com/blog/life_on_venus/</link><pubDate>Tue, 22 Sep 2020 00:00:00 +0000</pubDate><guid>https://astronoraygarner.com/blog/life_on_venus/</guid><description>&lt;p&gt;This year,
about the detection of phosphine in the cloud decks of Venus. Immediately, science news writers were screaming, “LIFE DETECTED ON VENUS!!!!” I promise you, that was not the case, but it is definitely interesting in and of itself and might point towards more observations required for us to definitively say that we’ve detected life on Venus. Let’s talk about that.&lt;/p&gt;
&lt;h2 id="a-refresher-on-venus"&gt;A Refresher on Venus&lt;/h2&gt;
&lt;p&gt;First, let’s bring everyone up to speed about Venus. Venus, named after the Roman goddess of beauty and nicknamed &amp;ldquo;Earth’s twin,&amp;rdquo; is the second planet from the Sun. It resides at an average distance of 0.72 AU (an AU, or astronomical unit, is the average distance between the Earth and the Sun, about 93,000,000 miles) and completes an orbit every ~225 days. It has the most circular orbit of all the planets.&lt;/p&gt;
&lt;p&gt;However, that’s probably the most normal thing about it. Most planets orbit the Sun in a counterclockwise direction if you are looking at them from above the Earth’s North Pole. And Venus does that! Furthermore, most planets also rotate on their axis in the same counterclockwise direction. There are two major exceptions to that rule: Uranus, which is tilted more than 90 degrees on its side, so it looks like it tumbles around the Sun, and, you guessed it, Venus. Long ago during the formation of the Solar System, scientists think that Venus was smacked by a large body, causing Venus to flip over entirely. Since then, Venus has rotated clockwise, opposite to its orbit direction. What’s more is that it rotates so slow (~243 days) that its day is longer than its year!&lt;/p&gt;
&lt;p&gt;The surface of Venus is also very weird. It is obscured by constant cloud cover, so the only information we have about the surface came from the few minutes artificial landers have survived and radar imaging from orbit. Most of Venus is covered in &amp;ldquo;deposition plains,&amp;rdquo; giant flat plains of lava rock. This is broken up here and there by a few craters. However, when you compare the number and age of the craters on Venus to other places in the Solar System, like the Moon or Mars, Venus has very few craters. It looks like the thick atmosphere burns up all the small meteorites before they reach the ground, but what about the large meteorites?&lt;/p&gt;
&lt;p&gt;Scientists were confused about that too, but they came up with a theory. They hypothesize that Venus goes through periodic &amp;ldquo;global resurfacing events.&amp;rdquo; In this event, pressure from magma and trapped gases builds up underneath the surface. This happens on Earth too, but the Earth has cracks in its crust in the form of fault lines between tectonic plates for the pressure to escape through. But Venus has no tectonic activity, so no fault lines to let out that pressure. The pressure builds up, builds up, builds up until the surface can’t hold back anymore and the entire surface explodes, covering itself in lava. This erases the presence of any old craters, making the surface look young again.&lt;/p&gt;
&lt;p&gt;As if that wasn’t enough, let’s look at the atmosphere now. The thick atmosphere of Venus is primarily carbon dioxide with some nitrogen and other trace gases. Those trace gases include fun compounds like hydrochloric acid, hydrofluoric acid, carbon monoxide, sulfuric acid, hydrogen sulfide, phosphorous acid, and phosphoric acid. Fun stuff!&lt;/p&gt;
&lt;p&gt;Near the surface, the weight of all that atmosphere above it makes the surface pressure equivalent to 92 times that the Earth’s surface! To experience that on Earth, you’d have to be 5.5 miles deep in the ocean.&lt;/p&gt;
&lt;p&gt;Adding to the crushing pressures is the excruciatingly hot temperatures. Thanks to all that carbon dioxide and sulfur dioxide in the atmosphere, Venus has a runaway greenhouse effect. This raises the temperature at the surface to a scorching 873°F! This makes it hotter than Mercury, the closest planet to the Sun. If you were on Venus and held a frozen pizza outside in your hand, it would cook in three minutes. Admittedly, it would also melt from the raining sulfuric acid, but it’d be cooked!&lt;/p&gt;
&lt;h2 id="the-detection"&gt;The Detection&lt;/h2&gt;
&lt;p&gt;And yet, among all that hell, there exists a part of its atmosphere that is just right. This Goldilocks zone is 30-37 miles above the surface at a balmy temperature of 140°F and a pressure of about 1 Earth atmosphere. A little too hot for humans, but there are plenty of microbes on Earth that can survive that sort of temperature and pressure.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="venus_atmosphere.png" alt="A plot/schematic of Venus' atmosphere. On the left vertical axis is altitude in kilometers stretching from 0 to 100 kilometers. On the right, there are two vertical axes: the leftmost axis is temperature in degrees Celsius from 800 degrees to -100 degrees; the rightmost axis is pressure in bars from 45 bars to one-ten-thousandth of a bar. An illustration of Venus is in the main plot, with different zones marked out. There is a surface haze at the bottom, above it is a lower haze level, then a middle and lower cloud level, then an upper cloud level, and then an upper haze level. The authors have marked the middle and lower cloud level as the temperate zone, between altitudes of 48 to 60 kilometers, temperatures of around 60 degrees Celsius, and pressure of about 1 bar."/&gt;
&lt;figcaption&gt;A schematic of Venus' atmosphere. Note the temperate zone at an altitude of 48-60 km (30-37 miles), temperature of ~60&amp;deg;C (140&amp;deg;F), and pressure of ~1 bar (1 Earth atmosphere). Fig 1 of &lt;a href=https://ui.adsabs.harvard.edu/abs/2020arXiv200906499B/abstract&gt;Bains et al. (2020)&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is where we join the story of the detection of phosphine on Venus. Jane S. Greaves (Cardiff University) and her collaborators had the goal of using Venus as a benchmark for other studies. They hadn’t set out to specifically detect phosphine, yet, when they looked at it through their telescopes, they found something!&lt;/p&gt;
&lt;p&gt;They originally used the
, a submillimeter telescope, to probe the atmosphere of Venus. When you hear the word &amp;ldquo;telescope&amp;rdquo; here, don’t think of a tube used by Galileo or Hubble or pirates. Think more along the lines of a giant radio dish. This Hawai&amp;rsquo;i-based telescope has been designed to see light in the infrared, specifically light with a wavelength between a few 100 micrometers to a millimeter.&lt;/p&gt;
&lt;p&gt;When they analyzed the data they got from the JCMT, they found the signature of phosphine in their data! However, their signal was weak and they needed to confirm that it was actually phosphine and not some random noise or some other molecule pretending to be what its not.&lt;/p&gt;
&lt;p&gt;They used their initial detection to get some time on the
, a much better telescope for the job. Once again, this is not a telescope in the traditional sense, but actually 50 40ft radio dishes high up in the Atacama Desert in Chile.&lt;/p&gt;
&lt;p&gt;When they peered through the 50 eyes of ALMA, they got an even stronger detection of phosphine! This was no coincidence! Furthermore, it was detected right in the temperate zone of Venus’ atmosphere, about 33-38 miles up!&lt;/p&gt;
&lt;p&gt;Now, what is this phosphine? Phosphine is a molecule, a single phosphorus atom that has three hydrogen atoms attached to it. It is an odorless, colorless, and, like everything else on Venus, highly toxic gas. It easily burns with oxygen to produce phosphoric acid, highly corrosive in large quantities, but safe enough in small quantities to find it in your toothpaste and soaps.&lt;/p&gt;
&lt;p&gt;We have found phosphine in three places in the Solar System: Jupiter, Saturn, and Earth. On Jupiter and Saturn, the chemical compositions, as well as the temperatures and pressures, are just right that phosphine is naturally produced in abundance. It is energetically favored to be produced. Meanwhile, on Earth, we know of only two things that produce phosphine: microbes and human industrial activity. For that reason, it has often been listed as a biosignature, a chemical that is a good indicator for the presence of life on other planets.&lt;/p&gt;
&lt;h2 id="ruling-out-the-implausible"&gt;Ruling Out the Implausible&lt;/h2&gt;
&lt;p&gt;It was now up to the authors of this paper to show whether or not this phosphine could be produced naturally on Venus or required the presence of life to be produced. Abundance modelling showed that phosphine was present in 20 parts per billion (ppb) amounts. Now, what can produce that amount?&lt;/p&gt;
&lt;p&gt;The authors of this paper were very thorough. They looked at every possible angle. Could energy of the Sun produce phosphine in the upper layers of the atmosphere? Nope, it would be destroyed too fast by that same solar energy. Maybe under certain conditions (temperatures, pressures, concentrations, etc.) phosphine could be spontaneously created? Turns out, its chemically unfavorable to do so; Venus would much rather form phosphoric acid and the like.&lt;/p&gt;
&lt;p&gt;The researchers looked at even more absurd ideas. Was phosphine delivered to Venus by meteorites? Nope, Venus is accreting the right type of meteorite about 100 million times too slow. It requires energy to make phosphine, right? What if Venusian lightning delivered that energy! It would take a solid year of lightning, with no destruction, to create measurable abundances, and even then, its 10 million times too low. They looked at more things like giant meteor impacts (nope), Venus-quakes (how?), volcanic eruptions (not happening), and on and on.&lt;/p&gt;
&lt;p&gt;Eventually, they came to the conclusion that either there is some sort of unknown chemistry happening on Venus or life is producing phosphine in measurable amounts.&lt;/p&gt;
&lt;p&gt;I personally want to stress that this does not mean that the scientists who wrote these papers and did the observations are saying they found proof of life existing in the clouds of Venus. They are very adamant that more research needs to be done. There is still plenty of information we are missing about the Venusian environment;
to plummet through the clouds and touch the surface of this alien world was in 1985. We also don’t know enough about phosphine and how it reacts biologically. More chemical research needs to be done as well.&lt;/p&gt;
&lt;h2 id="but-what-if-there-was"&gt;But, what if there was?&lt;/h2&gt;
&lt;p&gt;All that being said, let’s play the imaginative game and pretend there’s life on Venus. How could it survive?&lt;/p&gt;
&lt;p&gt;There are a few things we know it would have to do. First, it would have to survive in liquid droplets in the clouds; it could not survive just free-floating in the air. A free-floating cell would lose water until it matches the outside environment and on Venus, that environment is 10 times drier than the driest place on Earth. Bad news for a cell that needs water to survive!&lt;/p&gt;
&lt;p&gt;These cells would also have to evolve some way of dealing with all the sulfuric acid in the clouds. Some researchers have seen how extremophiles here on Earth can survive in very acidic, high temperature, low water environments and said, &amp;ldquo;Yeah, that could happen on Venus too!&amp;rdquo; I cannot stress this enough that that assumption is incorrect.&lt;/p&gt;
&lt;p&gt;The
has acidic pools of water at 225°F, that is hypersaline, containing hydrothermal vents as well as the lowest pH ever recorded: -1.7. The pH scale normally only goes down to zero; its not meant to go down to negative numbers. Here on Earth, this highly acidic environment has sulfuric acid dissolved in water. On Venus, the clouds are water dissolved in sulfuric acid, making it 100 billion times more acidic than the most acidic place on Earth. Life would have to find a way to survive that.&lt;/p&gt;
&lt;p&gt;The Venusian atmosphere is also extremely arid. The most arid place on Earth is Death Valley. On average, it has a humidity of about 2%. The Venusian atmosphere is equivalent to a humidity of ~0.07% at room temperature. This makes it extremely hard for cells to hold onto water.&lt;/p&gt;
&lt;p&gt;Microbes exist in the Earth’s atmosphere too. But they don’t live up there. They can rely on the fact that at some point, they will fall back to the ground to gain nutrients and reproduce. The surface of Venus is uninhabitable, even by microbes. They have to spend their entire life cycles up in the air, making gaining nutrients very hard.&lt;/p&gt;
&lt;p&gt;Gaining energy will be very hard too, but thankfully light is in abundance in the atmosphere. Most likely, Venusian life will have to be photosynthetic.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="life_cycle.png" alt="A plot/schematic of a proposed Venusian microbial life cycle. On the left is a vertical axis measuring altitude from 35 kilometers to 70 kilometers. On the right are two vertical axes: the leftmost measures temperature in degrees Celsius from 100 to -45 degrees; the rightmost measures pressure in bars where the entire plot is around 1 bar. In the schematics is a life cycle of microbes in five life stages."/&gt;
&lt;figcaption&gt;A proposed life cycle for Venusian life. (1) Dessicated spores persist in the lower atmosphere. (2) An updraft of spores transports them to the habitable layer. (3) Spores accumulate a liquid environment and become active. (4) Active microbes grow and reproduce. (5) Droplets rain out, while the microbes transform into spores again, resting in the lower atmosphere. Fig 1 of &lt;a href=https://www.liebertpub.com/doi/pdf/10.1089/ast.2020.2244&gt;Seager et al. (2021)&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;All that said, there is still the possibility of life on Venus. If Venusian life exists as a microbe that is able to reproduce in the clouds, and survive the extreme environment, then life is likely. One such suggestion by researchers is that life will take the form of a bacteria-like species that reproduces in the clouds, and, upon dropping to lower layers, transforms into spores that can survive down there until an updraft of wind brings them back into the temperate zone. But that’s just a theory.&lt;/p&gt;
&lt;h2 id="only-time-will-tell"&gt;Only Time Will Tell&lt;/h2&gt;
&lt;p&gt;Does life exist on Venus? Right now, we’re uncertain. We’ve certainly found an interesting detection in this phosphine measurement, but we really won’t know until NASA or some other space agency (I’m looking at you, Russians) sends a new mission there. This is an exciting time to be studying the planets of our solar system, so be sure to keep an eye out for more news from our sister planet!&lt;/p&gt;
&lt;figure&gt;
&lt;center&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/dfD0rfK6zuY" title="YouTube video player" frameborder="0", allow="acceleromter; autoplay; clipboard-write; encrypted-mdeia; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;figcaption&gt;This is a recording of the "Public Astronomy Talks with Ray" that I led about the discussion of life on Venus and the results from this paper on September 20, 2020.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;span style="font-size: 0.75em;"&gt;&lt;em&gt;I was also interviewed by the Case Western &lt;/em&gt;Observer&lt;em&gt; about this topic. If you&amp;rsquo;d like to read that article, click &lt;a href="https://observer.case.edu/mapping-the-secrets-of-life-within-our-sister-planet/"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>