Return the two-dimensional field interpolated along a line. This line is defined by either including the *pivot_point* and *angle* parameters, or the *start_point* and *end_point* parameters. The *pivot_point*, *start_point*, and *end_point* coordinates can be defined in either x,y
(field2d, wrfin=None, timeidx=0, stagger=None, projection=None,
ll_point=None,
pivot_point=None, angle=None, start_point=None,
end_point=None, latlon=False,
cache=None, meta=True)
| 364 | |
| 365 | @set_interp_metadata("line") |
| 366 | def interpline(field2d, wrfin=None, timeidx=0, stagger=None, projection=None, |
| 367 | ll_point=None, |
| 368 | pivot_point=None, angle=None, start_point=None, |
| 369 | end_point=None, latlon=False, |
| 370 | cache=None, meta=True): |
| 371 | """Return the two-dimensional field interpolated along a line. |
| 372 | |
| 373 | This line is defined by either including the |
| 374 | *pivot_point* and *angle* parameters, or the *start_point* and |
| 375 | *end_point* parameters. The *pivot_point*, *start_point*, and *end_point* |
| 376 | coordinates can be defined in either x,y or latitude,longitude space. |
| 377 | If latitude,longitude coordinates are used, then a WRF input file or |
| 378 | map projection must also be specified. |
| 379 | |
| 380 | Args: |
| 381 | |
| 382 | field2d (:class:`xarray.DataArray` or :class:`numpy.ndarray`): |
| 383 | A two-dimensional field. |
| 384 | |
| 385 | wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ |
| 386 | iterable, optional): WRF-ARW NetCDF |
| 387 | data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile` |
| 388 | or an iterable sequence of the aforementioned types. This is used |
| 389 | to obtain the map projection when using latitude,longitude |
| 390 | coordinates. Should not be used when working with x,y |
| 391 | coordinates. Default is None. |
| 392 | |
| 393 | timeidx (:obj:`int`, optional): The |
| 394 | desired time index when obtaining map boundary information |
| 395 | from moving nests. This value can be a positive or negative |
| 396 | integer. Only required when *wrfin* is specified and the nest is |
| 397 | moving. Currently, :data:`wrf.ALL_TIMES` is not supported. |
| 398 | Default is 0. |
| 399 | |
| 400 | stagger (:obj:`str`): If using latitude, longitude coordinate pairs |
| 401 | for *start_point*, *end_point*, or *pivot_point*, |
| 402 | set the appropriate grid staggering type for *field2d*. By default, |
| 403 | the mass grid is used. The options are: |
| 404 | |
| 405 | - 'm': Use the mass grid (default). |
| 406 | - 'u': Use the same staggered grid as the u wind component, |
| 407 | which has a staggered west_east (x) dimension. |
| 408 | - 'v': Use the same staggered grid as the v wind component, |
| 409 | which has a staggered south_north (y) dimension. |
| 410 | |
| 411 | projection (:class:`wrf.WrfProj`, optional): The map |
| 412 | projection object to use when working with latitude, longitude |
| 413 | coordinates, and must be specified if *wrfin* is None. Should |
| 414 | not be used when working with x,y coordinates. Default |
| 415 | is None. |
| 416 | |
| 417 | ll_point (:class:`wrf.CoordPair`, sequence of :class:`wrf.CoordPair`, \ |
| 418 | optional): The lower left latitude, longitude point for your domain, |
| 419 | and must be specified |
| 420 | if *wrfin* is None. If the domain is a moving nest, this should be |
| 421 | a sequence of :class:`wrf.CoordPair`. Default is None. |
| 422 | |
| 423 | pivot_point (:class:`wrf.CoordPair`, optional): A coordinate pair for |