jkrogager / VoigtFit

Python code to fit absorption lines semi-interactively
http://voigtfit.readthedocs.io/
MIT License
28 stars 12 forks source link

nsub #41

Closed nimishak-cosmos closed 3 years ago

nimishak-cosmos commented 3 years ago

Hi, I had smoothed dataset using boxcar smoothing over 18 pixels. I think that we should use nsub=1 because boxcar smoothing keeps the same pixel sampling as it was before smoothing. However, when I run the Voigtfit code on this smoothed spectrum putting either nsub=1 or nsub=18, the output column densities from both nsub values agree within uncertainties. It seems a bit strange that nsub values don't affect the output. Do you have thoughts on this?

jkrogager commented 3 years ago

The 'nsub' keyword is only used when specifying a tabulated LSF file. Here it describes the relative sampling of the tabulated LSF with respect to the data. If you're giving the resolution as a fixed number, then the code determines the sampling from your data and 'nsub' is ignored. Hence, the best-fit does not depend on 'nsub'. A side note: you should be careful fitting spectra that are so heavily smoothed, you can easily "wash away" a lot of physics. It's always better to keep the data as is when fitting. For visual purposes you can then re-bin or smooth, but it's generally better to analyze spectra that have been manipulated the least.

nimishak-cosmos commented 3 years ago

I am using a tabulated LSF.

jkrogager commented 3 years ago

Are you fitting a damped or very broad absorption line?

nimishak-cosmos commented 3 years ago

It's a damped Ly-alpha absorber.

jkrogager commented 3 years ago

In this case, the column density is determined by the damping wings of the profile, which are much wider than the resolution element. Hence, for damped lines, the column density is usually not sensitive to the resolution, unless you have very high signal to noise and trust the edges of the core where you might see small differences due to b-parameter and resolution. But this will have a very minor effect of log(N).