system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do you measure stuff in space? How do we know this star weighs x-times the weight of the sun? And how we know how much the sun weights. Same goes for distances. How can you tell how far something is?
gpt
# Measuring Distance:


There are several methods to calculate the distance of a celestial body. Which one is used depends on the exact circumstance. Here are some of the most important methods:

---

* **Parallax**: Earth orbits the sun. In the process of this orbit, we change our position in space relative to a celestial body (just like you see a nearby tree in a different position if you move 10 steps to one side) Using trigonometry, we can calculate the distance to the celestial body in question. 
 * Advantages: very precise for close objects, no complicated instruments needed. 
 * Disadvantage: only possible for close objects 


---



* **Spectral emission**: Stars emit photons with specific wavelengths based on the material they are fusing in their core. We can identify the composition of a star by analyzing those photons.  Due to the expansion of space, however, the wavelengths of photons emitted very far away get redshifted. That means, their wavelengths get longer the further they travel. By comparing the wavelengths of the photons we *measure* to the wavelengths the photons *should have* we can calculate the distance those photons traveled. And thus the distance to the celestial body. 

 * Advantage: Possible over longer distances

 * Disadvantage: The object has to be bright enough so we can measure spectral lines reliably 


---



* **Standard candles**: Standard candles are celestial bodies of known luminosity (~brightness). We know this luminosity due to the characteristics of some bodies (special types of super novae etc.) By comparing the absolute brightness to the apparent brightness (the brightness the object has vs the brightness we see from the distance) we can calculate the distance to the standard candle. By identifying standard candles in distant galaxies and nebulae, we can infer the distance of those structures. 

 * Advantage: Possible over long distances

 * Disadvantage: We need to find standard candles




# Measuring Mass:

---

* **Orbital Mechanics**: Since we have a fairly good understanding of orbital mechanics in well-behaved spacetime (that is: spacetime that is not curved too much), we can use orbital mechanics to determine the relative mass of two orbiting bodies. That is, if we know the mass of Earth, we can use the shape of the Earth's orbit to determine the mass of the Sun.


----

* **Gravitational Lensing**: Einstein's Theory of General Relativity tells us, that gravity is the curvature of spacetime. As such, the path of photons moving through such curved spacetime appears to be curved to an outside observer. As the curvature at a given distance to an object is proportional to the mass of that object, we can use the path of photons passing by a celestial body to calculate the mass of the body.


---