Skip to content

Commit

Permalink
Merge pull request #11 from KIPAC/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
eacharles authored Jul 30, 2021
2 parents c403adb + fb315f5 commit 53dd05d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions nb/06_01_Optimizing_a_fit_and_how_to_do_it_wrong.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
"\n",
"First we are going to invoke the minimzer in the next cell.\n",
"\n",
"It is worth spending a bit of time thinking about that it is doing.\n",
"It is worth spending a bit of time thinking about what it is doing.\n",
"\n",
"Note that we pass to things to the minimizer:\n",
"Note that we pass two things to the minimizer:\n",
" 1. the cost_function (you might not have explicitly noticed this before, but we can pass functions to other functions, that is a pretty common thing in many programming languages.)\n",
" 2. an initial guess as to the parameter values. In this case we will start with (0., 0.), i.e., slope and offset are both zero.\n",
" \n",
Expand Down Expand Up @@ -256,7 +256,7 @@
"\n",
"1.2 To make the colormap we had to do a double loop over a grid of points for the parameters $p_0$ and $p_1$. The grid was 51x51, for a total of 2601 points, meaning we had to evaluate the cost function 2601 times. Since we were using a simple example, it was fast. But imagine that we had many, many more data points, so that it took one second to evaluate the cost function each time. In that case it would have taken almost 45 minutes to evaluate the cost function. By comparison the fitter only makes 18 calls to the cost function to find the minimum. In your judgement, when would you stop bothering with making the color map and just rely on the fitter?\n",
"\n",
"1.3 In this example we only had 2 parameters, imagine instead that we had 3 or 4 parameters, how would that affect the time it took to evaluate the cost function on a grid over all the parameters. At what point do you think it would start to be unfeasible to use the gridded method?\n"
"1.3 In this example we only had 2 parameters; imagine instead that we had 3 or 4 parameters. How would that affect the time it took to evaluate the cost function on a grid over all the parameters? At what point do you think it would start to be unfeasible to use the gridded method?\n"
]
},
{
Expand Down Expand Up @@ -302,11 +302,11 @@
"source": [
"# Correlation between model parameters.\n",
"\n",
"Last week some of you commented that move the x-axis so that t=0 was in the middle of 2014 seemed a bit strange.\n",
"Last week some of you commented that moving the x-axis so that t=0 was in the middle of 2014 seemed a bit strange.\n",
"\n",
"There was actually a very good reason to do that, which we will examine now. It has to do with the other thing (besides fitting) that we studied last week, namely correlations.\n",
"\n",
"So, Fermi actually launched in 2008. So we could set t=0 to be in January 2008."
"Fermi actually launched in 2008, so we could set t=0 to be in January 2008."
]
},
{
Expand Down
16 changes: 8 additions & 8 deletions nb/06_02_SDSS_Spectra.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
"source": [
"# Sloan Digital Sky Survey\n",
"\n",
"The Sloan Digital Sky Survery ([Project page](https://www.sdss.org/), [Wikipedia](https://en.wikipedia.org/wiki/Sloan_Digital_Sky_Survey)) truly changed we way the understand the universe. \n",
"The Sloan Digital Sky Survey ([Project page](https://www.sdss.org/), [Wikipedia](https://en.wikipedia.org/wiki/Sloan_Digital_Sky_Survey)) truly changed the way we understand the universe. \n",
"\n",
"Over the course of 20 years, SDSS observed 35% of the sky and cataloged about 1 billion stars and galaxies.\n",
"Over the course of 20 years, SDSS observed 35% of the sky and catalogued about 1 billion stars and galaxies.\n",
"\n",
"It addition to taking images of such a large part of the sky, SDSS also measure the spectrum of the light from over 4 million objects. \n",
"It addition to taking images of such a large part of the sky, SDSS also measures the spectrum of the light from over 4 million objects. \n",
"\n",
"The spectra are obtained by feeding an individual optical fiber for each target through a hole drilled in an aluminum plate. The light from the fiber is then passed into a diffraction grating to seperate out the different wavelength so that the spectrum for that target can be measured. The diffracted light was then directed to an array of sensors, so that each sensor measured the amount of light at a different wavelenght.\n",
"The spectra are obtained by feeding an individual optical fiber for each target through a hole drilled in an aluminum plate. The light from the fiber is then passed into a diffraction grating to seperate out the different wavelength so that the spectrum for that target can be measured. The diffracted light was then directed to an array of sensors, so that each sensor measured the amount of light at a different wavelength.\n",
"\n",
"Each hole is positioned specifically for a selected target, so every field in which spectra are to be acquired requires a unique plate. In spectroscopic mode, the telescope tracks the sky in the standard way, keeping the objects focused on their corresponding fiber tips. \n",
"\n",
"Here is a picture of one such aluminum plate:\n",
"\n",
"![SDSS plug plate](figures/plate-sdss.jpg)\n",
"\n",
"We are going to be looking at the data from one fiber, for one plate. \n",
"We are going to be looking at the data from one fiber for one plate. \n",
"\n",
"By comparing the wavelength of atomic emission lines observed from our target to the known wavelengths of those lines we can measure the doppler shift of the light from that target."
]
Expand Down Expand Up @@ -66,7 +66,7 @@
"source": [
"FWIW, the \"flux\" is actually the amount of energy arriving in a narrow wavelength band, per area, per time, and is given in units of $\\frac{{\\rm erg}}{{\\rm cm}^{2}s^{1}{{\\rm angstrom}}^{1}}$. \n",
"\n",
"Rather that write that out again and again, let's call those \"arcane units\".\n",
"Rather than write that out again and again, let's call those \"arcane units\".\n",
"\n",
"In short you can think of it as the amount of energy coming in from light of a given wavelength."
]
Expand Down Expand Up @@ -132,7 +132,7 @@
"\n",
"$1 {\\rm pc} = 3.26 {\\rm ly}$.\n",
"\n",
"Note that this computation leaves out some subtlties, like what we mean by \"how far away\", as in \"how far away when the light was emitted?\" or \"how far away right now?\", and that isn't even getting into the issues that come up when we consider relativity or the acceleration of the Universe.\n",
"Note that this computation leaves out some subtleties, like what we mean by \"how far away\", as in \"how far away when the light was emitted?\" or \"how far away right now?\", and that isn't even getting into the issues that come up when we consider relativity or the acceleration of the Universe.\n",
"\n",
"But anyway, at least it gives you a distance scale to think about.\n",
"\n",
Expand Down Expand Up @@ -468,7 +468,7 @@
"source": [
"# Questions for discussion\n",
"\n",
"6.1 How would you interpret the fit result? Do the parameters make sense? What might have happened? Don't worry if you aren't sure. Just guess."
"6.1 How would you interpret the fit result? Do the parameters make sense? What might have happened? Don't worry if you aren't sure; just guess."
]
},
{
Expand Down

0 comments on commit 53dd05d

Please sign in to comment.