#!/usr/bin/env Python3 import numpy as np import matplotlib.pyplot as plt import AstroAtmosphere as atm from ADC import * ''' @author: Joost van den Born @Contact: born@astron.nl @Description: Caclulates the differential dispersion between the ADC and the atmosphere following the ciddor and cassini dispersion model. This script generates figure 4 from the paper. ''' # Initializing ADC object and defining the filter bands adc = ADC() bandName = ['I-band', 'J-band', 'H-band', 'K-band'] bandList = [(0.8, 0.934), (1.15, 1.345), (1.49, 1.78), (1.97, 2.32)] # Some empty lists for later use wavelengthList = [] atDispersionList = [] adcDispersionList = [] for i in range(len(bandList)): # We want to find the dispersion of the atmosphere and # and of the ADC, at z=30 deg. lMin = bandList[i][0] lMax = bandList[i][1] z = 30 # degrees lRange = np.linspace(lMin, lMax, 100) wavelengthList.append(lRange) # Set ADC position optimized for H-band, z=30 deg. atDispersion = atm.quick_dispersion(lMin, lMax, z, conditions='CERRO_ARMAZONES') * 3.6e6 adcOptimumAngle = adc.optimize(atDispersion, lMin, lMax) adc.setOrientation(adcOptimumAngle) # Now iterate over the band to see how the differential dispersion changes atDispersionValues = [] adcDispersionValues = [] for l in lRange: atDispersionValues.append(atm.quick_dispersion(np.min(lRange), l, z, conditions='CERRO_ARMAZONES')* 3.6e6 ) adcDispersionValues.append(adc.calculateDispersion(np.min(lRange),l)[1]) atDispersionList.append(atDispersionValues) adcDispersionList.append(adcDispersionValues) # Calculating the differential dispersion atDispersionList = np.asarray(atDispersionList) adcDispersionList = np.asarray(adcDispersionList) deltaDispersion = atDispersionList - adcDispersionList # Plot the results plt.rc('font', family='serif') plt.rc('axes', labelsize='large') fig = plt.figure(figsize=(9,6)) ax = fig.add_subplot(111) linestyleList = [':', '-.', '--', '-'] for i in range(len(bandList)): ax.plot(wavelengthList[i], deltaDispersion[i], label=bandName[i], linestyle=linestyleList[i], linewidth=2, color='k') ax.set_ylabel('Differential $\Delta$R (mas)', fontsize=18) ax.set_xlabel('$\lambda$ ($\mu$m)', fontsize=18) ax.grid(True, alpha=0.3) ax.legend(fontsize=16, loc='lower right') ax.tick_params(axis ='both', direction='in', labelsize=16) plt.show()