metal-sn / SESNspectraLib

Contains code that was developed and used in Liu et al. (2016) and Modjaz et al. (2016) to process and analyze spectra of Stripped-Envelope Supenovae (SESNe)."
http://cosmo.nyu.edu/SNYU/
MIT License
1 stars 4 forks source link

release code that uses SNspecFFTsmooth.pro to explicitly obtain the uncertainty array ? #29

Closed mmoJazz closed 8 years ago

mmoJazz commented 8 years ago

One of our big claims in Yuqian's paper is that we have written code that produces the spectral uncertainty array from an input SN spectrum. SNspecFFTsmooth.pro, which we release, produces the smoothed spectrum, but it actually does not explicitly produce the uncertainty spectrum - ie figure 17 in Yuqian's paper. For that an extra step is needed, which we mention in Yuqian's appendix "The second step in our novel method is to calculate the standard deviations of noise within a rolling window with a width that is characteristic of SN features (here, we use a width of 100 Angstrom)."

Should we also release that piece of Yuqian's code? The README says (I think those were Fed's words) about SNspecFFTsmooth.pro: "It should be used to evaluate the uncertainty of spectra in absence of reduction-generated spectral uncertainty arrays, .." - actually I don't think it does, as it stands now.

ALso we may need that specific code to produce the uncertainty array that is required for the template fitting code.

I think we need to. Any thoughts?

fedhere commented 8 years ago

We should definitely include it!

On Tuesday, July 19, 2016, mmoJazz notifications@github.com wrote:

One of our big claims in Yuqian's paper is that we have written code that produces the spectral uncertainty array from an input SN spectrum. If I understand things correctly, SNspecFFTsmooth.pro, which we release, produces the smoothed spectrum, but it actually does not explicitly produce the uncertainty spectrum - ie figure 17 in Yuqian's paper. For that a few extra steps are needed. Should we also release that piece of Yuqian's code? The README says (I think those were Fed's words) about SNspecFFTsmooth.pro: "It should be used to evaluate the uncertainty of spectra in absence of reduction-generated spectral uncertainty arrays, .." - actually it doesn't.

ALso we may need that specific code to produce the uncertainty array that is required for the template fitting code.

Thoughts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nyusngroup/SESNspectraLib/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnkhs6J7ihT5iXviG6ilGM-TI2NAVVjks5qXVyCgaJpZM4JQR54 .


dr. federica bianco NYU-Center for Cosmology & Particle Physics NYU-Center for Urban Science & Progress New York, NY

http://cosmo.nyu.edu/~fb55/


//\ //||\ Please consider the environment before printing this e-mail

email checking schedule: 9-5 on the hour. otherwise sporadically.

yoyo1989 commented 8 years ago

Yes, I agree with you. How about I add that piece of code in SNspecFFTsmooth.pro?

mmoJazz commented 8 years ago

OK sounds good to add it to the end of SNspecFFTsmooth.pro - so that it outputs both smoothed spec and uncertainty array

yoyo1989 commented 8 years ago

Done.

mmoJazz commented 8 years ago

Thanks Yuqian! Well done! Would you mind annotating that part of the code more please? I'm not understanding why the STDEV is computed differently over different parts of the array.THanks

mmoJazz commented 8 years ago

E.g. mention how you compute the rolling window. There is lots of literature how to do it in IDL https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave/Q4Edv3mvch8

I guess we dealt with moving (weighted) averages for the velocities too but I didn't see the same coding there as here in my very quick comparison... THanks!

I'm sure future users will be grateful.

yoyo1989 commented 8 years ago

Yes, STDEV is computed differently over different parts to deal with the edges. For data points near edges, the default rolling window is too large. Thus, I decrease the width of the default rolling window for data points near edges. For the first data point and the last data point, I didn't calculate the standard deviation. I use the absolute value of themselves as the errors. Thus, I calculate STDEV over 5 different parts.

I've added some comments about this in the code.

mmoJazz commented 8 years ago

BIG QUESTION: the code right now says: f_std[j]=stddev(f_ft[j-bin_size/2:j+bin_size/2]) but shouldn't the STDDEV be taken on the difference between f_ft (the smoothed spectrum) and the input (unsmoothed) spectrum (as mentioned in the Appendix)? Hopefully it's just an oversight in this code and not in the code used for all the analysis .. Thanks!

yoyo1989 commented 8 years ago

Thanks! I checked my other code and it's just an oversight in this code. I'll revise it.

yoyo1989 commented 8 years ago

Done.