def test_horiz(): c1 = {'zmdl': 0.3, 'h1': 0.3, 'range_km': 1., 'wlshort': 200., 'wllong': 30000., 'wlstep': 20., } TR = lowtran.horiztrans(c1) assert TR.wavelength_nm[[0, -1]].values == approx((30303.03, 200), rel=0.001) assert TR['transmission'][0, [1000, 1200], 0].values == approx([0.980679, 0.959992], rel=0.001)
def test_horiz(): vlim = (200, 30000) c1 = {'zmdl': 0.3, 'h1': 0.3, 'range_km': 1., 'wlnmlim': vlim, } TR = lowtran.horiztrans(c1) assert_allclose(TR.wavelength_nm[[0, -1]], (30303.03, 200), rtol=1e-6) assert_allclose(TR['transmission'][0, [1000, 1200], 0], [0.118356, 0.980377], rtol=0.001)
def main(): p = ArgumentParser(description='Lowtran 7 interface') p.add_argument('-z', '--obsalt', help='altitude of bother observers on horizontal path [km]', type=float, default=0.3) p.add_argument('-r', '--range_km', help='range between observers on horizontal path [km]', type=float, default=1.0) p.add_argument('-a', '--zenang', help='zenith angle [deg] can be single value or list of values', type=float, default=0.) p.add_argument('-w', '--wavelen', help='wavelength range nm (start,stop)', type=float, nargs=2, default=(200, 30000)) P = p.parse_args() c1 = {'zmdl': P.obsalt, 'h1': P.obsalt, 'range_km': P.range_km, 'wlnmlim': P.wavelen, } TR = lowtran.horiztrans(c1).squeeze() plothoriz(TR, c1) show()
def main(): p = ArgumentParser(description='Lowtran 7 interface') p.add_argument('-z', '--obsalt', help='altitude of bother observers on horizontal path [km]', type=float, default=0.3) p.add_argument('-r', '--range_km', help='range between observers on horizontal path [km]', type=float, default=1.0) p.add_argument('-a', '--zenang', help='zenith angle [deg] can be single value or list of values', type=float, default=0.) p.add_argument('-s', '--short', help='shortest wavelength nm ', type=float, default=200) p.add_argument('-l', '--long', help='longest wavelength nm ', type=float, default=30000) p.add_argument('-step', help='wavelength step size cm^-1', type=float, default=20) P = p.parse_args() c1 = {'zmdl': P.obsalt, 'h1': P.obsalt, 'range_km': P.range_km, 'wlshort': P.short, 'wllong': P.long, 'wlstep': P.step, } TR = lowtran.horiztrans(c1).squeeze() plothoriz(TR, c1) show()
Horizontal case. lowtran manual p.36 specify height H1 and RANGE """ from matplotlib.pyplot import show # import lowtran from lowtran.plots import plothoriz if __name__=='__main__': from argparse import ArgumentParser p = ArgumentParser(description='Lowtran 7 interface') p.add_argument('-z','--obsalt',help='altitude of bother observers on horizontal path [km]',type=float,default=0.3) p.add_argument('-r','--range_km',help='range between observers on horizontal path [km]', type=float, default=1.0) p.add_argument('-a','--zenang',help='zenith angle [deg] can be single value or list of values',type=float,default=0.) p.add_argument('-w','--wavelen',help='wavelength range nm (start,stop)',type=float,nargs=2,default=(200,30000)) p=p.parse_args() c1={'zmdl':p.obsalt, 'h1': p.obsalt, 'range_km':p.range_km, 'wlnmlim': p.wavelen, } TR = lowtran.horiztrans(c1).squeeze() plothoriz(TR, c1) show()