forked from 3rdparty/wrf-python
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
765 B
22 lines
765 B
from __future__ import (absolute_import, division, print_function, |
|
unicode_literals) |
|
|
|
from .decorators import convert_units |
|
from .metadecorators import copy_and_set_metadata |
|
from .util import extract_vars, either |
|
|
|
|
|
# Need to handle either |
|
@copy_and_set_metadata(copy_varname=either("HGT", "HGT_M"), name="terrain", |
|
description="terrain height") |
|
@convert_units("height", "m") |
|
def get_terrain(wrfnc, timeidx=0, method="cat", squeeze=True, |
|
cache=None, meta=False, _key=None, units="m"): |
|
varname = either("HGT", "HGT_M")(wrfnc) |
|
|
|
return extract_vars(wrfnc, timeidx, varname, |
|
method, squeeze, cache, meta=False, |
|
_key=_key)[varname] |
|
|
|
|
|
|