def __init__(self): self.a = air.Air() self.mu_vals = { 'T': [-5, 0, 10, 15, 25], 'mu': [ 1.7105007E-5, 1.7362065e-5, 1.7869785E-5, 1.8120528E-5, 1.861598E-5 ] } self.rho_vals = { 'T': [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 ], 'P': [ 200, 200, 200, 200, 800, 800, 800, 800, 1000, 1000, 1000, 1000, 200, 200, 200, 200, 800, 800, 800, 800, 1000, 1000, 1000, 1000 ], 'RH': [ 25, 50, 75, 90, 25, 50, 75, 90, 25, 50, 75, 90, 25, 50, 75, 90, 25, 50, 75, 90, 25, 50, 75, 90 ], 'rho': [ 0.254, 0.254, 0.253, 0.252, 1.020, 1.019, 1.018, 1.018, 1.275, 1.274, 1.273, 1.273, 0.230, 0.227, 0.223, 0.221, 0.931, 0.928, 0.924, 0.922, 1.165, 1.161, 1.158, 1.156 ] }
def __init__(self, dma): self.air = air.Air() self.dma = dma self.files = [] self.diam_interp = 0 self.buildGrid() self.dn_interp = None self.date = [] self.cn_raw = None self.cn_smoothed = None self.diam = None self.lag = 10 # Smoothing parameter for the LOWESS smoothing self.alpha = 0.3
def test_mfp(): """ Test the calculation of the mean free path against the standard using the mean free path at standard conditions (0.066 um; from Hand 1999, p 21) """ p = [100, 500, 800, 1000] print('') print('========= Testing MEAN FREE PATH Calculations =========') print(' P mfp mfp r ') print('======= ========= ========= =======') for i in p: ltest = 0.066 / i * 1013.25 / 1e6 a = air.Air(20, i) print(i, a.l(), ltest, abs(ltest - a.l()) / ltest) assert abs(ltest - a.l()) / ltest < 0.01 print(' ')
def check_rho(atm, val, tol): kwargs = {"rh": atm['RH']} a = air.Air(atm['T'], atm['P'], **kwargs) print(a.t, a.p, atm['RH'], val, a.rho(), abs((val - a.rho()) / val)) assert abs((val - a.rho()) / val) < tol
def check_mu(t, val, tol): a = air.Air(t, 850) print(a.t, a.mu(), abs((val - a.mu()) / val)) assert abs((val - a.mu()) / val) < tol