GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — wrf-python/test/test_units.py at develop · xenos-code/wrf-python Expand file tree/ Copy pathtest_units.pyMore file actions 55 lines (35 loc) · 1.29 KB / Copy pathtest_units.pyFile metadata and controls55 lines (35 loc) · 1.29 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 import sys import unittest as ut import numpy.testing as nt import numpy as np import numpy.ma as ma from netCDF4 import Dataset as nc from wrf import getvar TEST_FILE = "/Users/ladwig/Documents/wrf_files/wrfout_d01_2010-06-13_21:00:00" # Python 3 if sys.version_info > (3,): xrange = range class TestUnits(ut.TestCase): longMessage = True def test_temp_units(self): wrfnc = nc(TEST_FILE) for units in ("K", "degC", "degF"): var = getvar(wrfnc, "temp", units=units) self.assertEqual(var.attrs["units"], units) def test_wind_units(self): wrfnc = nc(TEST_FILE) for units in ("m s-1", "kt", "mi h-1", "km h-1", "ft s-1"): var = getvar(wrfnc, "uvmet", units=units) self.assertEqual(var.attrs["units"], units) def test_pres_units(self): wrfnc = nc(TEST_FILE) for units in ("Pa", "hPa", "mb", "torr", "mmHg", "atm"): var = getvar(wrfnc, "slp", units=units) self.assertEqual(var.attrs["units"], units) def test_height_units(self): wrfnc = nc(TEST_FILE) for units in ("m", "km", "dam", "ft", "mi"): var = getvar(wrfnc, "z", units=units) self.assertEqual(var.attrs["units"], units) if __name__ == "__main__": ut.main() |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |