Atmospheric Monitoring at the Site of the MAGIC Telescopes

The MAGIC telescopes in La Palma, Canary Islands, measure the Cherenkov light emitted by gamma ray-induced extended air showers in the atmosphere. The good knowledge of the atmospheric parameters is important, both for the correct and safe operations of the telescopes, but also for subsequent data analysis. A weather station measures the state variables of the atmosphere, temperature, humidity and wind, an elastic Lidar system and an infrared pyrometer determine the optical transmission of the atmosphere. Using an AllSky camera, the cloud cover can be estimated. The measured values are completed by data from global atmospheric models based on numeric weather forecasts.


Introduction
The Major Atmospheric Gamma Imaging Cherenkov (MAGIC) Telescopes are located in La Palma, Canary Islands, at the Observatorio de Roque de los Muchachos (ORM) at an altitude of about 2200 m above sea level.MAGIC is a stereoscopic system of two 17 m Imaging Air Cherenkov Telescopes.They measure very-high-energetic gamma rays (about 50 GeV to 50 TeV).The first telescope started taking data in 2004, a second telescope was inaugurated in 2009.Subsequent upgrades [1] made the two almost identical and improved their performance.A key feature of each telescope is the large mirror size of 235 m 2 .MAGIC measures gamma rays with a sensitivity of about 0.66% of the Crab Nebula flux above 220 GeV [2], the energy and angular resolutions are between 15% and 24%, and 0.05 • to 0.1 • , respectively.Because of their light weight, a repositioning speed of 7 • /s can be achieved to follow fast transients sources, e. g.Gamma-Ray Bursts.

The MAGIC Site
The ORM is located on the rim of the Caldera de Taburiente where several telescopes are placed close to the top at altitudes around 2400 m above sea level.The MAGIC site is at a lower altitude of 2200 m and generally shows a milder climate, better protected against strong winds from most directions due to the mountain slope.The observatory is situated far away from any significant industrial activities and protected by light pollution laws.
The atmosphere in the Canary Islands is characterized by its stability throughout the year.A temperature inversion layer usually appears around 1300 m a.s.l. on average, separating the moist marine boundary layer and the dry free troposphere.The ORM is always above this stable inversion layer with excellent observing conditions.e-mail: mwill@ifae.es

The Role of the Atmosphere for MAGIC
When a gamma ray interacts in the Earth's atmosphere, pair production and subsequent bremsstrahlung radiation produce secondary particles, initiating an avalanche process that generates hundreds of thousands of electrons and positrons.These secondary particles travel faster than light in the atmosphere, producing Cherenkov radiation.This emission is peaked in the ultraviolet, at a peak wavelength at ground around 290-300 nm.
The atmosphere affects the measured Cherenkov yield in three main ways: The development of particle showers depends on air density and refractive index; the Cherenkov light is absorbed between the emission point and the ground; and the Cherenkov light is scattered on the path to the detector, which causes a blurring and dimming of the detected images.The characterization and monitoring of the atmosphere is a very relevant part of the MAGIC data reconstruction.The main contribution to the systematic uncertainties of imaging Cherenkov telescopes stems from the uncertainty in the determination of the atmospheric transmission at a given time, wavelength, and altitude above ground.For MAGIC, 10% of the uncertainty of the energy scale is due to atmospheric effects [2], and 12% additional uncertainty are introduced on the flux due to run-by-run variations.

Safety Limits of the MAGIC telescope
The correct and safe operation of the telescope requires that weather conditions are appropriate.Within the safety limits, mechanical and electronic components of MAGIC work correctly and do not run any risk of being damaged.These components include the camera protection lids, the camera power supply, and the high voltage of the photomultiplier tubes.Additionally, the telescopes need be parked and secured in case of high wind or other severe weather events.The following limits guarantee that the telescope hardware is not damaged: 1. Peak wind speed < 40 km/h (to open camera lids); 2. Average wind speed < 50 km/h (to move the telescope); 3. Relative humidity inside the camera < 60% (for high voltage); 4. Relative humidity outside < 90% (for data quality).
The part of the telescope that is most affected by wind are the lids of the camera.They extend on either side of the camera when opened and are closed automatically even for short wind gusts that exceed the limit.High wind speeds put great stress on all elements of the telescope dish structure, which can lead to positioning and pointing problems, or even bending or structural breaks.To avoid this, the telescopes are parked and secured if the average wind speed exceeds the limit.The high voltage of the camera is switched off in case of high humidity outside or inside the camera, as high humidity could result in short circuits.Both camera and power supply are designed to be water tight, and only the humidity inside the electronics is important.However, with the outside humidity approaching saturation, the high voltage is switched off as a safety precaution.In these conditions, no observations are possible anyway as the telescopes are in a cloud.

Atmospheric Monitoring Instruments
Several monitoring instruments are used at the MAGIC site.Most of them are located on the roof of the MAGIC Counting House in close proximity to the telescopes, see Fig. 1.These include a commercial weather station, an AllSky camera, and an elastic Lidar system.An infrared pyrometer is mounted on the dish structure of one of the telescopes.

Weather Station
The weather station used at MAGIC site is the Reinhardt MWS-5MV model.The temperature measurement is based on a precision platinum resistance thermometer in a range from −40 • C to +60 • C with an accuracy of ± 0.3 • C. The relative humidity sensor is a fast responding capacitive sensor based on a dielectric polymer, it can be used in a temperature range between −40 • C and +60 • C. The range extends from 10% to 100%, with a measuring accuracy of ± 2%.The pressure sensor is a monolithic, laser-trimmed sensor, the measuring limits are 600 and 1100 hPa with ±0.8 hPa accuracy.The anemometer measures wind speed using a Hall sensor, the wind peak and the average value are determined.The range is from 0 to 150 km/h with ± 2 km/h measuring accuracy.A weather vane with a precision magnetic encoder measures the wind direction in a range of 360 • , the measuring accuracy is 5 • above a starting speed of about 2 km/h.
The recorded data are transmitted to the serial port of a server machine in the MAGIC Counting House.Every two seconds, the station is read out and a data record including the time and date is received and written in a commaseparated text file.The Central Control and the Camera Control programs of MAGIC read this file and act in case a safety limit is violated.The data storage script reads the single string file every two minutes and generates a daily file in which the data are stored continuously.Long-term data is collected for more than 10 years at the MAGIC site.

AllSky Camera
An AllSky camera is installed to detect clouds.The aim is to identify those regions of the sky where the presence of clouds would discourage data taking.This information may be used to change the source schedule dynamically during the night.The camera used at the MAGIC site is the SBIG AllSky-340 using the Kodak KAI-340 CCD with a resolution of 640 x 480 pixels.A fisheye lens with 1.4 mm focal length is mounted on top of the camera.The AllSky camera is mounted close to the weather station on the roof of the Counting House.A full picture is taken every 2 minutes, the images are stored as JPG images and in the FITS format.The pictures are then analyzed to extract information about cloud cover and star visibility.Comparing the found stars in the image and their magnitude with catalog values for position and brightness, patches of clear and cloudy sky are determined [3].

Elastic Lidar
A proper characterization of the atmosphere above the MAGIC site requires a real time range-resolved measurement of the transmission.The Lidar operated together with the MAGIC telescopes is a single-wavelength elastic Lidar.A specific Lidar inversion algorithm has been developed to obtain a vertical profile of the total extinction coefficient due to the presence of clouds and aerosols [4].The Lidar at the MAGIC site is a low power system in order not to disturb the data taking of the MAGIC telescopes or the other telescopes at the ORM.An image of the Lidar can be seen in Fig. 1.
The system consists of a frequency-doubled, passively Q-switched, pulsed Nd:YAG laser.The wavelength is 532 nm, the pulse energy is 5 μJ, the pulse width is 0.5 ns.The pulse repetition frequency is up to 2 kHz, and the beam divergence is 0.05 • .The telescope consists of a 60 cm aluminum mirror with a focal length of 1.5 m.The total weight of the mirror and the telescope frame is around 60 kg.The robotic, computer-controlled equatorial telescope mount ASTELCO NTM-500 is used to move the Lidar.The maximum slewing speed is 30 • /s, and the absolute positioning accuracy is 5 arcsec.A detector module using a Hybrid Photo Detector behind a selective band filter and optics is mounted in the focus of the mirror.The electronics for power supply and amplification are custom made.The charge of a single photo-electron is amplified in two stages.When a photon hits the GaAsP photo-cathode behind the entrance window, an electron is released with the probability of the quantum efficiency of about 50% at 532 nm.The electron is accelerated to the anode over a  .By comparing the found stars and their apparent magnitude with star positions and magnitudes from a catalog, the level of cloud cover can be estimated [3].
several kV acceleration track.There it hits an avalanche diode that is operated in proportional mode.The 8 kV high voltage for the photon detector is supplied by a NIM module.The recording of the time profile of the backscattered photons is done using a computer equipped with a special FADC card.
Typically, the Lidar tracks the current position of the MAGIC telescopes, a data run is taken automatically every 5 min consisting of 50 000 laser shots.The laser is fired along the optical axis of the Lidar telescope, the light is reflected and scattered by molecules (Rayleigh scattering) and particles (aerosol scattering) in the atmosphere.The system offers a large dynamic range for a signal region ranging from distances of 0.5 to 18 km.
From the arrival time and the intesity of the return, the optical transmission can be calculated.This calculation is not trivial since two separate height-dependent parameters, the backscatter coefficient and the atmospheric extinction, have to be extracted from a single return.This is typically done by using complicated algorithms and several assumptions, but for the purposes of correcting the MAGIC data this effort is not necessary.The Lidar returns are analyzed with two methods to determine the total extinction coefficient [4].Both rely on relatively clean regions with a dominant Rayleigh scattering component before and after cloud or aerosol layers, and the excess in return signal due to additional scattering in-between, see Fig. 3.These procedures are possible because MAGIC observes in almost free tropospheric sky conditions.
The first method measures the total attenuation of a cloud layer by comparing the signal before and after the cloud, and using the excess over the Rayleigh scattering part of the signal, to extrapolate to the total aerosol volume scattering coefficient as a function of height.The second method uses an empirically determined Lidar ratio (the extinction-to-backscatter ratio) of K = 26.0 ± 6.0 for the typically thin clouds over La Palma to calculate the total aerosol volume scattering coefficient directly from the ex- cess and the known total molecular scattering coefficient.The Lidar ratio was determined by using the extinction coefficient calculated with the first method and the backscattering coefficient from the Lidar signal for a selected sample of clouds.The vertical profile of the total extinction coefficient of the aerosol scattering is calculated.This profile can be converted into a cumulative transmission profile for the aerosol component, see right panel of Fig. 3, and will serve as input information for all further atmospheric corrections in the MAGIC data analysis chain.
For the analysis of the MAGIC data with corrections for variable atmospheric aerosol transmission, an approach is used which works well for low to medium aerosol extinction.The primary parameter that is affected by clouds or aerosols is the number of Cherenkov photons in the air shower images.The change in light intensity affects the energy reconstruction, which mainly depends on the size parameter of the Hillas parametrization of the recorded image.An air shower affected by aerosol extinction looks like an air shower of smaller energy.The correction can be done by scaling the size parameter to account for lower light content in the image due extinction.With a good approximation of the total light extinction, the energy estimation is up-scaled by the inverse weighted aerosol transmission of the atmosphere.In this way, the energy estimation of each event can be corrected using the real-time range-resolved information of the atmospheric aerosol scattering provided by the Lidar.
Using an optimized atmospheric calibration technique in the MAGIC data analysis chain enables a reliable use of data taken during moderate cloudy conditions.The effective duty cycle of the telescopes is extended by up to 15%.Some low energy events close to the threshold are lost, but for the higher energies, MAGIC gains significantly in observation time.

Infrared Pyrometer
A Heitronics KT 19.82 radiation pyrometer is mounted on the side of the reflector surface of one of the MAGIC telescopes.It moves with the telescope and points to the same sky region as the telescope, the field of view of the pyrometer is 2 • .It can be used to detect the presence of clouds in the MAGIC field of view.The pyrometer measures the integral thermal radiation from the sky in its line of sight using a thermoelectric sensor in the wavelength range from 8 to 14 μm.The measurement is passive and does not disturb the telescope operations.
The pyrometer measures the sky temperature above −100 • C with a resolution of 0.01 • C. The presence of a cloud can be infered since a cloud is "warmer" than the cloudless sky.The cloudiness C is a unitless value between 0 and 100 calculated using an empirically derived function of the sky temperature T sky , zenith angle Z, air temperature T air and relative humidity u, Ground temperature and humidity data from the weather station on the roof of the Counting House are used in this calculation.f (Z) is a function of the zenith angle.
An estimation of the cloud base height is also possible using the sky and ground temperature and assuming a constant temperature lapse rate Γ = 6.49K km −1 in the lower atmosphere, The influence of the humidity is not taken into account in this simple formula, a high water vapor content below the cloud changes the sky temperature.
The cloudiness and cloud base height as determined with the pyrometer are good additions to the transmission measurement from the elastic Lidar system and provide a good overall idea of the cloud cover above the site.As and integrated and not profile-resolved value, the cloudiness cannot be used to correct the gamma-ray data for the effects of clouds and aerosols as described above.

Model Data and Forecasts
MAGIC employs a collection of measurement instruments on site to determine the current atmospheric conditions.To increase the effectiveness of MAGIC observations, and to prepare for potential bad weather, model data and forecast systems are used.

Global Data Assimilation System (GDAS)
Data assimilation is used for the description and prediction of large-scale atmospheric variables, merging realtime measurements from a global, standardized network of instruments with numerical weather forecast models.The numerical models are based on non-linear equations, describing the global atmosphere with high precision on timescales of a few hours.Current data from weather stations, regular weather balloon launches, and satellite data are combined with predicted values from previous iterations of the assimilation process.
One such system is the Global Data Assimilation System.The data is available online, it covers the whole globe on a 1 • by 1 • grid in 3-hourly intervals.The grid point which is closest to the island of La Palma is considered, at 29 • North, 18.00 • West.The point is about 50 km north of the island above the sea, no grid point on the island itself is available.Since the MAGIC weather station is not part of the network feeding into the production of this model, a comparison between the two data sets is reasonable.In Fig. 4, the correlation between predicted GDAS temperature and the value measured by the MAGIC weather station is shown, separately for daytime and nighttime.The correlation is generally good, the small offsets in temperature can be explained by the fact that the GDAS grid point is above the sea as described earlier and residual heat from surrounding structures that influence the measurements.The small offset of 0.6 mbar in pressure lies within the uncertainties of the altitude of the MAGIC weather station (± 3 m) and the precision of the pressure sensor (± 0.8 hPa).
Since the GDAS model is valid at the MAGIC site, the profiles of the atmospheric state variables up to around 25 km can offer many more possibilities to use this information than the single data point the weather stations provides.One important aspect is the determination of the Rayleigh scattering in the atmosphere to improve the data analysis of the elastic Lidar system.When determining the aerosol transmission, the scattering of the returning laser light on air molecules has to be taken into account.Without knowing the detailed profile of the air density, only estimations of the Rayleigh scattering based on an exponential density profiles can be included.Using GDAS, the scattering can be calculated using the density profile at the moment of the Lidar data taking, which significantly improves the reconstruction of the transmission at higher altitudes.

Weather and Aerosol Forecast
To predict the conditions at the MAGIC site hours or even days in the future, several weather services provided online are used.Using the latest images processed from the EUMETSAT satellite data, the cloud conditions can be extrapolated in a simple way to get some idea of weather systems moving towards or away from the Canary islands.More sophisticated forecasts can be obtained through mountain weather forecasts1 websites providing

Outlook and Conclusion
In the near future, MAGIC is planning to implement an adaptive scheduling system.Depending on atmospheric conditions, the schedule of observed sources is changed.This system will combine all the atmospheric data gathered at the site and available otherwise.The weather station data is used to guarantee the safety of the telescopes; the AllSky camera is used to map clear and cloudy sky patches; the elastic Lidar measures cloud height and thickness, and considering the GDAS model the transmission of the atmosphere is determined, complemented by data from the pyrometer; and satellite data and aerosol forecasts can be used to predict the progression of the conditions.
Using those information, the potential lower energy threshold of the MAGIC observations dependent on zenith and transmission can be determined.Only sources which are expected to be seen above this estimated threshold and in a clear part of the sky will be observed.This adaptive scheduling is currently in its final testing phase and will be implemented in the coming months.Potentially, 20% more data of analyzable quality can be gained through this way of scheduling sources.
Several instruments to measure atmospheric parameters and data from external sources is available at the MAGIC site.Measurements have been ongoing for more than one decade, guaranteeing the safety of the telescopes and the high-quality gamma-ray data MAGIC is known for.Correction of data taken under adverse conditions is possible and routinely done in the MAGIC data analysis, increasing even further the potential science output of the instruments.Even more analyzable data is expected through the use of adaptive scheduling taking into account the real-time information available.

Figure 1 .
Figure 1.The atmospheric monitoring instruments placed on the roof of the MAGIC Counting House (left).The small dome contains the elastic Lidar system (right).

Figure 2 .
Figure2.Image of the MAGIC AllSky camera, taken with 60 s exposure (left).By comparing the found stars and their apparent magnitude with star positions and magnitudes from a catalog, the level of cloud cover can be estimated[3].

Figure 3 .
Figure 3. Analysis algorithm for analyzing Lidar data[4].From the range-corrected signal (left), the integral atmospheric aerosol transmission is determined (right).

Figure 4 .
Figure 4. GDAS cross-correlation of atmospheric pressure (left), daytime temperatures (middle), and nighttime temperatures (right) with the measurements of the MAGIC weather station.