Samreay / Marz

The Marz redshifting program is intended for use in cosmology surveys, specifically for the OzDES team.
17 stars 18 forks source link

Additional templates #151

Open mxhf opened 2 years ago

mxhf commented 2 years ago

Hi,

I tried to ass a template for lyman alpha emitters. My approach was probably very naive, I doublicated the Quasar and replaced the spectrum by a simple gaussian.

But this does not seem to work, the cross correlation function does not show a peak at the correct wavelength and consequently the fitting fails.

Any idea how to fix this?

(please find my modified templates.js attached)

Max templates.js.gz

Samreay commented 2 years ago

Hi Max, the template looks good, does it display correctly in the UI and its just the xcor which gives weird results?

mxhf commented 2 years ago

Hi Samreay, thats right. Looks fine, only completely fails to fit. Neither globally nor locally. I guess thats to be expected of the xcor is off?

Samreay commented 2 years ago

Hmm, everything looks right. Are you able to send me a fits file and point to your fork of Marz and Ill see if I have any ideas when playing with it in person?

mxhf commented 2 years ago

Dear Samuel,

very gladly of course! Note that there is more than LAE in this file.

BTW (maybe related), is there some readme in the meanings of the columns in the fits table?

Max

On Thu, Mar 31, 2022 at 1:41 AM Samuel Hinton @.***> wrote:

Hmm, everything looks right. Are you able to send me a fits file and point to your fork of Marz and Ill see if I have any ideas when playing with it in person?

— Reply to this email directly, view it on GitHub https://github.com/Samreay/Marz/issues/151#issuecomment-1083781821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2AZSVACHGTRWGEYEC6UUDVCTRDNANCNFSM5RUM6TUA . You are receiving this because you authored the thread.Message ID: @.***>

--

Maximilian Fabricius

mxhf commented 2 years ago

And I now realize that my file had not made it through. Please find it attached here marz_target.fits.zip

Please find my fork here https://github.com/mxhf/Marz

Max

Samreay commented 2 years ago

Ah okay, so Ive dragged it in and had a look around, one thing that jumps up is that the template displays fine in the UI, so the reason its probably not matching is because it is lacking the quasar: true flag in its definition: https://github.com/mxhf/Marz/blob/gh-pages/js/templates.js#L206

For some context, this flag is used to determine what redshift binning the interpolated spectra get put on (https://github.com/mxhf/Marz/blob/gh-pages/js/config.js#L57), and because you don't have quasar=true, its putting them on the redshift binning that isn't able to go to a high enough value of z to match anything. Try adding that boolean flag and let me know if that was the issue :)

mxhf commented 2 years ago

OK, just added the flag. I am getting a cross correlation signal now, so definetly progress. But the peak seems ally wide and the local fit does not quiet find the the correct redshift? Result here:

lae

Ideas?

Samreay commented 2 years ago

I presume this comes from the fact that xcor doesn't fit the actual spectrum itself, but fits the S/N (flux/variance) ratio. When I turn the variance on, I see this:

image

Id be curious after you take your flux and divide it out, how sharp that peak is, and how wide it is, which may cause some ringing and fitting difficulties. Id plot this out separately with matplotlib to confirm, and then you could play around with updating the template to either reflect the shape of a SN peak better, or just change its width

mxhf commented 2 years ago

Ah, interesting. So my template line width indeed seems to have been too wide, and the variance was screwed up. After replacing the variance with a constant value and making the line width smaller, I still got a fit that seemed biased to the blue. I just replaced the mock template (just a gaussian) with a real median stack lyman alpha template and now things seem to work fine. Many thanks!

image