Testing the fitting

  • First we wanted to test that the function we are fitting is actually normalised.
  • The skewed Gaussian function is:
  \begin{equation} f_G(x,y,\mu_x,\mu_y,\sigma_x,\sigma_y,\rho, \beta_1, \beta_2) = \frac{1}{2\pi\sigma_x\sigma_y\sqrt{(1-\rho^2)}} \exp \Bigg\{-\frac{1}{2(1-\rho^2)}\Bigg[\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)^2 + \bigg(\frac{y-\mu_y}{\sigma_y}\bigg)^2 -2\rho\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)\bigg(\frac{y-\mu_y}{\sigma_y}\bigg)\Bigg]\Bigg\} \times \Bigg[1 + \rm{erf} \frac{\beta_x x + \beta_y y}{\sqrt{2}}\Bigg]  \end{equation}
  • Below are some skewed Gaussians for different skews:
  • A normalized function would have values between 0 and 1, but here the values are between 0 and 14. This is because the function is summed over all columns and rows.
  • If one looks at an individual column, it can be seen that the function is indeed normalised.
  • Middle column:
  • At the far columns one can see:


  • Also, the formula was extracted from this reference ( doi: 10.1093/biomet/83.4.715 ) which derives a normalized skewed bivariate Gaussian.
  • We wanted to look at a good star and see how the fit looks like in as much detail as possible, as the summation along rows and columns seems to distort the details of fitting.
  • The fit is done by minimizing the $\chi^2$ in the following way:
  \begin{equation} f(x,y,\vec{\theta}) = \frac{\alpha}{2\pi\sigma_x\sigma_y\sqrt{(1-\rho^2)}} \exp \Bigg\{-\frac{1}{2(1-\rho^2)}\Bigg[\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)^2 + \bigg(\frac{y-\mu_y}{\sigma_y}\bigg)^2 -2\rho\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)\bigg(\frac{y-\mu_y}{\sigma_y}\bigg)\Bigg]\Bigg\} \times \Bigg[1 + \rm{erf} \frac{\beta_x x + \beta_y y}{\sqrt{2}}\Bigg] + \frac{1-\alpha}{N*M}  \end{equation}  \begin{equation} \nu_{ij} = \nu_{\rm{tot}} \int \int_{ij} f(x,y,\vec{\theta}) dx dy  \end{equation}  \begin{equation} \chi^2_P = 2 \sum^{N,M}_{i, j=1} \left( n_{ij} \ln \frac{n_{ij}}{\nu_{ij}} + \nu_{ij} - n_{ij} \right)  \end{equation}  <br />
  • So we fit for 9 parameters.
  • We do not integrate, instead we evaluate the function at the pixel and multiply by pixel area.

  • We fitted this star:
complete_fit.png crop.png
  • Column by column the fit looks like this:
column_15.png column_16.png
column_17.png column_18.png
column_19.png column_20.png
column_21.png column_22.png
column_23.png column_24.png
column_25.png column_26.png
column_27.png column_28.png
column_29.png column_30.png
column_31.png column_32.png
column_33.png column_34.png
column_35.png column_36.png
column_37.png column_38.png
column_39.png column_40.png
column_41.png column_42.png
column_43.png column_44.png
  • The plot parameters are shown below:
$\rho$ 0.0509
$x_0$ 33.5
$y_0$ 33.8
$\sigma_x$ 5.021
$\sigma_y$ 5.373
$\beta_x$ -1.184
$\beta_y$ -1.384
$\alpha$ 0.0014
$\nu_{\rm{tot}}$ 1.71e+06
$\chi^2$ 3222
Degrees of freedom 3591
  • Found its magnitude using two methods, integration of the Gaussian and multiplication of two parameters:
  \begin{equation} \rm{METHOD \ 1} \ \rm{counts} = \int_{0}^{60} f_G(x,y,\vec{\theta}) dx dy = \int_{0}^{60} \frac{\alpha}{2\pi\sigma_x\sigma_y\sqrt{(1-\rho^2)}} \exp \Bigg\{-\frac{1}{2(1-\rho^2)}\Bigg[\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)^2 + \bigg(\frac{y-\mu_y}{\sigma_y}\bigg)^2 -2\rho\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)\bigg(\frac{y-\mu_y}{\sigma_y}\bigg)\Bigg]\Bigg\} \ dx \ dy  \end{equation}  \begin{equation} \rm{METHOD \ 2} \ \rm{counts} = \alpha \times \nu_{tot}  \end{equation}  \begin{equation} \rm{instrumental \ magnitude} = -2.5 \log{\left(\frac{\rm{counts}}{\rm{exposure \ time}}\right)}  \end{equation}  <br />
  • Method 1 gave magnitude = -8.4647927462328827
  • Method 2 gave magnitude = -8.4647927466101169
  • So they are equivalent to 9 decimal places.
  • Therefore we shall use the second method as integration might slow the analysing down, also it would be easier to find the errors using method 2.

Matching stars between images

  • Used Pythagoras to estimate the closest star image to image. Only used stars whose $\chi^2_{\rm reduced}$ were between 0.5 < $\chi^2_{\rm reduced}$ < 1.5
  \begin{equation} \rm{distance}_{ij} = (x_i - x_j)^2 + (y_i - y_j)^2  \end{equation}
  • Went through images and found the image with highest number of stars.
  • This was the base image that all other images were compared to.
  • It worked fine for images in focus and blue filter since they were taken close enough in time for individual stars to not have moved much.
  • In red filter however, there was double matching, when more than one star was matched to the same base star as shown below:


  • Improved the algortihm by:
    • first calculate the minimum distances, some of them will be wronged as stars will be wrongly matched.
    • Use those matches to work out the median x and y shifts.
    • Then check between matches if the x and y shifts match the median x and y shifts to 1 pixel, if they do its a match.
  • Below is the same red image and matches:



HR diagram for Cr39

  • Using the matching and ML fits we got the following HR diagrams:


  • The stars in V-R HR that seem to have the same V-R are indexed 26 and 27. The star with V close to -8 is indexed 2, it appeared 3 times. Star with V close to -7.5 appeared 3 times.
  • The HR diagrams are terrible.
  • From SIMBAD they should look like this:


-- ElenaCukanovaite - 14 Feb 2016

Topic attachments
I Attachment Action Size Date Who Comment
PNGpng 001_50.png manage 81.8 K 14 Feb 2016 - 19:13 ElenaCukanovaite  
PNGpng 003_150.png manage 103.2 K 14 Feb 2016 - 19:13 ElenaCukanovaite  
PNGpng 005_250.png manage 82.2 K 14 Feb 2016 - 19:13 ElenaCukanovaite  
PNGpng B_V_simbad.png manage 49.3 K 18 Feb 2016 - 20:28 ElenaCukanovaite  
PNGpng V_R_simbad.png manage 34.0 K 18 Feb 2016 - 20:28 ElenaCukanovaite  
PNGpng complete_fit.png manage 111.7 K 14 Feb 2016 - 19:21 ElenaCukanovaite  
PNGpng crop.png manage 58.4 K 14 Feb 2016 - 19:21 ElenaCukanovaite  
PNGpng red_first.png manage 513.4 K 18 Feb 2016 - 19:50 ElenaCukanovaite  
PNGpng red_second.png manage 96.4 K 18 Feb 2016 - 20:06 ElenaCukanovaite  
PNGpng red_second_closeup.png manage 39.7 K 18 Feb 2016 - 20:06 ElenaCukanovaite  
PNGpng summed.png manage 139.6 K 14 Feb 2016 - 19:13 ElenaCukanovaite  

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r4 - 19 Feb 2016 - DavidHadden

This site is powered by the TWiki collaboration platformCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback