The first step in creating a Hubble diagram is to plot the distances to several galaxies. Unfortunately, measuring distances in astronomy is extremely difficult; but fortunately, all you need for a Hubble diagram are relative distances to galaxies, not necessarily their actual or "absolute" distances measured in miles or light-years. Relative distances are measured with respect to a convenient but arbitrary standard like the Andromeda galaxy or the Virgo cluster: we can say that the Perseus Cluster is five times the distance of the Virgo Cluster, for example. To measure relative distance, astronomers need some way to compare galaxies. Since galaxies are so similar, astronomers assume that they all have the same average properties, such as brightness and size. When we assume that two galaxies' intrinsic brightness and size are the same, any differences in brightness or size between them are due only to differing distances away from us. For example, we can assume that a galaxy that appears twice as large as another galaxy is half as far from us.One of the easiest ways to compare galaxies is to compare their magnitudes. Magnitude can be used to measure the brightness of any celestial object, including stars and galaxies. In magnitude, higher numbers correspond to fainter objects, lower numbers to brighter objects; the very brightest objects have negative magnitudes. An increase of one number in magnitude corresponds to an increase in brightness by a factor of about 2.51 - a magnitude four object is 2.51 times brighter than a magnitude five object. The sun has magnitude -26. The brightest star in the Northern sky, Sirius, has magnitude
-1.5. The brightest galaxy is the Andromeda Galaxy, which has magnitude 3.5.
The faintest object you can see with your eyes has a magnitude of about 6. The faintest object the SDSS telescope can see has a magnitude of about 23. SDSS measures magnitudes in five wavelengths of light: ultraviolet (u), green (g), red (r), two infrared wavelengths (i and z).