Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@keflavich
Copy link
Collaborator

Optically thin fit does not reproduce N2H+(1-0) hyperfine structure and returns too high T_ex (e+11) and sigma, two times bigger than a real value (calculated with CLASS or optically thick approach).
The criterion we use to decide which fit results to use, optically thin or thick, is tau/delta_tau>=3. Most of N2H+(1-0) spectra will pass this criterion, however there are points on the edges of the cores where N2H+ line is not strong enough so we need optically thin approach.
I've checked some of such points and optically thin fit does not give good result, please see the thin and thick fits of the same spectrum in the attached figures. The spectrum used to produce the figures is here https://github.com/Punanova/thick_vs_thin/blob/master/73-core2_N2Hp.fits

n2hp_pyspeckit_poor_thin_fit
n2hp_pyspeckit_poor_thick_fit

.

@jpinedaf
Copy link
Contributor

jpinedaf commented Dec 9, 2015

this is the code to reproduce the problem:

import pyspeckit
from pyspeckit.spectrum.models import n2hp
import numpy as np
import astropy.units as u

cube = pyspeckit.Spectrum('73-core2_N2Hp.fits')
rms=0.046
cube.error[:] = rms
cube.xarr.refX = 93173.772e6*u.Hz
cube.xarr.velocity_convention = 'radio'
cube.xarr.convert_to_unit('km/s')
F=False
T=True
import matplotlib.pyplot as plt
plt.ion()
cube.Registry.add_fitter('n2hp_vtau', pyspeckit.models.n2hp.n2hp_vtau_fitter,4)
cube.specfit(fittype='n2hp_vtau', guesses=[3.94, 0.1, 0, 0.309], 
    verbose_level=4, signal_cut=3, limitedmax=[F,T,T,T], limitedmin=[T,T,T,T], 
    minpars=[0, 0, -1, 0.05], maxpars=[30.,50.,1,1.0], fixed=[F,T,F,F])
cube.plotter(errstyle='fill')
cube.specfit.plot_fit()
plt.savefig('N2Hp_pyspeckit_fit.png')

Only to complement the information, usually the optically thin model is used when $\sigma_\tau/\tau>1/3$, that is the reason to use the optically thin model which fixes $\tau=0.1$.

@keflavich
Copy link
Collaborator

OK, that's pretty strange. I will investigate.

@keflavich
Copy link
Collaborator

This is a very serious issue that will trigger a new bugfix release today (after having released only a few hours ago...): when @jpinedaf was here last, we corrected the RJ-assumption RT equation to use the full Planck function, but there was a typo.

@jpinedaf
Copy link
Contributor

jpinedaf commented Dec 9, 2015

sorry that I didn't see that one!

@jpinedaf
Copy link
Contributor

jpinedaf commented Dec 9, 2015

This change does fix the issue! Thanks a lot @keflavich

n2hp_pyspeckit_poor_thick_fit
n2hp_pyspeckit_poor_thin_fit

@Punanova
Copy link
Author

Punanova commented Dec 9, 2015

Great! Thank you @keflavich!

keflavich added a commit that referenced this pull request Dec 10, 2015
Poor optically thin N2H+(1-0) fit
@keflavich keflavich merged commit 482235c into pyspeckit:master Dec 10, 2015
@keflavich keflavich deleted the issue125 branch December 10, 2015 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants