GBTAmmoniaSurvey / GAS

observing scripts and files related to the GBT Ammonia Survey (GAS, PI: Jaime E Pineda & Rachel Friesen)
MIT License
6 stars 13 forks source link

Forward modeling of channel response #38

Open low-sky opened 9 years ago

low-sky commented 9 years ago

We need to decide if the channel response is important and adapt pyspeckit fitting accordingly.

jpinedaf commented 9 years ago

Do we need to create a special model within pyspeckit for each line we want to fit? Or, would it be better to add that as an option to the pyspeckit fitter itself? Adding Adam to the discussion @keflavich

keflavich commented 9 years ago

Could you clarify "channel response"? Do you mean, fractional sensitivity of each spectral channel? Or the more convoluted issue that channels have limited sensitivity to neighboring frequencies?

jpinedaf commented 9 years ago

Sure, I want to also take into account the spectral response, e.g. sinc(x), of the channels obtained that have some sensitivity to frequencies nearby. This is important to obtain a good velocity dispersion determination when we have quite narro lines.

In the IDL implementation what we used in the past (initially written by @low-sky ) was to oversample the spectra, then convolve with the sinc() function, and then sample everything back in the observed spectral channels.

On Wed, Jun 17, 2015 at 1:15 PM Adam Ginsburg notifications@github.com wrote:

Could you clarify "channel response"? Do you mean, fractional sensitivity of each spectral channel? Or the more convoluted issue that channels have limited sensitivity to neighboring frequencies?

— Reply to this email directly or view it on GitHub https://github.com/jpinedaf/GAS/issues/38#issuecomment-112758044.

keflavich commented 9 years ago

OK. I think, then, we could just incorporate a convolve(sinc) function into the ammonia model. Is the oversampling-then-downsampling step really necessary? @low-sky and I talked about this a few years ago, I think, but I don't recall the conclusion.

jpinedaf commented 9 years ago

I think that the problem arises from the observed spectra with sampling worst than Nyquist. I think that is why we need to oversample a bit before convolving.

On Wed, Jun 17, 2015 at 1:42 PM Adam Ginsburg notifications@github.com wrote:

OK. I think, then, we could just incorporate a convolve(sinc) function into the ammonia model. Is the oversampling-then-downsampling step really necessary? @low-sky https://github.com/low-sky and I talked about this a few years ago, I think, but I don't recall the conclusion.

— Reply to this email directly or view it on GitHub https://github.com/jpinedaf/GAS/issues/38#issuecomment-112763238.

jpinedaf commented 8 years ago

A good solution would be to use the convolved sinc and gaussian function in the line generating model, instead of the gaussian alone.

This function, http://math.stackexchange.com/questions/98176/convolution-of-gaussian-and-sinc-function, could be calculated just once and then used in all the line profile calculations.

Leaving this documented waiting for a hero to implement it in pyspeckit, or wait until I have some time (must be after release 1 of the data)

low-sky commented 8 years ago

Only in the optically thin case. If the profiles become thick, the exp(-tau) part of the function will make convolve then transfer not the same as transfer then convolve.

I bet the right route here is to just do the FT convolution after the model is generated. FTs of 1e3 elements aren't terribly expensive.

jpinedaf commented 8 years ago

Yes you are right!

On Thu, Jul 23, 2015 at 5:36 PM Erik Rosolowsky notifications@github.com wrote:

Only in the optically thin case. If the profiles become thick, the exp(-tau) part of the function will make convolve then transfer not the same as transfer then convolve.

I bet the right route here is to just do the FT convolution after the model is generated. FTs of 1e3 elements aren't terribly expensive.

— Reply to this email directly or view it on GitHub https://github.com/GBTAmmoniaSurvey/GAS/issues/38#issuecomment-124142634 .

keflavich commented 8 years ago

@low-sky: they can be pretty expensive when you're doing 1000's of them, which is expected when running lmfit. Still, we should try it.

low-sky commented 8 years ago

Maybe a two stage fitting then: without convolution and then with once most of the other parameters are well constrained?

keflavich commented 8 years ago

That's a good idea - we should already have the Gaussian-derived parameter maps to use as input guesses at that stage.

jpinedaf commented 8 years ago

+1 On Do., 23. Juli 2015 at 18:27 Adam Ginsburg notifications@github.com wrote:

That's a good idea - we should already have the Gaussian-derived parameter maps to use as input guesses at that stage.

— Reply to this email directly or view it on GitHub https://github.com/GBTAmmoniaSurvey/GAS/issues/38#issuecomment-124159811 .