Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, water and carbon dioxide to produce oxygen and energy in the form of glucose. It takes place in two stages - the light dependent reaction which uses energy from sunlight to convert water to oxygen and produces ATP and NADPH, and the light independent reaction (Calvin cycle) which uses ATP and NADPH to incorporate carbon from carbon dioxide into organic compounds. There are several factors that affect the rate of photosynthesis including light intensity, temperature, carbon dioxide concentration, and water availability.