Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional templates #151

Open
mxhf opened this issue Mar 25, 2022 · 9 comments
Open

Additional templates #151

mxhf opened this issue Mar 25, 2022 · 9 comments

Comments

@mxhf
Copy link

mxhf commented Mar 25, 2022

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
Copy link
Owner

Samreay commented Mar 26, 2022

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

@mxhf
Copy link
Author

mxhf commented Mar 30, 2022

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
Copy link
Owner

Samreay commented Mar 30, 2022

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
Copy link
Author

mxhf commented Mar 31, 2022 via email

@mxhf
Copy link
Author

mxhf commented Apr 4, 2022

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
Copy link
Owner

Samreay commented Apr 4, 2022

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
Copy link
Author

mxhf commented Apr 4, 2022

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
Copy link
Owner

Samreay commented Apr 4, 2022

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
Copy link
Author

mxhf commented Apr 4, 2022

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

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

No branches or pull requests

2 participants