<p>Why not fit the orders you are interested in separately and then use the standard error of the mean (possibly weighted by the signal-to-noise in each CCF) as the <em>precision</em> in the final, averaged RV.</p>
<p>In terms of what to fit, I don't see why a Gaussian is so bad? You probably need to limit the fit to the inner <span class="math-container">$\sim \pm 1 \sigma$</span> to avoid noise outside the peak pulling the fit one way or another. Other options are to just use the numerical centroid (but this may be affected by asymmetry) or you could use a sinc function to the central region (sometimes a better model of the peak of a CCF).</p>
<p>Edit: You haven't followed my advice, which was to limit the Gaussian fit to <span class="math-container">$\pm 1$</span> sigma from the peak (do it iteratively). At the moment, the &quot;wings&quot; of the Gaussian are just adding noise.</p>
<p>As a rule of thumb though, you are not going to do much better than <span class="math-container">$2.2\sigma$</span>  divided by the signal-to-noise ratio. It looks like your <span class="math-container">$\sigma \sim 2$</span> km/s and your signal-to-noise ratio is about 30, so I don't see how you can have gotten a scatter as small as you have from data like this? And the graph below contains no points with the value <span class="math-container">$-10.76$</span>. There is still something missing from your question.</p>

CC BY-SA 4.0
2020-06-18T20:53:36.490Z
Fitting each order is worse because the CCFs by order at least in orders where SNR is low it does not look like a gaussian at all. The Gaussian curve is fine, I meant that the time-series RVs are quite poor. I do not see the trend I should see which is the Rossiter effect. Btw, I am gonna try it now these advice. Thanks a lot @Jeffries!
Douglas Rodrigues Alves
CC BY-SA 4.0
2020-06-18T20:57:48.870Z
@DouglasRodriguesAlves perhaps you should show what you are dealing with then, rather than examples that look perfectly fittable by regular functions. Your RVs can be bad for all sorts of reasons, not just whether you can fit the CCFs.
ProfRob
CC BY-SA 4.0
2020-06-26T21:27:39.150Z
The time-series is coming from the sum of several orders. The CCF is a single order fitting. For constraining the center in the 1-$\sigma$ range should I define a center and put bounds where 68% of the data falls within it, then I fit a Gaussian to it?

About the error bars, I was told that this data is photon noise limited hence I must get the error bars from a derived formula proportional to flux, wavelength and resolution power. But I am not certain.
Douglas Rodrigues Alves
CC BY-SA 4.0
2020-06-26T21:54:37.337Z
How did you find a SNR ~ 30 ? I estimated to be SNR ~ (2300 - 600) / 200 where 2300 is more or less where I set the zero level, minimum is at approx 600 and 200 is the half width from 2300 to 2500 roughly where the noise is. Then SNR ~ 8.5 not 30.
Douglas Rodrigues Alves
CC BY-SA 4.0
2020-06-27T00:05:39.297Z
@DouglasRodriguesAlves ok, your estimate is better. So you expect an even bigger error on the RV. I was estimating an error from your error bars, which is what matters. Do the fitting in two stages. Use the fit you show to estimate the mean and std Dev, then redo the fit to the range mean +/- std dev. If the SNR is about 10 per order and you have 20 orders, that's a combined SNR of only about 45.
ProfRob
CC BY-SA 4.0
2020-06-27T03:01:56.123Z
Thank you for the help @RobJeffries, I am trying your suggestions, it takes me a while to  implement the codes...
Douglas Rodrigues Alves
CC BY-SA 4.0
2020-06-16T14:46:45.993Z
2020-06-23T07:18:30.333Z
2020-06-23T07:18:30.333Z
ProfRob
<p>How can I better fit a Gaussian curve to a CCF so that I get the most precise RV value? The image below shows the fitting where I compared the fitting by weighting by the uncertainties and not. There is not a big difference between them because the errors are nearly the same for all data points.</p>
<p><a href="https://i.sstatic.net/RrnLF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RrnLF.png" alt="enter image description here" /></a></p>
<p>The RV is the <span class="math-container">$\mu$</span> and the uncertainty was gotten from the covariance matrix first time in the diagonal. Performing a similar procedure but for summing several orders (such as fig. below) gives me the RV time-series which has too much spread. I need to find a way to reduce the noise as much as possible. I am not showing the errors in RV time-series because I thought it to be coming from the covariance matrix but it looks unrealistic (too big).</p>
<p><a href="https://i.sstatic.net/AQhEG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AQhEG.png" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/Fcris.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Fcris.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2020-06-16T13:33:58.420Z
I modified the question and added a few CCFs, hope it is clearer. X-axis has arbitrary units in RVs.
Douglas Rodrigues Alves
<radial-velocity>
Computing radial-velocities from Cross Correlation data
Douglas Rodrigues Alves
# Computing radial-velocities from Cross Correlation data

(Asked by: username_0 on 2020-06-14)

How can I better fit a Gaussian curve to a CCF so that I get the most precise RV value? The image below shows the fitting where I compared the fitting by weighting by the uncertainties and not. There is not a big difference between them because the errors are nearly the same for all data points.

[![enter image description here](https://i.sstatic.net/RrnLF.png)](https://i.sstatic.net/RrnLF.png)

The RV is the $\mu$ and the uncertainty was gotten from the covariance matrix first time in the diagonal. Performing a similar procedure but for summing several orders (such as fig. below) gives me the RV time-series which has too much spread. I need to find a way to reduce the noise as much as possible. I am not showing the errors in RV time-series because I thought it to be coming from the covariance matrix but it looks unrealistic (too big).

[![enter image description here](https://i.sstatic.net/AQhEG.png)](https://i.sstatic.net/AQhEG.png)

[![enter image description here](https://i.sstatic.net/Fcris.png)](https://i.sstatic.net/Fcris.png)

**Tags:** radial-velocity
> **Comments:**
> **username_0**: I modified the question and added a few CCFs, hope it is clearer. X-axis has arbitrary units in RVs.  

---

## 1 answers

### Answer by username_1 on 2020-06-16. Score: 1

Why not fit the orders you are interested in separately and then use the standard error of the mean (possibly weighted by the signal-to-noise in each CCF) as the *precision* in the final, averaged RV.

In terms of what to fit, I don't see why a Gaussian is so bad? You probably need to limit the fit to the inner $\sim \pm 1 \sigma$ to avoid noise outside the peak pulling the fit one way or another. Other options are to just use the numerical centroid (but this may be affected by asymmetry) or you could use a sinc function to the central region (sometimes a better model of the peak of a CCF).

Edit: You haven't followed my advice, which was to limit the Gaussian fit to $\pm 1$ sigma from the peak (do it iteratively). At the moment, the "wings" of the Gaussian are just adding noise.

As a rule of thumb though, you are not going to do much better than $2.2\sigma$ divided by the signal-to-noise ratio. It looks like your $\sigma \sim 2$ km/s and your signal-to-noise ratio is about 30, so I don't see how you can have gotten a scatter as small as you have from data like this? And the graph below contains no points with the value $-10.76$. There is still something missing from your question.

> **Comments:**
> **username_0**: Fitting each order is worse because the CCFs by order at least in orders where SNR is low it does not look like a gaussian at all. The Gaussian curve is fine, I meant that the time-series RVs are quite poor. I do not see the trend I should see which is the Rossiter effect. Btw, I am gonna try it now these advice. Thanks a lot @Jeffries!  
> **username_1**: @DouglasRodriguesAlves perhaps you should show what you are dealing with then, rather than examples that look perfectly fittable by regular functions. Your RVs can be bad for all sorts of reasons, not just whether you can fit the CCFs.  
> **username_0**: The time-series is coming from the sum of several orders. The CCF is a single order fitting. For constraining the center in the 1-$\sigma$ range should I define a center and put bounds where 68% of the data falls within it, then I fit a Gaussian to it?  About the error bars, I was told that this data is photon noise limited hence I must get the error bars from a derived formula proportional to flux, wavelength and resolution power. But I am not certain.  
> **username_0**: How did you find a SNR ~ 30 ? I estimated to be SNR ~ (2300 - 600) / 200 where 2300 is more or less where I set the zero level, minimum is at approx 600 and 200 is the half width from 2300 to 2500 roughly where the noise is. Then SNR ~ 8.5 not 30.  
> **username_1**: @DouglasRodriguesAlves ok, your estimate is better. So you expect an even bigger error on the RV. I was estimating an error from your error bars, which is what matters. Do the fitting in two stages. Use the fit you show to estimate the mean and std Dev, then redo the fit to the range mean +/- std dev. If the SNR is about 10 per order and you have 20 orders, that's a combined SNR of only about 45.  
> **username_0**: Thank you for the help @RobJeffries, I am trying your suggestions, it takes me a while to  implement the codes...  

---

