Astrophotography, also known as astronomical imaging, is the photography or imaging of astronomical objects, celestial events, or areas of the night sky. The first photograph of an astronomical object (the Moon) was taken in 1840, but it was not until the late 19th century that advances in technology allowed for detailed stellar photography. Besides being able to record the details of extended objects such as the Moon, Sun, and planets, modern astrophotography has the ability to image objects outside of the visible spectrum of the human eye such as dim stars, nebulae, and galaxies. This is accomplished through long time exposure as both film and digital cameras can accumulate and sum photons over long periods of time or using specialized optical filters which limit the photons to a certain wavelength.
Photography using extended exposure-times revolutionized the field of professional astronomical research, recording hundreds of thousands of new stars, and nebulae invisible to the human eye. Specialized and ever-larger optical telescopes were constructed as essentially big cameras to record images on photographic plates. Astrophotography had an early role in sky surveys and star classification but over time it has used ever more sophisticated image sensors and other equipment and techniques designed for specific fields.
Since almost all observational astronomy today uses photography, the term "astrophotography" usually refers to its use in amateur astronomy, seeking aesthetically pleasing images rather than scientific data. Amateurs use a wide range of special equipment and techniques.
With a few exceptions, astronomical photography employs long exposures since both film and digital imaging devices can accumulate light photons over long periods of time. The amount of light hitting the film or detector is also increased by increasing the diameter of the primary optics (the objective) being used. Urban areas produce light pollution so equipment and observatories doing astronomical imaging are often located in remote locations to allow long exposures without the film or detectors being swamped with stray light.
Since the Earth is constantly rotating, telescopes and equipment are rotated in the opposite direction to follow the apparent motion of the stars overhead (called diurnal motion). This is accomplished by using either equatorial or computer-controlled altazimuth telescope mounts to keep celestial objects centered while the earth rotates. All telescope mount systems suffer from induced tracking errors due to imperfect motor drives, the mechanical sag of the telescope, and atmospheric refraction. Tracking errors are corrected by keeping a selected aiming point, usually a guide star, centered during the entire exposure. Sometimes (as in the case of comets) the object to be imaged is moving, so the telescope has to be kept constantly centered on that object. This guiding is done through a second co-mounted telescope called a "guide scope" or via some type of "off-axis guider", a device with a prism or optical beam splitter that allows the observer to view the same image in the telescope that is taking the picture. Guiding was formerly done manually throughout the exposure with an observer standing at (or riding inside) the telescope making corrections to keep a cross hair on the guide star. Since the advent of computer-controlled systems, this is accomplished by an automated system in professional and even amateur equipment.
Astronomical photography was one of the earliest types of scientific photography  and almost from its inception it diversified into subdisciplines that each have a specific goal including star cartography, astrometry, stellar classification, photometry, spectroscopy, polarimetry, and the discovery of astronomical objects such as asteroids, meteors, comets, variable stars, novae, and even unknown planets. These often require specialized equipment such as telescopes designed for precise imaging, for wide field of view (such as Schmidt cameras), or for work at specific wavelengths of light. Astronomical CCD cameras may cool the sensor to reduce thermal noise and to allow the detector to record images in other spectra such as in infrared astronomy. Specialized filters are also used to record images in specific wavelengths.
The development of astrophotography as a scientific tool was pioneered in the mid-19th century for the most part by experimenters and amateur astronomers, or so-called " gentleman scientists" (although, as in other scientific fields, these were not always men). Because of the very long exposures needed to capture relatively faint astronomical objects, many technological problems had to be overcome. These included making telescopes rigid enough so they would not sag out of focus during the exposure, building clock drives that could rotate the telescope mount at a constant rate, and developing ways to accurately keep a telescope aimed at a fixed point over a long period of time. Early photographic processes also had limitations. The daguerreotype process was far too slow to record anything but the brightest objects, and the wet plate collodion process limited exposures to the time the plate could stay wet. 
The first known attempt at astronomical photography was by Louis Jacques Mandé Daguerre, inventor of the daguerreotype process which bears his name, who attempted in 1839 to photograph the Moon. Tracking errors in guiding the telescope during the long exposure meant the photograph came out as an indistinct fuzzy spot. John William Draper, New York University Professor of Chemistry, physician and scientific experimenter managed to make the first successful photograph of the moon a year later on March 23, 1840, taking a 20-minute-long daguerreotype image using a 5-inch (13 cm) reflecting telescope.
The Sun may have been first photographed in an 1845 daguerreotype by the French physicists Léon Foucault and Hippolyte Fizeau. A failed attempt to obtain a photograph of a Total Eclipse of the Sun was made by the Italian physicist, Gian Alessandro Majocchi during an eclipse of the Sun that took place in his home city of Milan, on July 8, 1842. He later gave an account of his attempt and the Daguerreotype photographs he obtained, in which he wrote:
A few minutes before and after totality an iodized plate was exposed in a camera to the light of the thin crescent, and a distinct image was obtained, but another plate exposed to the light of the corona for two minutes during totality did not show the slightest trace of photographic action. No photographic alteration was caused by the light of the corona condensed by a lens for two minutes, during totality, on a sheet of paper prepared with bromide of silver. 
The Sun's solar corona was first successfully imaged during the Solar eclipse of July 28, 1851. Dr. August Ludwig Busch, the Director of the Königsberg Observatory gave instructions for a local daguerreotypist named Johann Julius Friedrich Berkowski to image the eclipse. Busch himself was not present at Königsberg (now Kaliningrad, Russia), but preferred to observe the eclipse from nearby Rixhoft. The telescope used by Berkowski was attached to 6+1⁄2-inch (17 cm) Königsberg heliometer and had an aperture of only 2.4 in (6.1 cm), and a focal length of 32 in (81 cm). Commencing immediately after the beginning of totality, Berkowski exposed a daguerreotype plate for 84 seconds in the focus of the telescope, and on developing an image of the corona was obtained. He also exposed a second plate for about 40 to 45 seconds but was spoiled when the sun broke out from behind the moon.  More detailed photographic studies of the Sun were made by the British astronomer Warren De la Rue starting in 1861. 
The first photograph of a star was a daguerreotype of the star Vega by astronomer William Cranch Bond and daguerreotype photographer and experimenter John Adams Whipple, on July 16 and 17, 1850 with Harvard College Observatory's 15 inch Great refractor.  In 1863 the English chemist William Allen Miller and English amateur astronomer Sir William Huggins used the wet collodion plate process to obtain the first ever photographic spectrogram of a star, Sirius and Capella.  In 1872 American physician Henry Draper, the son of John William Draper, recorded the first spectrogram of a star (Vega) to show absorption lines. 
Astronomical photography did not become a serious research tool until the late 19th century, with the introduction of dry plate photography.  It was first used by Sir William Huggins and his wife Margaret Lindsay Huggins, in 1876, in their work to record the spectra of astronomical objects. In 1880, Henry Draper used the new dry plate process with photographically corrected 11 in (28 cm) refracting telescope made by Alvan Clark  to make a 51-minute exposure of the Orion Nebula, the first photograph of a nebula ever made. A breakthrough in astronomical photography came in 1883, when amateur astronomer Andrew Ainslie Common used the dry plate process to record several images of the same nebula in exposures up to 60 minutes with a 36 in (91 cm) reflecting telescope that he constructed in the backyard of his home in Ealing, outside London. These images for the first time showed stars too faint to be seen by the human eye.  
The first all-sky photographic astrometry project, Astrographic Catalogue and Carte du Ciel, was started in 1887. It was conducted by 20 observatories all using special photographic telescopes with a uniform design called normal astrographs, all with an aperture of around 13 in (330 mm) and a focal length of 11 ft (3.4 m), designed to create images with a uniform scale on the photographic plate of approximately 60 arcsecs/mm while covering a 2° × 2° field of view. The attempt was to accurately map the sky down to the 14th magnitude but it was never completed.
The beginning of the 20th century saw the worldwide construction of refracting telescopes and sophisticated large reflecting telescopes specifically designed for photographic imaging. Towards the middle of the century, giant telescopes such as the 200 in (5.1 m) Hale Telescope and the 48 in (120 cm) Samuel Oschin telescope at Palomar Observatory were pushing the limits of film photography.
Some progress was made in the field of photographic emulsions and in the techniques of forming gas hypersensitization, cryogenic cooling,  and light amplification, but starting in the 1970s after the invention of the CCD, photographic plates were gradually replaced by electronic imaging in professional and amateur observatories. CCD's are far more light sensitive, do not drop off in sensitivity over long exposures the way film does (" reciprocity failure"), have the ability to record in a much wider spectral range, and simplify storage of information. Telescopes now use many configurations of CCD sensors including linear arrays and large mosaics of CCD elements equivalent to 100 million pixels, designed to cover the focal plane of telescopes that formerly used 10–14-inch (25–36 cm) photographic plates.[ citation needed]
The late 20th century saw advances in astronomical imaging take place in the form of new hardware, with the construction of giant multi-mirror and segmented mirror telescopes. It would also see the introduction of space-based telescopes, such as the Hubble Space Telescope. Operating outside the atmosphere's turbulence, scattered ambient light and the vagaries of weather allows the Hubble Space Telescope, with a mirror diameter of 2.4 metres (94 in), to record stars down to the 30th magnitude, some 100 times dimmer than what the 5-meter Mount Palomar Hale telescope could record in 1949.
Astrophotography is a popular hobby among photographers and amateur astronomers. Techniques ranges from basic film and digital cameras on tripods up to methods and equipment geared toward advanced imaging. Amateur astronomers and amateur telescope makers also use homemade equipment and modified devices.
Images are recorded on many types of media and imaging devices including single-lens reflex cameras, 35 mm film, 120 film, digital single-lens reflex cameras, simple amateur-level, and professional-level commercially manufactured astronomical CCD and CMOS cameras, video cameras, and even off-the-shelf webcams used for Lucky imaging.
The conventional over-the-counter film has long been used for astrophotography. Film exposures range from seconds to over an hour. Commercially available color film stock is subject to reciprocity failure over long exposures, in which sensitivity to light of different wavelengths appears to drop off at different rates as the exposure time increases, leading to a color shift in the image and reduced sensitivity over all as a function of time. This is compensated for, or at least reduced, by cooling the film (see Cold camera photography). This can also be compensated for by using the same technique used in professional astronomy of taking photographs at different wavelengths that are then combined to create a correct color image. Since the film is much slower than digital sensors, tiny errors in tracking can be corrected without much noticeable effect on the final image. Film astrophotography is becoming less popular due to the lower ongoing costs, greater sensitivity, and the convenience of digital photography.
Since the late 1990s amateurs have been following the professional observatories in the switch from film to digital CCDs for astronomical imaging. CCDs are more sensitive than film, allowing much shorter exposure times, and have a linear response to light. Images can be captured in many short exposures to create a synthetic long exposure. Digital cameras also have minimal or no moving parts and the ability to be operated remotely via an infrared remote or computer tethering, limiting vibration. Simple digital devices such as webcams can be modified to allow access to the focal plane and even (after the cutting of a few wires), for long exposure photography. Digital video cameras are also used. There are many techniques and pieces of commercially manufactured equipment for attaching digital single-lens reflex (DSLR) cameras and even basic point and shoot cameras to telescopes. Consumer-level digital cameras suffer from image noise over long exposures, so there are many techniques for cooling the camera, including cryogenic cooling. Astronomical equipment companies also now offer a wide range of purpose-built astronomical CCD cameras complete with hardware and processing software. Many commercially available DSLR cameras have the ability to take long time exposures combined with sequential ( time-lapse) images allowing the photographer to create a motion picture of the night sky. CMOS cameras are increasingly replacing CCD cameras in the amateur sector. 
Both digital camera images and scanned film images are usually adjusted in image processing software to improve the image in some way. Images can be brightened and manipulated in a computer to adjust color and increase the contrast. More sophisticated techniques involve capturing multiple images (sometimes thousands) to composite together in an additive process to sharpen images to overcome atmospheric seeing, negating tracking issues, bringing out faint objects with a poor signal-to-noise ratio, and filtering out light pollution.
Digital camera images may also need further processing to reduce the image noise from long exposures, including subtracting a “dark frame” and a processing called image stacking or " Shift-and-add". Commercial, freeware and free software packages are available specifically for astronomical photographic image manipulation. 
" Lucky imaging" is a secondary technique that involves taking a video of an object rather than standard long exposure photos. Software can then select the highest quality images which can then be stacked. 
Astrophotographic hardware among non-professional astronomers varies widely since the photographers themselves range from general photographers shooting some form of aesthetically pleasing images to very serious amateur astronomers collecting data for scientific research. As a hobby, astrophotography has many challenges that have to be overcome that differ from conventional photography and from what is normally encountered in professional astronomy.
Since most people live in urban areas, equipment often needs to be portable so that it can be taken far away from the lights of major cities or towns to avoid urban light pollution. Urban astrophotographers may use special light-pollution or narrow-band filters and advanced computer processing techniques to reduce ambient urban light in the background of their images. They may also stick to imaging bright targets like the Sun, Moon and planets. Another method used by amateurs to avoid light pollution is to set up, or rent time, on a remotely operated telescope at a dark sky location. Other challenges include setup and alignment of portable telescopes for accurate tracking, working within the limitations of “off the shelf” equipment, the endurance of monitoring equipment, and sometimes manually tracking astronomical objects over long exposures in a wide range of weather conditions.
Some camera manufacturers modify their products to be used as astrophotography cameras, such as Canon's EOS 60Da, based on the EOS 60D but with a modified infrared filter and a low-noise sensor with heightened hydrogen-alpha sensitivity for improved capture of red hydrogen emission nebulae. 
There are also cameras specifically designed for amateur astrophotography based on commercially available imaging sensors. They may also allow the sensor to be cooled to reduce thermal noise in long exposures, provide raw image readout, and to be controlled from a computer for automated imaging. Raw image readout allows later better image processing by retaining all the original image data which along with stacking can assist in imaging faint deep sky objects.
With very low light capability, a few specific models of webcams are popular for Solar, Lunar, and Planetary imaging. Mostly, these are manually focused cameras containing a CCD sensor instead of the more common CMOS. The lenses of these cameras are removed and then these are attached to telescopes to record images, videos, or both. In newer techniques, videos of very faint objects are taken and the sharpest frames of the video are 'stacked' together to obtain a still image of respectable contrast. The Philips PCVC 740K and SPC 900 are among the few webcams liked by astrophotographers. Any smartphone that allows long exposures can be used for this purpose, but some phones have a specific mode for astrophotography that will stitch together multiple exposures.
The most basic types of astronomical photographs are made with standard cameras and photographic lenses mounted in a fixed position or on a tripod. Foreground objects or landscapes are sometimes composed in the shot. Objects imaged are constellations, interesting planetary configurations, meteors, and bright comets. Exposure times must be short (under a minute) to avoid having the stars point image become an elongated line due to the Earth's rotation. Camera lens focal lengths are usually short, as longer lenses will show image trailing in a matter of seconds. A rule of thumb called the 500 rule states that, to keep stars point-like,
regardless of aperture or ISO setting.  For example, with a 35 mm lens on an APS-C sensor, the maximum time is 500/35 × 1.5 ≈ 9.5 s. A more accurate calculation takes into account pixel pitch and declination. 
Allowing the stars to intentionally become elongated lines in exposures lasting several minutes or even hours, called “ star trails”, is an artistic technique sometimes used.
Telescope mounts that compensate for the Earth's rotation are used for longer exposures without objects being blurred. They include commercial equatorial mounts and homemade equatorial devices such as barn door trackers and equatorial platforms. Mounts can suffer from inaccuracies due to backlash in the gears, wind, and imperfect balance, and so a technique called auto guiding is used as a closed feedback system to correct for these inaccuracies. 
Tracking mounts can come in two forms; single axis and dual axis. Single axis mounts are often known as star trackers. Star trackers have a single motor which drives the right ascension axis. This allows the mount to compensate for the Earth's rotation. Star trackers rely on the user ensuring the mount is polar aligned with high accuracy, as it is unable correct in the secondary declination axis, limiting exposure times.
Dual axis mounts use two motors to drive both the right ascension and the declination axis together. This mount will compensate for the Earth's rotation by driving the right ascension axis, similar to a star tracker. However using an auto-guiding system, the secondary declination axis can also be driven, compensating for errors in polar alignment, allowing for significantly longer exposure times. 
Piggyback astronomical photography is a method where a camera/lens is mounted on an equatorially mounted astronomical telescope. The telescope is used as a guide scope to keep the field of view centered during the exposure. This allows the camera to use a longer exposure and/or a longer focal length lens or even be attached to some form of photographic telescope co-axial with the main telescope.
In this type of photography, the telescope itself is used as the "lens" collecting light for the film or CCD of the camera. Although this allows for the magnification and light-gathering power of the telescope to be used, it is one of the most difficult astrophotography methods.  This is because of the difficulties in centering and focusing sometimes very dim objects in the narrow field of view, contending with magnified vibration and tracking errors, and the added expense of equipment (such as sufficiently sturdy telescope mounts, camera mounts, camera couplers, off-axis guiders, guide scopes, illuminated cross-hairs, or auto-guiders mounted on primary telescope or the guide-scope.) There are several different ways cameras (with removable lenses) are attached to amateur astronomical telescopes including:  
When the camera lens is not removed (or cannot be removed) a common method used is afocal photography, also called afocal projection. In this method, both the camera lens and the telescope eyepiece are attached. When both are focused at infinity the light path between them is parallel ( afocal), allowing the camera to basically photograph anything the observer can see. This method works well for capturing images of the moon and brighter planets, as well as narrow field images of stars and nebulae. Afocal photography was common with early 20th-century consumer-level cameras since many models had non-removable lenses. It has grown in popularity with the introduction of point and shoot digital cameras since most models also have non-removable lenses.
Fast Internet access in the last part of the 20th century, and advances in computer-controlled telescope mounts and CCD cameras, allows use of 'Remote Telescopes' for amateur astronomers not aligned with major telescope facilities to partake in research and deep-sky imaging. This enables the imager to control a telescope far away in a dark location. The observers can image through the telescopes using CCD cameras.
Imaging can be done regardless of the location of the user or the telescopes they wish to use. The digital data collected by the telescope is then transmitted and displayed to the user by means of the Internet. An example of a digital remote telescope operation for public use via the Internet is The Bareket Observatory.
20sec exposure photograph taken with a tripod mounted DSLR camera with 18-55mm lens
Fixed tripod mounted camera capturing " star trails"
Star trails photographed in earth orbit from the International Space Station
Fixed tripod image of a solar eclipse using a digital-SLR camera with a 500 mm lens
1 minute exposure using ISO 800 film, wide angle lens, piggybacked on an equatorial telescope
Comet Hale-Bopp, camera with a 300mm lens piggybacked
The Moon photographed using the Afocal technique, using 10 seconds of video stacked to create a final image.
A composite of several Digital-SLR photos compiled in Photoshop taken via eyepiece projection from an 8-inch Schmidt Cassegrain telescope.
In 1850 [...] the first daguerreotype ever made of a star, the bright Vega, was taken by J.A. Whipple working under W.C. Bond