Astronomy with SalsaJ

How to determine astronomical distances using Cepheids?

  This exercise enables you to determine the distance from the Sun to the Small Magellanic Cloud by studying a Cepheid and its regular variations of luminosity  How to measure the distance to the stars? Or to the galaxies? Brightness is not a direct measurement of distance, because two very different objects, one faint but close, and the other bright but very distant, may look the same on our sky.

Henrietta Leavitt

  One answer to this question was found in 1912 by American astronomer, Henrietta Leavitt, who investigated the Cepheids, giant yellow stars much more massive than the Sun and hundreds or thousands of times more luminous. These stars are actually like lighthouses for astrophysicists: they can indeed be observed from extremely long distances.

Moreover, they all possess a noteworthy distinctive characteristic: their brightness varies periodically, to a very regular rhythm. Studying these variations, she was able to define a relation between this period and the intrinsic brightness of the star, and hence their distance.

In this exercise, we are going to study a series of images from Cepheids in the Small Magellanic Cloud in order to measure its distance from the Solar System.

A collaboration between Rachel Comte and Weronika Sliwa

  Le Petit Nuage de MagellanVisible to the unaided eye, the Small Magellanic Cloud is a nearby irregular dwarf galaxy which, together with the Large Magellanic Cloud, is in orbit around the Milky Way. With an amount of more than 30 billion stars - among them a lot of cepheids - it belongs to the Local Group, i.e. the special group comprising more than 30 galaxies including ours. This exercise - based on 20 photographs, kindly provided by Bohdan Paczyński for the OGLE collaboration, and the SalsaJ software - will enable you to determine by yourself and without any ugly mathematical formulae the distance from us to the Small Magellanic Cloud.   To do that, you will find below a series of photographs (20) that you will have to study on SalsaJ and an excel answerfile which is to be filled in as one goes along.

  Images (.zip)

Answerfile (.xls)

This exercise is based on material prepared originally by Fabrice Mottez (France) in 2003, then improved by Weronika Sliwa (Poland) and more recently by Rachel Comte (France) and then Gilles Chagnon and Anne-Laure Melchior (France). It has been last updated (2011) by Stefano Bertone (France). It is based on data taken in the Las Campanas Observatory in Chile by the OGLE (Polish/American) collaboration.
How to start:

The "" file contains 20 images displaying the same stars, but at different days and hours of the night. These dates can be known by reading the title of each image file. The file names are provided below.

For example, SMC-Cep-43522-1999-10-24-03-23-25.fits was taken of 24th October 1999 at 03 hours 23 minutes and 25 seconds.





















1. Now copy the Excel file "Answerfile.xls". Open it so that it is ready to be filled in and used. The first and second columns « Day and hour when the photograph was taken » and « Interval time (days) » has been filled for you. Note that you can neglect the minutes but not the hours.

2. Open SalsaJ.

3. (Optional) In the SalsaJ toolbar, click on File/Open. Open the file : images_cepheids/smc_sc5.fits. The cepheid, we will study here, is located at the pixel x=439, y=3435. Find it! Small snapshots centred in this area have been extracted for this exercise and will be used below.

Measure the Photometry with SalsaJ:
4. Open SalsaJ.

5. Open the first photograph images_cepheids/Cep-43522-1999-10-24-03-23-25.fits with File/Open :  salsaJ open button
6. Click on the button in the toolbar « Brightness & Contrast »: salsaJ brightness button

7. A new window appears. Click on « Auto »: the stars will seem much more visible. Next, if necessary, move the cursors « Luminosity », « maximum » et « minimum » (« luminosity » is most of the time enough) in order to have a beautiful image. Close the window « Brightness & Contrast ».

8.      From now on, you can proceed so for all 20 images. In order to ease the procedure, you can also launch the macro “Plugins/Macros/Distance Measurements with Cepheids”, which do this for you.

9. Locate attentively the 4 stars, which are important of our exercise: Cepheid 43255 and 3 stars that we will call “comparison stars” or reference stars. To locate them, use the photograph below.

star field

10.  You are about to start photometric measurements.  Click on the “Photometry” icon. salsaJ photometry
Locate the Cepheid indicate on the figure above. You have to click on its centre on the first image. The star is now encircled and the value of its intensity appears in the Photometry window. Click on the Cepheid on the 19 other images, in the same order as the dates in the Excel file "answerfile.xls".
Use the excel answerfile to plot data:
11. You can then cut the list provided in the Photometry window (all columns, see below) and paste it in a blank excel file.
salsaJ photometry window

12. Last, you can copy the photometric values (the value column) in the Fc (Flux of the Cepheid) column of “Answerfile_cepheid.xls”. The flux is the brightness observed at a certain distance from the source.
You now have Fc for all images in computer units. In order to give our data a physical meaning, we need to know the relation between computer units and W/m2. This is why we will now measure the flux Fr of a reference star.
13. You will now proceed similarly to fill the column entitled Fr (Flux of the reference star). For this, you can choose one of the 3 reference stars indicated on the above figure (and then measure always the same one on the 20 images).

14. The excel sheet determines automatically the Fc/Fr ratio (our physical parameter) in the 5th column.
It also plots the variations of Fc/Fr as a function of time (see image below).

luminosity sinusoid

Physical meaning and interpretation:

15.  At the bottom of the column “Fc/Fr”, you can see in bold the average value of this ratio (when you have filled the 20 lines). Using this ratio and the average flux of the reference star you have chosen (as provided in the first figure, E=... W/m2), you can determine the average flux of the Cepheid “Fc” in  W/m2 and fill in the green cells in your Excel answerfile.

16.   In order to obtain a more precise evaluation of the cepheid period, we will fit data on a generic sinusoid of equation : f(t) = A sin(omega*t + Phi) + B, where

• A is the amplitude of the sinusoid i.e. half the « height » of the curve.

• omega is the pulsation of the sinusoid, that is to say 2*PI / T, where T  is the period of the sinusoid.

• B is the average value of the sinusoid, i.e. the average value of all the values of Fc/Fr.

• Phi is the phase of the sinusoid. Its value is between –PI (-3.14) and +PI (+3.14). If the first points of the curve are under the value of B, the phase is negative, if they are above, the phase is positive.

Try to determine, with a simple observation of the curve, the approximate values of A, T (and thus omega), and phi. B was determined automatically at the bottom of the column Fc/Fr.

17. Write down these approximate values (A, omega, phi and B) in the blue cells made for that in your answerfile. As soon as all the values are typed, the blue column « Approximation » is automatically filled in next to your experimental values of Fc/Fr. This blue column is actually the theoretical values computed with the formula  f(t) = A sin(omega*t + Phi) + B.
The value of the cell “solver” is actually the quadratic sum of the differences between the measured values (photometry on images) and the respective theoretical values (results of the f(t) sinusoid with the imposed parameters) : a 0 value here would mean that the sinusoid perfectly approximates experimental data.

luminosity period fit

18. You will get the plot of the sinusoidal model superposed to your data (see image below).
For a better (and automated) evaluation of the sinusoid parameters, see “Appendix 1”.
fitted cepheids data

19. From the value of omega (= 2*PI/T) possibly improved by the solver, determine the period T of the sinusoid. This is the Pulsation Period of the Cepheid. Fill in the value you found out in the blue cell made for that in your answerfile.
20. The graphic below gives the ratio between the cepheid luminosity and the sun luminosity, i.e. the energy it radiates every unit of time (measured in W), as a function of the cepheid period. Using it and the pulsation period (T in days) you measured, determine the value of the ratio Lc/Ls, where Ls is the luminosity of the Sun.

Luminosity/Period Ratio for standard cepheids

21. Using the figure above, your measurement of the period, and knowing that the sun luminosity Ls is 3.85*1026 W (already filled in in your answerfile), determine the Cepheid (averaged) Luminosity “Lc” in W.

22. From a distance r (in metres), a unity of surface perpendicular to the direction of the Cepheid receives a flux of energy Fc so that Fc=Lc / (4 PI r2). Thus, if we know the luminosity of the Cepheid, and if we measure its flux Fc,  we can determine its distance r.

23. From the values of Fc and Lc you found out in this exercise, all written in your answerfile, determine the distance r between the Cepheid and the Sun. Write it down on your answerfile in the cell made for that, first in metres, then in light years and in parcsecs. As the Cepheid is in the Small Magellanic Cloud, you have just found out the distance to the Sun from this dwarf galaxy in orbit around the Milky Way.
24. The Small Magellanic Cloud is situated at about 61±4 kpc from our Sun. Does the distance you found seem correct? What are the sources of uncertainty of your result? Which of them is most significant? Remember, the results depend on the (unknown) location of the Cepheid within the Magellanic Cloud. Still, as the size of the Small Magellanic Cloud is much smaller than the distance between the Sun and the Magellanic Cloud, this uncertainty does not influence the result very much. However, the Small Magellanic Cloud is elongated along the line of sight which can add some noise. There are also other sources of uncertainty. Space between Small Magellanic Cloud and the Earth is filled with small size particles of dust, partially absorbing the radiation. How does this affect the evaluation of the distances?  
25. You can learn more about the Cepheids at those web pages: (in Polish) (in Polish)

Appendix 1
The following description is intended to adjust the parameters to determine the mean luminosity of the cepheids and its period with a fit. Alternative methods to measure these parameters can be considered.

As Excel, contrary to other software like e.g. Regressi, does not have a function to determine the parameters of a sinusoid (A, B, omega and Phi), we will use the Excel Solver function. It enables to refine our values of A, omega, Phi and B, so that our theoretical values are as close as possible to our experimental ones.
The average value of the differences between the experimental results and the theoretical ones for each image is written in the cell « value of the solver » in your answerfile. One understands easily that the higher this value is, the farther the experimental results are from the theoretical ones. On the contrary, the closer it is to zero, the nearer the theoretical results are from the experience.
You are about to ask Excel to improve the values you found for A, omega, Phi and B in order to reach a value of the solver as close to zero as possible.
Click on the cell which contains the value of the solver (G40 in your answerfile). This cell is your Target Cell. Now click on Tools, then on Solver.
    If Solver doesn't appear in your Tools menu, you should probably activate it in the Tools → Plug-Ins menu.
The following window is now on your screen.

excel solver

1. Check that the cell G40 (“value of the solver”) is written in « Set Target Cell ». If you look back on step 19, you will remember that this value must be as close to zero as possible. Thus choose “Equal To: Value of: 0”.

2. Do not close the window “Solver Parameters” yet. You are now about to tell Excel the values it should modify in order to find the value 0 in your target cell. Above “By Changing Cells”, click on solver button then enter in your answerfile the approximate value of omega you found in step 16.
Click again on solver button, then click on Solve. Your target cell is closer to zero now, and your value of omega has been slightly modified.
3. Repeat again 3 times steps 18, 19 and 20 for the other Changing Cells A, phi, then B. You should now have an excellent theoretical approximation (look at the value of your solver and the values in the blue column “approximation” if you are not convinced!)

Acknowledgments: We are grateful to Fabrice Mottez (CETP) for providing us with the French version of the exercise and to Bohdan Paczyñski for continuous encouragement and help with the selection of appropriate data. We thank OGLE team for permission to use their data in the exercise.  

Updated in 2011 by :

                Stefano Bertone, SYRTE - Observatoire de Paris, France

                Anne Laure Melchior, LERMA - Observatoire de Paris, France