So far processing the models have been pretty successful, but there seems to be a problem with the cross correlation function for calculating the required shift. So far all values get a zero shift EXCEPT when I do not normalize the function. Any help would be appreciated. In the meantime I will continue to develop the code under the assumption it is right.
Everything up to the cross correlation works as it should. But the output coming from the cross correlation function is showing a shift of zero no matter the shift applied to one of the model spectra’s star.
Below is all the spectra that’s used, and the code can be found here.
At first I thought it may have been my normalization function, but it appears to be working properly as seen below:
![norm](https://wp.wwu.edu/harleyr/files/2016/07/norm-27apf7v-632x474.png)
norm (line 119): The array to use to normalize the result of the cross correlation function.
The totalFlux was also verified to be working with the rest and shifted flux being added together as shown below:
![binary_model_spectra](https://wp.wwu.edu/harleyr/files/2016/07/binary_model_spectra-1czx5gv-632x474.png)
totalFlux[0] (line 113): The combined models of a rest star and one shifted using martins rv tables to determine the velocity difference and added together.
![cont_norm](https://wp.wwu.edu/harleyr/files/2016/07/cont_norm-u4ahvm-632x474.png)
cspec (line 116): The official continuum-normalized spectra of the binary from aspcapStar. Used to cross correlate against the totalFlux. Currently plotting locID=4587, apogeeID= 2M03250916+3126099.
![cross_corr_model_prenorm](https://wp.wwu.edu/harleyr/files/2016/07/cross_corr_model_prenorm-y2l7fw-632x474.png)
vel (line 122): The result after cross correlating the totalFlux and cspec.
![cross_corr_model_postnorm](https://wp.wwu.edu/harleyr/files/2016/07/cross_corr_model_postnorm-2krlbql-632x474.png)
velNorm (line 123): The result after cross correlating the totalFlux and cspec and normalizing it.