@@ -0,0 +1,1281 @@
+%0Adef airmass(ra,dec,lat_input,lon_input,height_input,time_input='',airmass_min=1,airmass_max=5.8):%0A     %0A%0A     %22%22%22%0A%0A          Airmass calculation at a given time in a particular site.%0A%0A     %22%22%22%0A%0A     %0A%0A     import astropy%0A     from   astropy import units as u%0A     from  astropy.time import Time%0A     from  astropy.coordinates import SkyCoord, EarthLocation, AltAz%0A%0A     # Geodetic coordinates of observatory%0A     observatory = astropy.coordinates.EarthLocation(lat=lat_input*u.deg,lon=lon_input*u.deg,height=height_input*u.m)%0A%0A%0A     # Sky coordinate of an ipix%0A          # (the maximum ipix in the script is suggested)%0A     max_prob_p = SkyCoord(ra=ra*u.deg, dec=dec*u.deg, frame='icrs')%0A%0A     # Time object%0A     time = Time(time_input)%0A     %0A     # coordinate or frame in the Altitude-Azimuth system (Horizontal coordinates).%0A     altaz = max_prob_p.transform_to(AltAz(obstime=time,location=observatory))%0A%0A     #1/cos(altaz)%0A     airmass_value = altaz.secz%0A     %0A     %0A     if airmass_value %3C= airmass_min or airmass_value %3E= airmass_max:%0A          print %22---%3E The airmass of the FOV center is outside the range 1 %3C airmass %3C 5.8. %3C--- %22%0A%0A     else:     %0A          print %22---%3E The airmass of the FOV center is %22, str(round(airmass_value,2))+'. %3C---'%0A%0A     %0A%0A%0A     %0A      %0A      %0A

Create airmass.py