In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
# built in python modules
import datetime
import logging
import os
import inspect
# python add-ons
import numpy as np
import pandas as pd
In [2]:
import pvlib
from pvlib.location import Location
In [3]:
tus = Location(32.2, -111, 'US/Arizona', 700, 'Tucson')
In [4]:
print(tus)
In [5]:
times = pd.date_range(start=datetime.datetime(2014,6,24), end=datetime.datetime(2014,6,25), freq='1Min', tz=tus.tz)
solpos = pvlib.solarposition.get_solarposition(times, tus.latitude, tus.longitude)
print(solpos.head())
solpos.plot();
In [6]:
pvlib.atmosphere.get_relative_airmass(solpos['zenith']).plot(label='kastenyoung1989, zenith')
pvlib.atmosphere.get_relative_airmass(solpos['apparent_zenith']).plot(label='kastenyoung1989, app. zenith')
pvlib.atmosphere.get_relative_airmass(solpos['zenith'], model='young1994').plot(label='young1994, zenith')
pvlib.atmosphere.get_relative_airmass(solpos['zenith'], model='simple').plot(label='simple, zenith')
plt.legend()
plt.ylabel('Airmass')
plt.ylim(0,100);
In [7]:
plt.plot(solpos['zenith'], pvlib.atmosphere.get_relative_airmass(solpos['zenith'], model='simple'), label='simple')
plt.plot(solpos['zenith'], pvlib.atmosphere.get_relative_airmass(solpos['apparent_zenith']), label='default')
plt.xlim(0,100)
plt.ylim(0,100)
plt.xlabel('Zenith angle (deg)')
plt.ylabel('Airmass')
plt.legend();
In [ ]: