Skip to content

Commit

Permalink
Fix NIRISS post pipeline 03 (#256)
Browse files Browse the repository at this point in the history
* fix notebook 03, fit lines

* removed not needed imports

---------

Co-authored-by: Camilla Pacifici <[email protected]>
  • Loading branch information
2 people authored and gibsongreen committed Nov 8, 2024
1 parent 7a2656a commit cde6ae0
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,18 +428,18 @@
"spectrum_cut = Spectrum1D(flux=line_2d[yy, :][con]*spec_unit,\n",
" spectral_axis=wave_2d[yy, :][con]*u.um)\n",
"\n",
"# !!! Some tweaks may be needed for initial value, to successfuully run the fit;\n",
"# !!! Some tweaks may be needed for initial value, to successfully run the fit;\n",
"\n",
"# For Hb\n",
"g1_init = models.Gaussian1D(amplitude=40*spec_unit, mean=1.5*u.um, stddev=0.005*u.um)\n",
"g1_init = models.Gaussian1D(amplitude=100*spec_unit, mean=1.51*u.um, stddev=0.009*u.um)\n",
"\n",
"# For O3 blue\n",
"g2_init = models.Gaussian1D(amplitude=50.*spec_unit, mean=1.535*u.um, stddev=0.002*u.um)\n",
"g2_init = models.Gaussian1D(amplitude=80.*spec_unit, mean=1.53*u.um, stddev=0.006*u.um)\n",
"\n",
"# For O3 red\n",
"g3_init = models.Gaussian1D(amplitude=45.*spec_unit, mean=1.55*u.um, stddev=0.001*u.um)\n",
"g3_init = models.Gaussian1D(amplitude=200.*spec_unit, mean=1.55*u.um, stddev=0.006*u.um)\n",
"\n",
"g123_fit = fit_lines(spectrum_cut, g1_init+g2_init+g3_init, window=[0.01*u.um, 0.001*u.um, 0.001*u.um])\n",
"g123_fit = fit_lines(spectrum_cut, g1_init+g2_init+g3_init)\n",
"y_fit = g123_fit(wave_2d[yy, :]*u.um)\n",
"\n",
"print(g123_fit)"
Expand Down Expand Up @@ -515,12 +515,12 @@
" # !!! Some tweaks may be needed for initial value, to successfuully run the fit;\n",
"\n",
" # For Hb\n",
" g1_init = models.Gaussian1D(amplitude=40*spec_unit, mean=1.5*u.um, stddev=0.005*u.um)\n",
" g1_init = models.Gaussian1D(amplitude=100*spec_unit, mean=1.51*u.um, stddev=0.009*u.um)\n",
" # For O3 blue\n",
" g2_init = models.Gaussian1D(amplitude=50.*spec_unit, mean=1.535*u.um, stddev=0.002*u.um)\n",
" g2_init = models.Gaussian1D(amplitude=80.*spec_unit, mean=1.53*u.um, stddev=0.006*u.um)\n",
" # For O3 red\n",
" g3_init = models.Gaussian1D(amplitude=45.*spec_unit, mean=1.55*u.um, stddev=0.001*u.um)\n",
" g123_fit = fit_lines(spectrum_cut, g1_init+g2_init+g3_init, window=[0.01*u.um, 0.001*u.um, 0.001*u.um])\n",
" g3_init = models.Gaussian1D(amplitude=200.*spec_unit, mean=1.55*u.um, stddev=0.006*u.um)\n",
" g123_fit = fit_lines(spectrum_cut, g1_init+g2_init+g3_init)\n",
" y_fit = g123_fit(wave_2d[yy, :]*u.um)\n",
"\n",
" # This has to be done at each y pixel, as wavelength array can be tilted.\n",
Expand Down Expand Up @@ -593,7 +593,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cde6ae0

Please sign in to comment.